Skip to content

Commit

Permalink
Merge pull request #447 from betagouv/warming-brevo-ip-stage-2
Browse files Browse the repository at this point in the history
Warming brevo ip stage 2
  • Loading branch information
rdubigny authored Feb 7, 2024
2 parents 8baa7a1 + 9ae75b5 commit 5a5db02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/connectors/brevo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ type RemoteDeprecatedTemplateSlug =
| "join-organization"
| "verify-email"
| "reset-password"
| "magic-link"
| "magic-link";
type RemoteTemplateSlug =
| "official-contact-email-verification"
| "choose-sponsor";
type RemoteTemplateSlug = "official-contact-email-verification";
type LocalTemplateSlug =
| "organization-welcome"
| "unable-to-auto-join-organization"
Expand All @@ -31,15 +32,14 @@ const remoteTemplateSlugToBrevoDeprecatedTemplateId: {
"verify-email": 6,
"reset-password": 7,
"magic-link": 29,
"choose-sponsor": 56,
};
const defaultBrevoDeprecatedTemplateId = 21;
const remoteTemplateSlugToBrevoTemplateId: {
[k in RemoteTemplateSlug]: number;
} = {
"official-contact-email-verification": 3,
"choose-sponsor": 2,
// TODO: progressively uncomment these lines
// "choose-sponsor": 2,
// "reset-password": 5,
// "magic-link": 1,
// "join-organization": 4,
Expand Down
17 changes: 17 additions & 0 deletions test/organization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ describe("isCommune", () => {
});
});

const track_dechet_public_org_info: Organization = {
siret: "25680169700010",
cached_tranche_effectifs: "NN",
cached_tranche_effectifs_unite_legale: "NN",
cached_libelle_tranche_effectif:
"Unité non employeuse (pas de salarié au cours de l'année de référence et pas d'effectif au 31/12)",
cached_activite_principale: "38.21Z",
cached_libelle_activite_principale:
"38.21Z - Traitement et élimination des déchets non dangereux",
cached_categorie_juridique: "7354",
cached_libelle_categorie_juridique: "Syndicat mixte fermé",
};

describe("isServicePublic", () => {
it("should return false for bad call", () => {
assert.equal(isServicePublic({}), false);
Expand Down Expand Up @@ -139,6 +152,10 @@ describe("isServicePublic", () => {
it("should return true for whitelisted établissement", () => {
assert.equal(isServicePublic(whitelisted_org_info), true);
});

it("should return true for public etablissement", () => {
assert.equal(isServicePublic(track_dechet_public_org_info), true);
});
});

describe("isEtablissementScolaireDuPremierEtSecondDegre", () => {
Expand Down

0 comments on commit 5a5db02

Please sign in to comment.