Skip to content

Commit

Permalink
update agency kind pole-emploi to france-travail when broadcasting co…
Browse files Browse the repository at this point in the history
…nvention to FT
  • Loading branch information
celineung committed Oct 3, 2024
1 parent 9c71a27 commit 3bb07d5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ describe("convention e2e", () => {
statut: "REJETÉ",
telephone: "+33123456780",
telephoneTuteur: "+33601010101",
typeAgence: peAgency.kind,
typeAgence: "france-travail",
nomAgence: peAgency.name,
prenomValidateurRenseigne:
convention.validators?.agencyValidator?.firstname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ const peConvention: PoleEmploiConvention = {
statut: "DEMANDE_VALIDÉE",
telephone: "0611335577",
telephoneTuteur: "0622446688",
typeAgence: "pole-emploi",
typeAgence: "france-travail",
nomAgence: "Agence de test",
prenomValidateurRenseigne: "prénom du valideur",
nomValidateurRenseigne: "nom du valideur",
Expand Down
4 changes: 3 additions & 1 deletion back/src/domains/convention/ports/PoleEmploiGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type ConventionStatusToPeStatus = typeof conventionStatusToPoleEmploiStatus;
type PeConventionStatus =
ConventionStatusToPeStatus[keyof ConventionStatusToPeStatus];

type AgencyKindForPe = Exclude<AgencyKind, "pole-emploi"> | "france-travail";

export type PoleEmploiConvention = {
id: string; // id numérique sur 11 caractères
originalId: string; // exemple: 31bd445d-54fa-4b53-8875-0ada1673fe3c
Expand Down Expand Up @@ -62,7 +64,7 @@ export type PoleEmploiConvention = {
competencesObservees: string;
signatureBeneficiaire: boolean;
signatureEntreprise: boolean;
typeAgence: AgencyKind;
typeAgence: AgencyKindForPe;
nomAgence: string;
prenomValidateurRenseigne?: string;
nomValidateurRenseigne?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function conventionToConventionNotification(
signatureBeneficiaire: !!convention.signatories.beneficiary.signedAt,
signatureEntreprise:
!!convention.signatories.establishmentRepresentative.signedAt,
typeAgence: agency.kind,
typeAgence: agency.kind === "pole-emploi" ? "france-travail" : agency.kind,
nomAgence: agency.name,
prenomValidateurRenseigne:
convention.validators?.agencyValidator?.firstname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export class BroadcastToPoleEmploiOnConventionUpdates extends TransactionalUseCa
competencesObservees: convention.immersionSkills,
signatureBeneficiaire: !!beneficiary.signedAt,
signatureEntreprise: !!establishmentRepresentative.signedAt,
typeAgence: agency.kind,
typeAgence:
agency.kind === "pole-emploi" ? "france-travail" : agency.kind,
nomAgence: agency.name,
prenomValidateurRenseigne:
convention.validators?.agencyValidator?.firstname,
Expand Down

0 comments on commit 3bb07d5

Please sign in to comment.