From df5a11a2a3477e099cd4baab76316a67e9c630ec Mon Sep 17 00:00:00 2001 From: Felipe Cardoso Date: Sat, 15 Mar 2025 20:35:39 +0100 Subject: [PATCH] Make `invitation_code` optional and nullable in Guest schemas Updated GuestCreate and GuestRead schemas to adjust the `invitation_code` field. It is now optional and can be null for GuestCreate, while required for GuestRead. This change ensures better flexibility in handling guest data. --- frontend/src/client/schemas.gen.ts | 16 ++++++++++++++-- frontend/src/client/types.gen.ts | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/src/client/schemas.gen.ts b/frontend/src/client/schemas.gen.ts index fc9c6e4..3b339cc 100644 --- a/frontend/src/client/schemas.gen.ts +++ b/frontend/src/client/schemas.gen.ts @@ -1182,12 +1182,19 @@ export const GuestCreateSchema = { default: false, }, invitation_code: { - type: "string", + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], title: "Invitation Code", }, }, type: "object", - required: ["event_id", "invited_by", "full_name", "invitation_code"], + required: ["event_id", "invited_by", "full_name"], title: "GuestCreate", } as const; @@ -1339,6 +1346,10 @@ export const GuestReadSchema = { type: "boolean", title: "Is Blocked", }, + invitation_code: { + type: "string", + title: "Invitation Code", + }, }, type: "object", required: [ @@ -1349,6 +1360,7 @@ export const GuestReadSchema = { "status", "actual_additional_guests", "is_blocked", + "invitation_code", ], title: "GuestRead", } as const; diff --git a/frontend/src/client/types.gen.ts b/frontend/src/client/types.gen.ts index 1b37e0a..75ca693 100644 --- a/frontend/src/client/types.gen.ts +++ b/frontend/src/client/types.gen.ts @@ -181,7 +181,7 @@ export type GuestCreate = { [key: string]: unknown; } | null; can_bring_guests?: boolean | null; - invitation_code: string; + invitation_code?: string | null; }; export type GuestRead = { @@ -204,6 +204,7 @@ export type GuestRead = { response_date?: string | null; actual_additional_guests: number; is_blocked: boolean; + invitation_code: string; }; export type GuestStatus =