diff --git a/src/lib/gcloud.ts b/src/lib/gcloud.ts index 290545b..6d47c92 100644 --- a/src/lib/gcloud.ts +++ b/src/lib/gcloud.ts @@ -273,6 +273,7 @@ export async function exportParticipants({ if (userParticipation.role === "CONTESTANT") { data = { ...data, + "Fecha de registro": `=DATEVALUE(MID("${participation.registeredAt}",1,10))+TIMEVALUE(MID("${participation.registeredAt}",12,8))`, Estado: userParticipation.schoolState, Escuela: userParticipation.schoolName.trim(), }; diff --git a/src/lib/ofmi.ts b/src/lib/ofmi.ts index 026d7fd..350bc9a 100644 --- a/src/lib/ofmi.ts +++ b/src/lib/ofmi.ts @@ -118,6 +118,7 @@ export async function findParticipants( references: mailingAddress.references ?? undefined, }, }, + registeredAt: participation.createdAt, userParticipation: userParticipation as UserParticipation, }; @@ -201,6 +202,7 @@ export async function findParticipation( references: mailingAddress.references ?? undefined, }, }, + registeredAt: participation.createdAt, userParticipation: userParticipation as UserParticipation, }; diff --git a/src/types/participation.schema.ts b/src/types/participation.schema.ts index 7e25f71..464cc1e 100644 --- a/src/types/participation.schema.ts +++ b/src/types/participation.schema.ts @@ -109,13 +109,17 @@ export type ParticipationRequestInput = Static< export const ParticipationRequestInputSchema = Type.Object({ ofmiEdition: Type.Integer({ minimum: 1 }), user: UserInputSchema, + registeredAt: Type.Date(), userParticipation: UserParticipationSchema, }); export type UpsertParticipationRequest = Static< typeof UpsertParticipationRequestSchema >; -export const UpsertParticipationRequestSchema = ParticipationRequestInputSchema; +export const UpsertParticipationRequestSchema = Type.Omit( + ParticipationRequestInputSchema, + ["registeredAt"], +); export interface UpsertParticipationResponse { participation: Participation;