Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Mettre les emails en lowercase à la candidature #2567

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const minimumValues: Partial<Record<keyof CandidatureCsvRowShape, string>> = {
prix_reference: '1',
'Note totale': '1',
'Nom et prénom du représentant légal': 'valentin cognito',
'Adresse électronique du contact': 'porteur@test.com',
'Adresse électronique du contact': 'Porteur@test.com',
'N°, voie, lieu-dit 1': 'adresse ',
CP: '12345',
Commune: 'MARSEILLE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const candidatureCsvRowSchema = z
[colonnes.prixRéférence]: strictlyPositiveNumberSchema,
[colonnes.noteTotale]: numberSchema,
[colonnes.nomReprésentantLégal]: requiredStringSchema,
[colonnes.emailContact]: requiredStringSchema.email(),
[colonnes.emailContact]: requiredStringSchema.email().toLowerCase(),
[colonnes.adresse1]: optionalStringSchema, // see refine below
[colonnes.adresse2]: optionalStringSchema,
[colonnes.codePostaux]: requiredStringSchema
Expand Down Expand Up @@ -279,7 +279,7 @@ export const candidatureSchema = z
prixReference: strictlyPositiveNumberSchema,
noteTotale: numberSchema,
nomRepresentantLegal: requiredStringSchema,
emailContact: requiredStringSchema.email(),
emailContact: requiredStringSchema.email().toLowerCase(),

adresse1: requiredStringSchema,
adresse2: optionalStringSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const mapPayloadForCommand = (payload: ImporterCandidatureUseCaseCommonPa
historiqueAbandon: HistoriqueAbandon.convertirEnValueType(payload.historiqueAbandonValue),
nomProjet: payload.nomProjetValue,
localité: payload.localitéValue,
emailContact: payload.emailContactValue,
emailContact: payload.emailContactValue.trim().toLowerCase(),
evaluationCarboneSimplifiée: payload.evaluationCarboneSimplifiéeValue,
nomCandidat: payload.nomCandidatValue,
nomReprésentantLégal: payload.nomReprésentantLégalValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class CandidatureWorld {
dateÉchéanceGf: expectedValues.dateÉchéanceGfValue
? DateTime.convertirEnValueType(expectedValues.dateÉchéanceGfValue)
: undefined,
emailContact: expectedValues.emailContactValue,
emailContact: expectedValues.emailContactValue.toLowerCase(),
evaluationCarboneSimplifiée: expectedValues.evaluationCarboneSimplifiéeValue,
historiqueAbandon: Candidature.HistoriqueAbandon.convertirEnValueType(
expectedValues.historiqueAbandonValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Alors(
'le porteur a été prévenu que sa candidature a été notifiée',
async function (this: PotentielWorld) {
const email = this.notificationWorld.récupérerNotification(
this.candidatureWorld.importerCandidature.values.emailContactValue,
this.candidatureWorld.importerCandidature.values.emailContactValue.toLowerCase(),
);

await waitForExpect(async () => {
Expand All @@ -64,7 +64,7 @@ Alors(
'le porteur a été prévenu que son attestation a été modifiée',
async function (this: PotentielWorld) {
const email = this.notificationWorld.récupérerNotification(
this.candidatureWorld.importerCandidature.values.emailContactValue,
this.candidatureWorld.importerCandidature.values.emailContactValue.toLowerCase(),
);

await waitForExpect(async () => {
Expand All @@ -82,7 +82,7 @@ Alors(
await sleep(400);
try {
this.notificationWorld.récupérerNotification(
this.candidatureWorld.importerCandidature.values.emailContactValue,
this.candidatureWorld.importerCandidature.values.emailContactValue.toLowerCase(),
);
} catch (error) {
expect((error as Error).message).to.equal('Pas de notification');
Expand Down
Loading