|
1 |
| -import { CertificationCenter } from '../../../../src/shared/domain/models/index.js'; |
2 |
| -import { FEATURE_CAN_REGISTER_FOR_A_COMPLEMENTARY_CERTIFICATION_ALONE_ID } from '../common/constants.js'; |
3 | 1 | import * as tooling from '../common/tooling/index.js';
|
4 | 2 | import { acceptPixOrgaTermsOfService } from '../common/tooling/legal-documents.js';
|
5 |
| -import { |
6 |
| - CERTIFIABLE_SUCCESS_USER_ID, |
7 |
| - complementaryCertificationIds, |
8 |
| - PRO_PILOT_CERTIFICATION_CENTER_ID, |
9 |
| - V3_CERTIFICATION_CENTER_ID, |
10 |
| - V3_CERTIFICATION_CENTER_USER_ID, |
11 |
| - V3_PRO_PILOT_EXTERNAL_ID, |
12 |
| -} from './constants.js'; |
| 3 | +import { CERTIFIABLE_SUCCESS_USER_ID } from './constants.js'; |
13 | 4 | import { proOrganizationWithCertifCenter } from './create-pro-organization-with-certif-center.js';
|
14 | 5 | import { scoOrganizationManaginAgriStudentsWithFregata } from './create-sco-organization-managing-agri-student-with-fregata.js';
|
15 | 6 | import { scoOrganizationManaginStudentsWithSiecle } from './create-sco-organization-managing-student-with-siecle.js';
|
16 | 7 | import { scoOrganizationNotManagingStudents } from './create-sco-organization-not-managing-students.js';
|
| 8 | +import { supCertificationCenterOnly } from './create-sup-certifification-center-only.js'; |
17 | 9 | import { setupConfigurations } from './setup-configuration.js';
|
18 | 10 |
|
19 | 11 | async function teamCertificationDataBuilder({ databaseBuilder }) {
|
20 | 12 | await scoOrganizationManaginAgriStudentsWithFregata({ databaseBuilder });
|
21 | 13 | await scoOrganizationManaginStudentsWithSiecle({ databaseBuilder });
|
22 | 14 | await proOrganizationWithCertifCenter({ databaseBuilder });
|
| 15 | + await supCertificationCenterOnly({ databaseBuilder }); |
23 | 16 | await scoOrganizationNotManagingStudents({ databaseBuilder });
|
24 |
| - await _createV3PilotCertificationCenter({ databaseBuilder }); |
25 | 17 | await _createSuccessCertifiableUser({ databaseBuilder });
|
26 | 18 | await setupConfigurations({ databaseBuilder });
|
27 | 19 | }
|
28 | 20 |
|
29 | 21 | export { teamCertificationDataBuilder };
|
30 | 22 |
|
31 |
| -async function _createV3PilotCertificationCenter({ databaseBuilder }) { |
32 |
| - databaseBuilder.factory.buildUser.withRawPassword({ |
33 |
| - id: V3_CERTIFICATION_CENTER_USER_ID, |
34 |
| - firstName: 'membre certif v3', |
35 |
| - lastName: 'Certification', |
36 |
| - email: 'certifv3@example.net', |
37 |
| - cgu: true, |
38 |
| - lang: 'fr', |
39 |
| - lastTermsOfServiceValidatedAt: new Date(), |
40 |
| - mustValidateTermsOfService: false, |
41 |
| - pixCertifTermsOfServiceAccepted: false, |
42 |
| - hasSeenAssessmentInstructions: false, |
43 |
| - }); |
44 |
| - |
45 |
| - acceptPixOrgaTermsOfService(databaseBuilder, V3_CERTIFICATION_CENTER_USER_ID); |
46 |
| - |
47 |
| - await tooling.certificationCenter.createCertificationCenter({ |
48 |
| - databaseBuilder, |
49 |
| - certificationCenterId: V3_CERTIFICATION_CENTER_ID, |
50 |
| - name: 'Centre de certification v3', |
51 |
| - type: CertificationCenter.types.PRO, |
52 |
| - externalId: null, |
53 |
| - createdAt: new Date(), |
54 |
| - updatedAt: new Date(), |
55 |
| - members: [{ id: V3_CERTIFICATION_CENTER_USER_ID }], |
56 |
| - isV3Pilot: true, |
57 |
| - complementaryCertificationIds: [], |
58 |
| - }); |
59 |
| - |
60 |
| - await tooling.certificationCenter.createCertificationCenter({ |
61 |
| - databaseBuilder, |
62 |
| - certificationCenterId: PRO_PILOT_CERTIFICATION_CENTER_ID, |
63 |
| - name: 'Centre de certification v3 pro pilote pour la séparation pix/pix+', |
64 |
| - type: CertificationCenter.types.PRO, |
65 |
| - externalId: V3_PRO_PILOT_EXTERNAL_ID, |
66 |
| - createdAt: new Date(), |
67 |
| - updatedAt: new Date(), |
68 |
| - members: [{ id: V3_CERTIFICATION_CENTER_USER_ID }], |
69 |
| - isV3Pilot: true, |
70 |
| - complementaryCertificationIds, |
71 |
| - featureIds: [FEATURE_CAN_REGISTER_FOR_A_COMPLEMENTARY_CERTIFICATION_ALONE_ID], |
72 |
| - }); |
73 |
| -} |
74 |
| - |
75 | 23 | async function _createSuccessCertifiableUser({ databaseBuilder }) {
|
76 | 24 | const userId = databaseBuilder.factory.buildUser.withRawPassword({
|
77 | 25 | id: CERTIFIABLE_SUCCESS_USER_ID,
|
|
0 commit comments