@giftup/zod 10.0.33 → 10.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/endpoints/awards.ts +32 -0
- package/endpoints/profile.ts +1 -0
- package/endpoints/schema.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { CaseSchema } from '../models'
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* id String @id @default(cuid())
|
|
6
|
+
|
|
7
|
+
user User @relation(fields: [userId], references: [chatId], onDelete: Cascade)
|
|
8
|
+
userId BigInt @map("user_id") // <- БОЛЬШЕ НЕ UNIQUE
|
|
9
|
+
|
|
10
|
+
level Int @default(0) @map("level")
|
|
11
|
+
ton Float? @map("ton")
|
|
12
|
+
|
|
13
|
+
caseId String? @map("case_id")
|
|
14
|
+
case Case? @relation(fields: [caseId], references: [id], onDelete: Cascade)
|
|
15
|
+
|
|
16
|
+
isActivated Boolean @default(false) @map("is_activated")
|
|
17
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
18
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
19
|
+
|
|
20
|
+
* */
|
|
21
|
+
|
|
22
|
+
const AwardsResponseSchema = z.array(
|
|
23
|
+
z.object({
|
|
24
|
+
id: z.string(),
|
|
25
|
+
level: z.string(),
|
|
26
|
+
case: CaseSchema,
|
|
27
|
+
ton: z.number().optional(),
|
|
28
|
+
isActivated: z.boolean(),
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export type AwardsResponse = z.infer<typeof AwardsResponseSchema>
|
package/endpoints/profile.ts
CHANGED
package/endpoints/schema.ts
CHANGED