-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I get that this one has optional fields and the intention is for flexible fields, but I don't think this is the right approach.
Would recommend composition:
InfoSchema = z.model(
"name": ...,
"email": ...,
...
)
SchoolSchema = z.model(
...
)
SubmittedRegistration = z.model(
InfoSchema,
SchoolSchema,
)
DraftRegistration = z.partial(
InfoSchema,
SchoolSchema,
)
adonix/src/services/registration/registration-schemas.ts
Lines 95 to 182 in 8c8a9f3
| export class RegistrationApplicationDraft { | |
| @prop({ required: true, index: true }) | |
| public userId: string; | |
| @prop({ required: false }) | |
| public firstName?: string; | |
| @prop({ required: false }) | |
| public lastName?: string; | |
| @prop({ required: false }) | |
| public preferredName?: string; | |
| @prop({ required: false }) | |
| public age?: string; | |
| @prop({ required: false }) | |
| public email?: string; | |
| @prop({ required: false }) | |
| public phoneNumber?: string; | |
| @prop({ required: false }) | |
| public gender?: string; | |
| @prop({ | |
| required: false, | |
| type: String, | |
| }) | |
| public race?: string[]; | |
| @prop({ required: false }) | |
| public country?: string; | |
| @prop({ required: false }) | |
| public state?: string; | |
| @prop({ required: false }) | |
| public school?: string; | |
| @prop({ required: false }) | |
| public education?: string; | |
| @prop({ required: false }) | |
| public graduate?: string; | |
| @prop({ required: false }) | |
| public major?: string; | |
| @prop({ required: false }) | |
| public underrepresented?: string; | |
| @prop({ required: false }) | |
| public hackathonsParticipated?: string; | |
| @prop({ required: false }) | |
| public application1?: string; | |
| @prop({ required: false }) | |
| public application2?: string; | |
| @prop({ required: false }) | |
| public application3?: string; | |
| @prop({ required: false }) | |
| public applicationOptional?: string; | |
| @prop({ required: false }) | |
| public pro?: boolean; | |
| @prop({ | |
| required: false, | |
| type: String, | |
| }) | |
| public attribution?: string[]; | |
| @prop({ | |
| required: false, | |
| type: String, | |
| }) | |
| public eventInterest?: string[]; | |
| @prop({ required: false }) | |
| requestTravelReimbursement?: boolean; | |
| @prop({ required: false }) | |
| mlhNewsletter?: boolean; | |
| } |
Metadata
Metadata
Assignees
Labels
No labels