diff --git a/apps/api/prisma/migrations/20240921234642_add_user_entitlement/migration.sql b/apps/api/prisma/migrations/20240921234642_add_user_entitlement/migration.sql new file mode 100644 index 00000000..9be8c6a5 --- /dev/null +++ b/apps/api/prisma/migrations/20240921234642_add_user_entitlement/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable +ALTER TABLE "User" ADD COLUMN "entitlement" TEXT, +ADD COLUMN "entitlementExpiresAt" TIMESTAMP(3), +ADD COLUMN "entitlementProductIdentifier" TEXT; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 3a06b356..26e5a8cd 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -23,8 +23,13 @@ model User { createdAt DateTime @default(now()) updatedAt DateTime @updatedAt - email String @unique - name String? + email String @unique + name String? + + entitlement String? + entitlementExpiresAt DateTime? + entitlementProductIdentifier String? + walletAccounts UserWalletAccount[] budgetUsers BudgetUser[] transactions Transaction[] diff --git a/apps/api/v1/services/user.service.ts b/apps/api/v1/services/user.service.ts index eea729cf..09a4dd00 100644 --- a/apps/api/v1/services/user.service.ts +++ b/apps/api/v1/services/user.service.ts @@ -1,5 +1,11 @@ import type { CreateUser } from '@6pm/validation' +import type { User } from '@prisma/client' +import { getLogger } from '../../lib/log' import prisma from '../../lib/prisma' +import { + getCustomerActiveSubscription, + getOrCreateCustomer, +} from './revenue-cat.service' export async function findUserById(id: string) { return await prisma.user.findUnique({ @@ -37,3 +43,59 @@ export async function deleteUser(userId: string) { }, }) } + +export async function syncUserSubscription(user: User) { + const logger = getLogger(`${syncAllUsersSubscription.name}:${user.id}`) + + logger.info('Current user %o', user) + + const customer = await getOrCreateCustomer({ + userId: user.id, + }) + + const activeSubscription = getCustomerActiveSubscription(customer) + + const updatedUser = await prisma.user.update({ + where: { id: user.id }, + data: { + entitlement: activeSubscription?.entitlement ?? null, + entitlementExpiresAt: activeSubscription?.subscription.expires_date + ? new Date(activeSubscription.subscription.expires_date) + : null, + entitlementProductIdentifier: + activeSubscription?.subscription.product_identifier ?? null, + }, + }) + + logger.info('Updated user %o', updatedUser) + + return updatedUser +} + +export async function syncAllUsersSubscription() { + const logger = getLogger(syncAllUsersSubscription.name) + const users = await prisma.user.findMany() + const failed = [] + + logger.info('Syncing %d users', users.length) + + for (const user of users) { + try { + await syncUserSubscription(user) + logger.info('Synced user %s', user.email) + } catch (error) { + failed.push(user.email) + + logger.warn('Failed to sync user %s', user.email) + logger.error(error) + } + } + + logger.info('Synced %d users. Failed %d', users.length, failed.length) + + return { + total: users.length, + success: users.length - failed.length, + failed, + } +} diff --git a/packages/validation/src/prisma/index.ts b/packages/validation/src/prisma/index.ts index d6256b59..0e600993 100644 --- a/packages/validation/src/prisma/index.ts +++ b/packages/validation/src/prisma/index.ts @@ -34,7 +34,7 @@ export const isValidDecimalInput = export const TransactionIsolationLevelSchema = z.enum(['ReadUncommitted','ReadCommitted','RepeatableRead','Serializable']); -export const UserScalarFieldEnumSchema = z.enum(['id','createdAt','updatedAt','email','name']); +export const UserScalarFieldEnumSchema = z.enum(['id','createdAt','updatedAt','email','name','entitlement','entitlementExpiresAt','entitlementProductIdentifier']); export const RelationLoadStrategySchema = z.enum(['query','join']); @@ -96,6 +96,9 @@ export const UserSchema = z.object({ updatedAt: z.coerce.date(), email: z.string(), name: z.string().nullable(), + entitlement: z.string().nullable(), + entitlementExpiresAt: z.coerce.date().nullable(), + entitlementProductIdentifier: z.string().nullable(), }) export type User = z.infer @@ -505,6 +508,9 @@ export const UserSelectSchema: z.ZodType = z.object({ updatedAt: z.boolean().optional(), email: z.boolean().optional(), name: z.boolean().optional(), + entitlement: z.boolean().optional(), + entitlementExpiresAt: z.boolean().optional(), + entitlementProductIdentifier: z.boolean().optional(), walletAccounts: z.union([z.boolean(),z.lazy(() => UserWalletAccountFindManyArgsSchema)]).optional(), budgetUsers: z.union([z.boolean(),z.lazy(() => BudgetUserFindManyArgsSchema)]).optional(), transactions: z.union([z.boolean(),z.lazy(() => TransactionFindManyArgsSchema)]).optional(), @@ -861,6 +867,9 @@ export const UserWhereInputSchema: z.ZodType = z.object({ updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), email: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), name: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + entitlement: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountListRelationFilterSchema).optional(), budgetUsers: z.lazy(() => BudgetUserListRelationFilterSchema).optional(), transactions: z.lazy(() => TransactionListRelationFilterSchema).optional(), @@ -876,6 +885,9 @@ export const UserOrderByWithRelationInputSchema: z.ZodType SortOrderSchema).optional(), email: z.lazy(() => SortOrderSchema).optional(), name: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + entitlement: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + entitlementExpiresAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + entitlementProductIdentifier: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), walletAccounts: z.lazy(() => UserWalletAccountOrderByRelationAggregateInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserOrderByRelationAggregateInputSchema).optional(), transactions: z.lazy(() => TransactionOrderByRelationAggregateInputSchema).optional(), @@ -906,6 +918,9 @@ export const UserWhereUniqueInputSchema: z.ZodType createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), name: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + entitlement: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountListRelationFilterSchema).optional(), budgetUsers: z.lazy(() => BudgetUserListRelationFilterSchema).optional(), transactions: z.lazy(() => TransactionListRelationFilterSchema).optional(), @@ -921,6 +936,9 @@ export const UserOrderByWithAggregationInputSchema: z.ZodType SortOrderSchema).optional(), email: z.lazy(() => SortOrderSchema).optional(), name: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + entitlement: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + entitlementExpiresAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + entitlementProductIdentifier: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), _count: z.lazy(() => UserCountOrderByAggregateInputSchema).optional(), _max: z.lazy(() => UserMaxOrderByAggregateInputSchema).optional(), _min: z.lazy(() => UserMinOrderByAggregateInputSchema).optional() @@ -935,6 +953,9 @@ export const UserScalarWhereWithAggregatesInputSchema: z.ZodType DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), email: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), name: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + entitlement: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.lazy(() => DateTimeNullableWithAggregatesFilterSchema),z.coerce.date() ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), }).strict(); export const UserWalletAccountWhereInputSchema: z.ZodType = z.object({ @@ -1860,6 +1881,9 @@ export const UserCreateInputSchema: z.ZodType = z.object updatedAt: z.coerce.date().optional(), email: z.string(), name: z.string().optional().nullable(), + entitlement: z.string().optional().nullable(), + entitlementExpiresAt: z.coerce.date().optional().nullable(), + entitlementProductIdentifier: z.string().optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -1875,6 +1899,9 @@ export const UserUncheckedCreateInputSchema: z.ZodType UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -1890,6 +1917,9 @@ export const UserUpdateInputSchema: z.ZodType = z.object updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -1905,6 +1935,9 @@ export const UserUncheckedUpdateInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -1919,7 +1952,10 @@ export const UserCreateManyInputSchema: z.ZodType = createdAt: z.coerce.date().optional(), updatedAt: z.coerce.date().optional(), email: z.string(), - name: z.string().optional().nullable() + name: z.string().optional().nullable(), + entitlement: z.string().optional().nullable(), + entitlementExpiresAt: z.coerce.date().optional().nullable(), + entitlementProductIdentifier: z.string().optional().nullable() }).strict(); export const UserUpdateManyMutationInputSchema: z.ZodType = z.object({ @@ -1928,6 +1964,9 @@ export const UserUpdateManyMutationInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); export const UserUncheckedUpdateManyInputSchema: z.ZodType = z.object({ @@ -1936,6 +1975,9 @@ export const UserUncheckedUpdateManyInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); export const UserWalletAccountCreateInputSchema: z.ZodType = z.object({ @@ -2860,6 +2902,17 @@ export const StringNullableFilterSchema: z.ZodType not: z.union([ z.string(),z.lazy(() => NestedStringNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const DateTimeNullableFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const UserWalletAccountListRelationFilterSchema: z.ZodType = z.object({ every: z.lazy(() => UserWalletAccountWhereInputSchema).optional(), some: z.lazy(() => UserWalletAccountWhereInputSchema).optional(), @@ -2935,7 +2988,10 @@ export const UserCountOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), updatedAt: z.lazy(() => SortOrderSchema).optional(), email: z.lazy(() => SortOrderSchema).optional(), - name: z.lazy(() => SortOrderSchema).optional() + name: z.lazy(() => SortOrderSchema).optional(), + entitlement: z.lazy(() => SortOrderSchema).optional(), + entitlementExpiresAt: z.lazy(() => SortOrderSchema).optional(), + entitlementProductIdentifier: z.lazy(() => SortOrderSchema).optional() }).strict(); export const UserMaxOrderByAggregateInputSchema: z.ZodType = z.object({ @@ -2943,7 +2999,10 @@ export const UserMaxOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), updatedAt: z.lazy(() => SortOrderSchema).optional(), email: z.lazy(() => SortOrderSchema).optional(), - name: z.lazy(() => SortOrderSchema).optional() + name: z.lazy(() => SortOrderSchema).optional(), + entitlement: z.lazy(() => SortOrderSchema).optional(), + entitlementExpiresAt: z.lazy(() => SortOrderSchema).optional(), + entitlementProductIdentifier: z.lazy(() => SortOrderSchema).optional() }).strict(); export const UserMinOrderByAggregateInputSchema: z.ZodType = z.object({ @@ -2951,7 +3010,10 @@ export const UserMinOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), updatedAt: z.lazy(() => SortOrderSchema).optional(), email: z.lazy(() => SortOrderSchema).optional(), - name: z.lazy(() => SortOrderSchema).optional() + name: z.lazy(() => SortOrderSchema).optional(), + entitlement: z.lazy(() => SortOrderSchema).optional(), + entitlementExpiresAt: z.lazy(() => SortOrderSchema).optional(), + entitlementProductIdentifier: z.lazy(() => SortOrderSchema).optional() }).strict(); export const StringWithAggregatesFilterSchema: z.ZodType = z.object({ @@ -3004,6 +3066,20 @@ export const StringNullableWithAggregatesFilterSchema: z.ZodType NestedStringNullableFilterSchema).optional() }).strict(); +export const DateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), + _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() +}).strict(); + export const UserRelationFilterSchema: z.ZodType = z.object({ is: z.lazy(() => UserWhereInputSchema).optional(), isNot: z.lazy(() => UserWhereInputSchema).optional() @@ -3120,17 +3196,6 @@ export const DecimalFilterSchema: z.ZodType = z.object({ not: z.union([ z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }),z.lazy(() => NestedDecimalFilterSchema) ]).optional(), }).strict(); -export const DateTimeNullableFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const BudgetRelationFilterSchema: z.ZodType = z.object({ is: z.lazy(() => BudgetWhereInputSchema).optional(), isNot: z.lazy(() => BudgetWhereInputSchema).optional() @@ -3203,20 +3268,6 @@ export const DecimalWithAggregatesFilterSchema: z.ZodType NestedDecimalFilterSchema).optional() }).strict(); -export const DateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), - _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() -}).strict(); - export const EnumBudgetUserPermissionFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => BudgetUserPermissionSchema).optional(), in: z.lazy(() => BudgetUserPermissionSchema).array().optional(), @@ -3725,6 +3776,10 @@ export const NullableStringFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.coerce.date().optional().nullable() +}).strict(); + export const UserWalletAccountUpdateManyWithoutUserNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserWalletAccountCreateWithoutUserInputSchema),z.lazy(() => UserWalletAccountCreateWithoutUserInputSchema).array(),z.lazy(() => UserWalletAccountUncheckedCreateWithoutUserInputSchema),z.lazy(() => UserWalletAccountUncheckedCreateWithoutUserInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => UserWalletAccountCreateOrConnectWithoutUserInputSchema),z.lazy(() => UserWalletAccountCreateOrConnectWithoutUserInputSchema).array() ]).optional(), @@ -4159,10 +4214,6 @@ export const DecimalFieldUpdateOperationsInputSchema: z.ZodType isValidDecimalInput(v), { message: 'Must be a Decimal' }).optional() }).strict(); -export const NullableDateTimeFieldUpdateOperationsInputSchema: z.ZodType = z.object({ - set: z.coerce.date().optional().nullable() -}).strict(); - export const BudgetUpdateOneRequiredWithoutPeriodConfigsNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => BudgetCreateWithoutPeriodConfigsInputSchema),z.lazy(() => BudgetUncheckedCreateWithoutPeriodConfigsInputSchema) ]).optional(), connectOrCreate: z.lazy(() => BudgetCreateOrConnectWithoutPeriodConfigsInputSchema).optional(), @@ -4598,6 +4649,17 @@ export const NestedStringNullableFilterSchema: z.ZodType NestedStringNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const NestedDateTimeNullableFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const NestedStringWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.string().optional(), in: z.string().array().optional(), @@ -4668,6 +4730,20 @@ export const NestedIntNullableFilterSchema: z.ZodType NestedIntNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const NestedDateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), + _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() +}).strict(); + export const NestedEnumBudgetTypeFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => BudgetTypeSchema).optional(), in: z.lazy(() => BudgetTypeSchema).array().optional(), @@ -4703,17 +4779,6 @@ export const NestedDecimalFilterSchema: z.ZodType = not: z.union([ z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }),z.lazy(() => NestedDecimalFilterSchema) ]).optional(), }).strict(); -export const NestedDateTimeNullableFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const NestedEnumBudgetPeriodTypeWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => BudgetPeriodTypeSchema).optional(), in: z.lazy(() => BudgetPeriodTypeSchema).array().optional(), @@ -4740,20 +4805,6 @@ export const NestedDecimalWithAggregatesFilterSchema: z.ZodType NestedDecimalFilterSchema).optional() }).strict(); -export const NestedDateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), - _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() -}).strict(); - export const NestedEnumBudgetUserPermissionFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => BudgetUserPermissionSchema).optional(), in: z.lazy(() => BudgetUserPermissionSchema).array().optional(), @@ -5257,6 +5308,9 @@ export const UserCreateWithoutWalletAccountsInputSchema: z.ZodType BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -5271,6 +5325,9 @@ export const UserUncheckedCreateWithoutWalletAccountsInputSchema: z.ZodType BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -5341,6 +5398,9 @@ export const UserUpdateWithoutWalletAccountsInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -5355,6 +5415,9 @@ export const UserUncheckedUpdateWithoutWalletAccountsInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -5661,6 +5724,9 @@ export const UserCreateWithoutBudgetUsersInputSchema: z.ZodType UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -5675,6 +5741,9 @@ export const UserUncheckedCreateWithoutBudgetUsersInputSchema: z.ZodType UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -5736,6 +5805,9 @@ export const UserUpdateWithoutBudgetUsersInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -5750,6 +5822,9 @@ export const UserUncheckedUpdateWithoutBudgetUsersInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -5801,6 +5876,9 @@ export const UserCreateWithoutCreatedBudgetUserInvitationsInputSchema: z.ZodType updatedAt: z.coerce.date().optional(), email: z.string(), name: z.string().optional().nullable(), + entitlement: z.string().optional().nullable(), + entitlementExpiresAt: z.coerce.date().optional().nullable(), + entitlementProductIdentifier: z.string().optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -5815,6 +5893,9 @@ export const UserUncheckedCreateWithoutCreatedBudgetUserInvitationsInputSchema: updatedAt: z.coerce.date().optional(), email: z.string(), name: z.string().optional().nullable(), + entitlement: z.string().optional().nullable(), + entitlementExpiresAt: z.coerce.date().optional().nullable(), + entitlementProductIdentifier: z.string().optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -5904,6 +5985,9 @@ export const UserUpdateWithoutCreatedBudgetUserInvitationsInputSchema: z.ZodType updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -5918,6 +6002,9 @@ export const UserUncheckedUpdateWithoutCreatedBudgetUserInvitationsInputSchema: updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6027,6 +6114,9 @@ export const UserCreateWithoutCreatedFromInvitationInputSchema: z.ZodType UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6041,6 +6131,9 @@ export const UserUncheckedCreateWithoutCreatedFromInvitationInputSchema: z.ZodTy updatedAt: z.coerce.date().optional(), email: z.string(), name: z.string().optional().nullable(), + entitlement: z.string().optional().nullable(), + entitlementExpiresAt: z.coerce.date().optional().nullable(), + entitlementProductIdentifier: z.string().optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6106,6 +6199,9 @@ export const UserUpdateWithoutCreatedFromInvitationInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6120,6 +6216,9 @@ export const UserUncheckedUpdateWithoutCreatedFromInvitationInputSchema: z.ZodTy updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6227,6 +6326,9 @@ export const UserCreateWithoutTransactionsInputSchema: z.ZodType UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6241,6 +6343,9 @@ export const UserUncheckedCreateWithoutTransactionsInputSchema: z.ZodType UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6416,6 +6521,9 @@ export const UserUpdateWithoutTransactionsInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6430,6 +6538,9 @@ export const UserUncheckedUpdateWithoutTransactionsInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), createdBudgetUserInvitations: z.lazy(() => BudgetUserInvitationUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6460,6 +6571,9 @@ export const UserCreateWithoutCategoriesInputSchema: z.ZodType UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6474,6 +6588,9 @@ export const UserUncheckedCreateWithoutCategoriesInputSchema: z.ZodType UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6615,6 +6732,9 @@ export const UserUpdateWithoutCategoriesInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6629,6 +6749,9 @@ export const UserUncheckedUpdateWithoutCategoriesInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6714,6 +6837,9 @@ export const UserCreateWithoutUploadedBlobObjectsInputSchema: z.ZodType UserWalletAccountCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6728,6 +6854,9 @@ export const UserUncheckedCreateWithoutUploadedBlobObjectsInputSchema: z.ZodType updatedAt: z.coerce.date().optional(), email: z.string(), name: z.string().optional().nullable(), + entitlement: z.string().optional().nullable(), + entitlementExpiresAt: z.coerce.date().optional().nullable(), + entitlementProductIdentifier: z.string().optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedCreateNestedManyWithoutUserInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedCreateNestedManyWithoutCreatedByUserInputSchema).optional(), @@ -6793,6 +6922,9 @@ export const UserUpdateWithoutUploadedBlobObjectsInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUpdateManyWithoutCreatedByUserNestedInputSchema).optional(), @@ -6807,6 +6939,9 @@ export const UserUncheckedUpdateWithoutUploadedBlobObjectsInputSchema: z.ZodType updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), name: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlement: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementExpiresAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + entitlementProductIdentifier: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), walletAccounts: z.lazy(() => UserWalletAccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), budgetUsers: z.lazy(() => BudgetUserUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), transactions: z.lazy(() => TransactionUncheckedUpdateManyWithoutCreatedByUserNestedInputSchema).optional(),