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.
This commit is contained in:
@@ -1182,12 +1182,19 @@ export const GuestCreateSchema = {
|
|||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
invitation_code: {
|
invitation_code: {
|
||||||
type: "string",
|
anyOf: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "null",
|
||||||
|
},
|
||||||
|
],
|
||||||
title: "Invitation Code",
|
title: "Invitation Code",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "object",
|
type: "object",
|
||||||
required: ["event_id", "invited_by", "full_name", "invitation_code"],
|
required: ["event_id", "invited_by", "full_name"],
|
||||||
title: "GuestCreate",
|
title: "GuestCreate",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
@@ -1339,6 +1346,10 @@ export const GuestReadSchema = {
|
|||||||
type: "boolean",
|
type: "boolean",
|
||||||
title: "Is Blocked",
|
title: "Is Blocked",
|
||||||
},
|
},
|
||||||
|
invitation_code: {
|
||||||
|
type: "string",
|
||||||
|
title: "Invitation Code",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
type: "object",
|
type: "object",
|
||||||
required: [
|
required: [
|
||||||
@@ -1349,6 +1360,7 @@ export const GuestReadSchema = {
|
|||||||
"status",
|
"status",
|
||||||
"actual_additional_guests",
|
"actual_additional_guests",
|
||||||
"is_blocked",
|
"is_blocked",
|
||||||
|
"invitation_code",
|
||||||
],
|
],
|
||||||
title: "GuestRead",
|
title: "GuestRead",
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export type GuestCreate = {
|
|||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
} | null;
|
} | null;
|
||||||
can_bring_guests?: boolean | null;
|
can_bring_guests?: boolean | null;
|
||||||
invitation_code: string;
|
invitation_code?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GuestRead = {
|
export type GuestRead = {
|
||||||
@@ -204,6 +204,7 @@ export type GuestRead = {
|
|||||||
response_date?: string | null;
|
response_date?: string | null;
|
||||||
actual_additional_guests: number;
|
actual_additional_guests: number;
|
||||||
is_blocked: boolean;
|
is_blocked: boolean;
|
||||||
|
invitation_code: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GuestStatus =
|
export type GuestStatus =
|
||||||
|
|||||||
Reference in New Issue
Block a user