feat: add file storage service and update configurations
refactor: migrate to tsup for builds and update tsconfigs fix: update error handling and validation in payment service chore: update package scripts and dependencies docs: update README and env examples
This commit is contained in:
@@ -87,6 +87,10 @@ export const PlanScalarFieldEnumSchema = z.enum(['id','code','name','description
|
||||
|
||||
export const SubscriptionScalarFieldEnumSchema = z.enum(['id','telegramUserId','planId','startedAt','expiresAt','canceledAt','createdAt','updatedAt']);
|
||||
|
||||
export const FileScalarFieldEnumSchema = z.enum(['id','filename','originalName','mimeType','size','path','createdAt','updatedAt']);
|
||||
|
||||
export const FileLinkScalarFieldEnumSchema = z.enum(['id','fileId','relationId','createdAt','updatedAt']);
|
||||
|
||||
export const SortOrderSchema = z.enum(['asc','desc']);
|
||||
|
||||
export const JsonNullValueInputSchema = z.enum(['JsonNull',]).transform((value) => (value === 'JsonNull' ? Prisma.JsonNull : value));
|
||||
@@ -190,3 +194,34 @@ export const SubscriptionSchema = z.object({
|
||||
})
|
||||
|
||||
export type Subscription = z.infer<typeof SubscriptionSchema>
|
||||
|
||||
/////////////////////////////////////////
|
||||
// FILE SCHEMA
|
||||
/////////////////////////////////////////
|
||||
|
||||
export const FileSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
filename: z.string(),
|
||||
originalName: z.string(),
|
||||
mimeType: z.string(),
|
||||
size: z.number().int(),
|
||||
path: z.string(),
|
||||
createdAt: z.coerce.date(),
|
||||
updatedAt: z.coerce.date(),
|
||||
})
|
||||
|
||||
export type File = z.infer<typeof FileSchema>
|
||||
|
||||
/////////////////////////////////////////
|
||||
// FILE LINK SCHEMA
|
||||
/////////////////////////////////////////
|
||||
|
||||
export const FileLinkSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
fileId: z.string(),
|
||||
relationId: z.string(),
|
||||
createdAt: z.coerce.date(),
|
||||
updatedAt: z.coerce.date(),
|
||||
})
|
||||
|
||||
export type FileLink = z.infer<typeof FileLinkSchema>
|
||||
|
||||
Reference in New Issue
Block a user