Skip to content

Commit

Permalink
⏪️ Revert system()
Browse files Browse the repository at this point in the history
  • Loading branch information
benjlevesque committed Jan 31, 2025
1 parent 0f00f37 commit 5fc2f27
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class Migrer extends Command {
suppriméLe: DateTime.convertirEnValueType(
new Date(modification.abandonedOn),
).formatter(),
suppriméPar: Email.system.formatter(),
suppriméPar: Email.system().formatter(),
},
});
console.log(`🚮 Demande automatiquement supprimée pour ${identifiantProjet}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class ModifierRéférence extends Command {
nouvelleRéférenceDossierRaccordementValue: row['referenceDossier corrigé GRD'],
rôleValue: 'admin',
modifiéeLeValue: DateTime.now().formatter(),
modifiéeParValue: Email.system.formatter(),
modifiéeParValue: Email.system().formatter(),
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/domain/common/src/valueTypes/email.valueType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const convertirEnValueType = (value: string): ValueType => {

const regexEmail = /^[a-z0-9.+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*$/;

export const system = convertirEnValueType('system@system');
export const system = () => convertirEnValueType('system@system');

function estValide(value: string): asserts value is RawType {
const isValid = regexEmail.test(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const abandonAccordéSaga = async ({ payload }: AbandonAccordéEvent) =>
type: 'Lauréat.ReprésentantLégal.Command.SupprimerChangementReprésentantLégal',
data: {
identifiantProjet,
identifiantUtilisateur: Email.system,
identifiantUtilisateur: Email.system(),
dateSuppression: DateTime.now(),
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const lauréatNotifiéSaga = async ({
data: {
identifiantProjet: IdentifiantProjet.convertirEnValueType(identifiantProjet),
importéLe: DateTime.convertirEnValueType(notifiéLe),
importéPar: Email.system,
importéPar: Email.system(),
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const tâchePlanifiéeGestionAutomatiqueDemandeChangementExecutéeSaga =
type: 'Lauréat.ReprésentantLégal.UseCase.AccorderChangementReprésentantLégal',
data: {
identifiantProjetValue: identifiantProjet.formatter(),
identifiantUtilisateurValue: Email.system.formatter(),
identifiantUtilisateurValue: Email.system().formatter(),
dateAccordValue: DateTime.now().formatter(),
accordAutomatiqueValue: true,
},
Expand All @@ -67,7 +67,7 @@ export const tâchePlanifiéeGestionAutomatiqueDemandeChangementExecutéeSaga =
type: 'Lauréat.ReprésentantLégal.UseCase.RejeterChangementReprésentantLégal',
data: {
identifiantProjetValue: identifiantProjet.formatter(),
identifiantUtilisateurValue: Email.system.formatter(),
identifiantUtilisateurValue: Email.system().formatter(),
motifRejetValue: 'Rejet automatique',
dateRejetValue: DateTime.now().formatter(),
rejetAutomatiqueValue: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ async function instruireAutomatiquementChangement(
if (instruction === 'accord') {
this.lauréatWorld.représentantLégalWorld.changementReprésentantLégalWorld.accorderChangementReprésentantLégalFixture.créer(
{
accordéePar: Email.system.formatter(),
accordéePar: Email.system().formatter(),
nomReprésentantLégal:
this.lauréatWorld.représentantLégalWorld.changementReprésentantLégalWorld
.demanderChangementReprésentantLégalFixture.nomReprésentantLégal,
Expand All @@ -286,7 +286,7 @@ async function instruireAutomatiquementChangement(
this.lauréatWorld.représentantLégalWorld.changementReprésentantLégalWorld.rejeterChangementReprésentantLégalFixture.créer(
{
motif: 'Rejet automatique',
rejetéPar: Email.system.formatter(),
rejetéPar: Email.system().formatter(),
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Quand(
data: {
identifiantProjet: IdentifiantProjet.convertirEnValueType(identifiantProjet),
importéLe: DateTime.convertirEnValueType(importéLe),
importéPar: Email.system,
importéPar: Email.system(),
},
});
} catch (error) {
Expand Down

0 comments on commit 5fc2f27

Please sign in to comment.