⚡ (analytics) Improve analytics graph accuracy
This commit is contained in:
9
packages/schemas/features/analytics.ts
Normal file
9
packages/schemas/features/analytics.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const totalAnswersInBlock = z.object({
|
||||
blockId: z.string(),
|
||||
itemId: z.string().optional(),
|
||||
total: z.number(),
|
||||
})
|
||||
|
||||
export type TotalAnswersInBlock = z.infer<typeof totalAnswersInBlock>
|
||||
@@ -5,6 +5,7 @@ export const answerSchema = z.object({
|
||||
createdAt: z.date(),
|
||||
resultId: z.string(),
|
||||
blockId: z.string(),
|
||||
itemId: z.string().nullable(),
|
||||
groupId: z.string(),
|
||||
variableId: z.string().nullable(),
|
||||
content: z.string(),
|
||||
@@ -22,6 +23,7 @@ export const answerInputSchema = answerSchema
|
||||
z.object({
|
||||
variableId: z.string().nullish(),
|
||||
storageUsed: z.number().nullish(),
|
||||
itemId: z.string().nullish(),
|
||||
})
|
||||
) satisfies z.ZodType<Prisma.AnswerUncheckedUpdateInput>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user