Skip to content

Commit

Permalink
Merge branch 'master' into rdumazert/feat-moderation-agent-outside-mi…
Browse files Browse the repository at this point in the history
…n-finance-chorus-pro
  • Loading branch information
rebeccadumazert authored Jan 20, 2025
2 parents b92784c + 6449c3f commit 8ac53d0
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Bun Snapshot v1, https://goo.gl/fbAQLP

exports[`returns seconded agent diplomatie.gouv - Ministry of the Interior 1`] = `
"Bonjour,
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro).
Vous semblez être un Agent ayant été détaché dans une administration française à l'étranger.
Si tel est le cas, nous vous invitons à créer à nouveau votre compte utilisateur, en le rattachant à l'organisation dans laquelle vous avez été détaché.
Ex : vous avez été détaché dans l'Ambassade de France en IRAK, veuillez rattacher votre compte à celle-ci.
Vous trouverez le SIRET de l'administration dans laquelle vous avez été détaché, sur l’Annuaire des Entreprises : https://annuaire-entreprises.data.gouv.fr/.
Bien cordialement,
L’équipe ProConnect.
"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Bun Snapshot v1, https://goo.gl/fbAQLP

exports[`returns student - host organisation (work placement, sandwich course, etc.) 1`] = `
"Bonjour,
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro).
Nous ne pouvons donner suite à votre demande, car les étudiants ne sont pas autorisés à utiliser ProConnect en se rattachant à leur organisation d'accueil.
Veuillez accéder au service souhaité sans passer par ProConnect.
Bien cordialement,
L’équipe ProConnect.
"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Bun Snapshot v1, https://goo.gl/fbAQLP

exports[`returns Student School or training establishment response 1`] = `
"Bonjour,
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro).
Nous sommes contraints de refuser votre demande de création de compte ProConnect.
Pour information, les étudiants ne sont pas autorisés à se rattacher à leur établissement scolaire ou de formation sur ProConnect, car cela leur donnerait des droits d'accès à des services et démarches réservés uniquement aux Agents (ou employés) de l'établissement.
Veuillez accéder au service souhaité en vous créant un compte, sans passer par ProConnect.
Bien cordialement,
L’équipe ProConnect.
"
`;
6 changes: 6 additions & 0 deletions packages/~/moderations/ui/src/Actions/responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import * as occupation_incorrectly_entered from "./occupation_incorrectly_entere
import * as occupation_incorrectly_entered_not_blocking from "./occupation_incorrectly_entered_not_blocking";
import * as public_or_private_organization from "./public_or_private_organization";
import * as refusal_france_travail from "./refusal_france_travail";
import * as student_school_training_establishment from "./student_school_training_establishment";
import * as student_host_organisation from "./student_host_organisation";
import * as seconded_agent_min_interior from "./seconded_agent_min_interior";
import * as teacher_academic_email from "./teacher_academic_email";
import * as university_email_cnrs from "./university_email_cnrs";
import * as use_official_email from "./use_official_email";
Expand Down Expand Up @@ -76,4 +79,7 @@ export const reponse_templates = [
association_with_staff_but_no_domain_name,
association_ordinary_person,
agent_outside_min_finance_chorus_pro,
student_school_training_establishment,
student_host_organisation,
seconded_agent_min_interior,
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//

import { render_md } from "@~/app.ui/testing";
import { expect, test } from "bun:test";
import { context, type Values } from "../context";
import seconded_agent_min_interior from "./seconded_agent_min_interior";

//

test("returns seconded agent diplomatie.gouv - Ministry of the Interior", async () => {
expect(
await render_md(
<context.Provider
value={
{
moderation: {
organization: { cached_libelle: "🦄" },
},
} as Values
}
>
<Response />
</context.Provider>,
),
).toMatchSnapshot();
});

function Response() {
return <>{seconded_agent_min_interior()}</>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//

import { useContext } from "hono/jsx";
import { dedent } from "ts-dedent";
import { context } from "../context";

export const label = "Agent détaché diplomatie.gouv —> Min de l’Intérieur";

export default function template() {
const {
moderation: {
organization: { cached_libelle: organization_name },
},
} = useContext(context);

return dedent`
Bonjour,
Nous avons bien reçu votre demande de rattachement à l'organisation « ${organization_name} » sur ProConnect (anciennement : AgentConnect, MonComptePro).
Vous semblez être un Agent ayant été détaché dans une administration française à l'étranger.
Si tel est le cas, nous vous invitons à créer à nouveau votre compte utilisateur, en le rattachant à l'organisation dans laquelle vous avez été détaché.
Ex : vous avez été détaché dans l'Ambassade de France en IRAK, veuillez rattacher votre compte à celle-ci.
Vous trouverez le SIRET de l'administration dans laquelle vous avez été détaché, sur l’Annuaire des Entreprises : https://annuaire-entreprises.data.gouv.fr/.
Bien cordialement,
L’équipe ProConnect.
`;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//

import { render_md } from "@~/app.ui/testing";
import { expect, test } from "bun:test";
import { context, type Values } from "../context";
import student_host_organisation from "./student_host_organisation";

//

test("returns student - host organisation (work placement, sandwich course, etc.)", async () => {
expect(
await render_md(
<context.Provider
value={
{
moderation: {
organization: { cached_libelle: "🦄" },
},
} as Values
}
>
<Response />
</context.Provider>,
),
).toMatchSnapshot();
});

function Response() {
return <>{student_host_organisation()}</>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//

import { useContext } from "hono/jsx";
import { dedent } from "ts-dedent";
import { context } from "../context";

export const label = "Étudiant - Organisation d’accueil (stage, alternance…)";

export default function template() {
const {
moderation: {
organization: { cached_libelle: organization_name },
},
} = useContext(context);

return dedent`
Bonjour,
Nous avons bien reçu votre demande de rattachement à l'organisation « ${organization_name} » sur ProConnect (anciennement : AgentConnect, MonComptePro).
Nous ne pouvons donner suite à votre demande, car les étudiants ne sont pas autorisés à utiliser ProConnect en se rattachant à leur organisation d'accueil.
Veuillez accéder au service souhaité sans passer par ProConnect.
Bien cordialement,
L’équipe ProConnect.
`;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//

import { render_md } from "@~/app.ui/testing";
import { expect, test } from "bun:test";
import { context, type Values } from "../context";
import student_school_training_establishment from "./student_school_training_establishment";

//

test("returns Student School or training establishment response", async () => {
expect(
await render_md(
<context.Provider
value={
{
moderation: {
organization: { cached_libelle: "🦄" },
},
} as Values
}
>
<Response />
</context.Provider>,
),
).toMatchSnapshot();
});

function Response() {
return <>{student_school_training_establishment()}</>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//

import { useContext } from "hono/jsx";
import { dedent } from "ts-dedent";
import { context } from "../context";

export const label = "Étudiant —> Etablissement scolaire ou de formation";

export default function template() {
const {
moderation: {
organization: { cached_libelle: organization_name },
},
} = useContext(context);

return dedent`
Bonjour,
Nous avons bien reçu votre demande de rattachement à l'organisation « ${organization_name} » sur ProConnect (anciennement : AgentConnect, MonComptePro).
Nous sommes contraints de refuser votre demande de création de compte ProConnect.
Pour information, les étudiants ne sont pas autorisés à se rattacher à leur établissement scolaire ou de formation sur ProConnect, car cela leur donnerait des droits d'accès à des services et démarches réservés uniquement aux Agents (ou employés) de l'établissement.
Veuillez accéder au service souhaité en vous créant un compte, sans passer par ProConnect.
Bien cordialement,
L’équipe ProConnect.
`;
}

0 comments on commit 8ac53d0

Please sign in to comment.