Updated reports.

This commit is contained in:
Mike Cao 2025-06-08 22:21:28 -07:00
parent 28e872f219
commit 01bd21c5b4
75 changed files with 1373 additions and 980 deletions

View file

@ -119,6 +119,26 @@ export const journeyReportSchema = z.object({
}),
});
export const retentionReportSchema = z.object({
type: z.literal('retention'),
});
export const utmReportSchema = z.object({
type: z.literal('utm'),
});
export const revenueReportSchema = z.object({
type: z.literal('revenue'),
});
export const attributionReportSchema = z.object({
type: z.literal('attribution'),
});
export const insightsReportSchema = z.object({
type: z.literal('insights'),
});
export const reportBaseSchema = z.object({
websiteId: z.string().uuid(),
type: reportTypeParam,
@ -130,6 +150,11 @@ export const reportTypeSchema = z.discriminatedUnion('type', [
goalReportSchema,
funnelReportSchema,
journeyReportSchema,
retentionReportSchema,
utmReportSchema,
revenueReportSchema,
attributionReportSchema,
insightsReportSchema,
]);
export const reportSchema = z.intersection(reportBaseSchema, reportTypeSchema);