Skip to content

Commit

Permalink
[Feature] Fecha de registro de cada participante al exportar a spread…
Browse files Browse the repository at this point in the history
…sheet (#92)

* Added registration date in contestants spreadsheet

* Update ofmi.ts

* Update ofmi.ts

---------

Co-authored-by: Juan Carlos Sigler Priego <[email protected]>
  • Loading branch information
aaron-diaz and Juanito98 authored Oct 19, 2024
1 parent 5722294 commit e491336
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/gcloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};
Expand Down
2 changes: 2 additions & 0 deletions src/lib/ofmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export async function findParticipants(
references: mailingAddress.references ?? undefined,
},
},
registeredAt: participation.createdAt,
userParticipation: userParticipation as UserParticipation,
};

Expand Down Expand Up @@ -201,6 +202,7 @@ export async function findParticipation(
references: mailingAddress.references ?? undefined,
},
},
registeredAt: participation.createdAt,
userParticipation: userParticipation as UserParticipation,
};

Expand Down
6 changes: 5 additions & 1 deletion src/types/participation.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e491336

Please sign in to comment.