From beaf74711986b2dfdd497c471063dad52036c2a6 Mon Sep 17 00:00:00 2001 From: Sergio Martin Sanchez Date: Wed, 14 May 2025 20:35:08 +0200 Subject: [PATCH 1/2] feat: more info reminder config --- src/schemas/common.ts | 6 +++--- src/types/reminder.ts | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/schemas/common.ts b/src/schemas/common.ts index ee49acf..cb9c70d 100644 --- a/src/schemas/common.ts +++ b/src/schemas/common.ts @@ -5,6 +5,6 @@ export const userIdSchema = unsafeUuidSchema.brand('UserId').or(unsafeUuidSchema export const uuidSchema = unsafeUuidSchema.brand('Uuid'); export const unixTimestampSchema = z.number().brand('UnixTimestamp'); export const emailSchema = z.string().email().brand('Email'); -export const idpIdSchema = z.string().brand('IdpId'); -export const dateTimeSchema = z.string().datetime().brand('DateTime'); -export const timeZoneSchema = z.string().brand('TimeZone'); +export const idpIdSchema = z.string().max(128).brand('IdpId'); +export const dateTimeSchema = z.string().max(128).datetime().brand('DateTime'); +export const timeZoneSchema = z.string().max(128).brand('TimeZone'); diff --git a/src/types/reminder.ts b/src/types/reminder.ts index 2b8e5a8..40e4513 100644 --- a/src/types/reminder.ts +++ b/src/types/reminder.ts @@ -1,3 +1,4 @@ +import { dateTimeSchema, languageCodeSchema, timeZoneSchema } from '@schemas'; import { calendarSchema } from '@schemas/calendar'; import { senderSchema } from '@schemas/contact'; import type { demoReminderPayloadSchema } from '@schemas/reminder'; @@ -96,7 +97,20 @@ export const reminderConfigSchema = z.object({ business: z.object({ name: z.string().min(1).brand('BusinessName'), address: z.string().min(1).brand('BusinessAddress'), - senderContact: senderSchema + senderContact: senderSchema, + language: languageCodeSchema, + timezone: timeZoneSchema, + companyIndustry: z.object({ + category: z.string().max(256), + subcategory: z.string().max(256), + customIndustry: z.string().max(256).optional() + }), + companySize: z.string().max(128) + }), + confirmation: z.object({ + termsAccepted: dateTimeSchema, + privacyAccepted: dateTimeSchema, + marketingOptInAccepted: dateTimeSchema.optional() }) }); From 473d8d9842735fc7bf0e502dc1552953e9bd8521 Mon Sep 17 00:00:00 2001 From: Sergio Martin Sanchez Date: Thu, 15 May 2025 14:17:47 +0200 Subject: [PATCH 2/2] remove timezone from reminder config schema --- src/types/reminder.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/types/reminder.ts b/src/types/reminder.ts index 40e4513..662db67 100644 --- a/src/types/reminder.ts +++ b/src/types/reminder.ts @@ -1,4 +1,4 @@ -import { dateTimeSchema, languageCodeSchema, timeZoneSchema } from '@schemas'; +import { dateTimeSchema, languageCodeSchema } from '@schemas'; import { calendarSchema } from '@schemas/calendar'; import { senderSchema } from '@schemas/contact'; import type { demoReminderPayloadSchema } from '@schemas/reminder'; @@ -99,7 +99,6 @@ export const reminderConfigSchema = z.object({ address: z.string().min(1).brand('BusinessAddress'), senderContact: senderSchema, language: languageCodeSchema, - timezone: timeZoneSchema, companyIndustry: z.object({ category: z.string().max(256), subcategory: z.string().max(256),