Skip to content

Commit dcdcd60

Browse files
committed
chore(api+admin+candidate): deleted certification status column and replaced it by the the status_v2 column (now renamed status)
1 parent b00d796 commit dcdcd60

File tree

26 files changed

+76
-79
lines changed

26 files changed

+76
-79
lines changed

packages/reva-admin-react/cypress/e2e/certifications/certifications-list/fixtures/certifications.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"label": "Bac Pro Accompagnement, soins et services à la personne - à domicile",
88
"codeRncp": "12296",
99
"status": "INACTIVE",
10-
"statusV2": "INACTIVE",
1110
"visible": false,
1211
"certificationAuthorityStructure": {
1312
"label": "Structure certificatrice inconnue"
@@ -18,8 +17,7 @@
1817
"id": "654c9471-6e2e-4ff2-a5d8-2069e78ea0d6",
1918
"label": "Bac Pro Accompagnement, soins et services à la personne - en structure",
2019
"codeRncp": "12301",
21-
"status": "AVAILABLE",
22-
"statusV2": "VALIDE_PAR_CERTIFICATEUR",
20+
"status": "VALIDE_PAR_CERTIFICATEUR",
2321
"visible": true,
2422
"certificationAuthorityStructure": {
2523
"label": "Structure certificatrice inconnue"
@@ -30,8 +28,7 @@
3028
"id": "efa751cb-f5c2-4d90-b390-e5726eeebb19",
3129
"label": "Bac Professionnel Accompagnement, soins et services à la personnes Option A : à domicile",
3230
"codeRncp": "12296",
33-
"status": "AVAILABLE",
34-
"statusV2": "VALIDE_PAR_CERTIFICATEUR",
31+
"status": "VALIDE_PAR_CERTIFICATEUR",
3532
"visible": true,
3633
"certificationAuthorityStructure": {
3734
"label": "Ministère de l'Education Nationale et de la Jeunesse"

packages/reva-admin-react/cypress/e2e/certifications/update-certification-page/fixtures/certification-bp-boucher.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"id": "bf78b4d6-f6ac-4c8f-9e6b-d6c6ae9e891b",
55
"label": "BP Boucher",
66
"codeRncp": "37310",
7-
"status": "AVAILABLE",
8-
"statusV2": "BROUILLON",
7+
"status": "BROUILLON",
98
"rncpExpiresAt": 1788127200000,
109
"rncpDeliveryDeadline": null,
1110
"availableAt": 1688162400000,

packages/reva-admin-react/cypress/e2e/certifications/update-certification-page/update-certification-page.cy.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ function interceptCertification({
55
withStructure,
66
withCertificationAuthoritiesOfCertification,
77
withCertificationRegistryManagerAssociatedToStructure,
8-
statusV2,
8+
status,
99
}: {
1010
withStructure?: boolean;
1111
withCertificationAuthoritiesOfCertification?: boolean;
1212
withCertificationRegistryManagerAssociatedToStructure?: boolean;
13-
statusV2?: string;
13+
status?: string;
1414
} = {}) {
1515
cy.intercept("POST", "/api/graphql", (req) => {
1616
stubQuery(
@@ -28,8 +28,7 @@ function interceptCertification({
2828
data: {
2929
getCertification: {
3030
...certificationBPBoucher.data.getCertification,
31-
statusV2:
32-
statusV2 || certificationBPBoucher.data.getCertification.statusV2,
31+
status: status || certificationBPBoucher.data.getCertification.status,
3332
certificationAuthorities: withCertificationAuthoritiesOfCertification
3433
? [
3534
{
@@ -278,8 +277,8 @@ context("when i access the update certification page ", () => {
278277
);
279278
});
280279

281-
it("let me check if buttons 'envoyer' and 'réinitialiser' are visible is statusV2 equal to 'BROUILLON'", function () {
282-
interceptCertification({ statusV2: "BROUILLON" });
280+
it("let me check if buttons 'envoyer' and 'réinitialiser' are visible is status equal to 'BROUILLON'", function () {
281+
interceptCertification({ status: "BROUILLON" });
283282

284283
cy.admin("/certifications/bf78b4d6-f6ac-4c8f-9e6b-d6c6ae9e891b");
285284
cy.wait("@activeFeaturesForConnectedUser");
@@ -291,8 +290,8 @@ context("when i access the update certification page ", () => {
291290
cy.get('[data-test="button-reset"]').should("exist");
292291
});
293292

294-
it("let me check if buttons 'envoyer' and 'réinitialiser' are no more visible if statusV2 different from 'BROUILLON'", function () {
295-
interceptCertification({ statusV2: "A_VALIDER_PAR_CERTIFICATEUR" });
293+
it("let me check if buttons 'envoyer' and 'réinitialiser' are no more visible if status different from 'BROUILLON'", function () {
294+
interceptCertification({ status: "A_VALIDER_PAR_CERTIFICATEUR" });
296295

297296
cy.admin("/certifications/bf78b4d6-f6ac-4c8f-9e6b-d6c6ae9e891b");
298297
cy.wait("@activeFeaturesForConnectedUser");

packages/reva-admin-react/cypress/e2e/responsable-certifications/certifications/update-certification-page/fixtures/certification-bp-boucher.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"id": "bf78b4d6-f6ac-4c8f-9e6b-d6c6ae9e891b",
55
"label": "BP Boucher",
66
"codeRncp": "37310",
7-
"status": "AVAILABLE",
8-
"statusV2": "BROUILLON",
7+
"status": "BROUILLON",
98
"rncpExpiresAt": 1788127200000,
109
"rncpDeliveryDeadline": null,
1110
"availableAt": 1688162400000,

packages/reva-admin-react/src/app/(admin)/certifications/(list)/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { WhiteCard } from "@/components/card/white-card/WhiteCard";
33
import { useGraphQlClient } from "@/components/graphql/graphql-client/GraphqlClient";
44
import { SearchList } from "@/components/search/search-list/SearchList";
55
import { graphql } from "@/graphql/generated";
6-
import { CertificationStatusV2 } from "@/graphql/generated/graphql";
6+
import { CertificationStatus } from "@/graphql/generated/graphql";
77
import { useQuery } from "@tanstack/react-query";
88
import { useSearchParams } from "next/navigation";
99
import { Button } from "@codegouvfr/react-dsfr/Button";
@@ -14,7 +14,7 @@ const getCertificationsQuery = graphql(`
1414
query getCertificationsV2ForListPage(
1515
$offset: Int
1616
$searchFilter: String
17-
$status: CertificationStatusV2
17+
$status: CertificationStatus
1818
$visible: Boolean
1919
) {
2020
searchCertificationsForAdmin(
@@ -28,7 +28,7 @@ const getCertificationsQuery = graphql(`
2828
id
2929
label
3030
codeRncp
31-
statusV2
31+
status
3232
visible
3333
certificationAuthorityStructure {
3434
label
@@ -66,7 +66,7 @@ const CertificationListPage = () => {
6666
graphqlClient.request(getCertificationsQuery, {
6767
offset: (currentPage - 1) * RECORDS_PER_PAGE,
6868
searchFilter,
69-
status: status as CertificationStatusV2,
69+
status: status as CertificationStatus,
7070
visible,
7171
}),
7272
});
@@ -95,7 +95,7 @@ const CertificationListPage = () => {
9595
<div className="flex flex-row justify-between items-center">
9696
<span className="text-gray-500 text-sm">{c.codeRncp}</span>
9797
<BadgeCertificationStatus
98-
status={c.statusV2}
98+
status={c.status}
9999
visible={c.visible}
100100
/>
101101
</div>
@@ -124,7 +124,7 @@ const BadgeCertificationStatus = ({
124124
status,
125125
visible,
126126
}: {
127-
status: CertificationStatusV2;
127+
status: CertificationStatus;
128128
visible: boolean;
129129
}) => (
130130
<>

packages/reva-admin-react/src/app/(admin)/certifications/[certificationId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const PageContent = ({
6565
}
6666
};
6767

68-
const isEditable = certification.statusV2 == "BROUILLON";
68+
const isEditable = certification.status == "BROUILLON";
6969

7070
return (
7171
<div data-test="update-certification-page">

packages/reva-admin-react/src/app/(admin)/certifications/[certificationId]/updateCertification.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const getCertificationQuery = graphql(`
88
id
99
label
1010
codeRncp
11-
statusV2
11+
status
1212
rncpExpiresAt
1313
rncpDeliveryDeadline
1414
availableAt

packages/reva-admin-react/src/app/(certificateur)/certification-authorities/local-accounts/certificationAuthorityQueries.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const getAccountForConnectionUser = graphql(`
2929
id
3030
label
3131
codeRncp
32-
statusV2
32+
status
3333
}
3434
certificationAuthorityLocalAccounts {
3535
id

packages/reva-admin-react/src/app/(certificateur)/certification-authorities/local-accounts/components/form-local-account/FormLocalAccount.component.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
updateSelectedValueForAllItemsBasedOnItem,
1616
updateSelectedValueForAllItemsBasedOnValue,
1717
} from "@/components/tree-select";
18-
import { CertificationStatusV2 } from "@/graphql/generated/graphql";
18+
import { CertificationStatus } from "@/graphql/generated/graphql";
1919
import { treeSelectItemsToSelectedDepartmentIds } from "@/utils";
2020

2121
export type LocalAccount = {
@@ -319,19 +319,18 @@ function getDefaultItemsCertifications(
319319
certifications: {
320320
id: string;
321321
label: string;
322-
statusV2: CertificationStatusV2;
322+
status: CertificationStatus;
323323
codeRncp: string;
324324
}[],
325325
): TreeSelectItem[] {
326326
const items: TreeSelectItem[] = certifications
327327
.filter(
328-
(c) =>
329-
c.statusV2 === "VALIDE_PAR_CERTIFICATEUR" || c.statusV2 === "INACTIVE",
328+
(c) => c.status === "VALIDE_PAR_CERTIFICATEUR" || c.status === "INACTIVE",
330329
)
331330
.map((certification) => ({
332331
id: certification.id,
333332
label: `${certification.codeRncp} - ${certification.label}${
334-
certification.statusV2 === "INACTIVE" ? " (ancienne version)" : ""
333+
certification.status === "INACTIVE" ? " (ancienne version)" : ""
335334
}`,
336335
selected: false,
337336
}));

packages/reva-api/modules/referential/features/addCertification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const addCertification = async (params: { codeRncp: string }) => {
4949

5050
const certification = await prismaClient.certification.create({
5151
data: {
52-
statusV2: "BROUILLON",
52+
status: "BROUILLON",
5353
feasibilityFormat: "DEMATERIALIZED",
5454
rncpId: codeRncp,
5555
label,

0 commit comments

Comments
 (0)