Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/db/seeds/data/common/common-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import {
acceptPixOrgaTermsOfService,
createPixAppTermsOfService,
createPixCertifTermsOfService,
createPixOrgaTermsOfService,
} from './tooling/legal-documents.js';
import { createTargetProfile } from './tooling/target-profile-tooling.js';
Expand All @@ -39,6 +40,7 @@ export const commonBuilder = async function ({ databaseBuilder }) {
// legal-document
createPixOrgaTermsOfService(databaseBuilder);
createPixAppTermsOfService(databaseBuilder);
createPixCertifTermsOfService(databaseBuilder);

// administration teams
_createAdministrationTeams(databaseBuilder);
Expand Down
4 changes: 4 additions & 0 deletions api/db/seeds/data/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const LEGAL_DOCUMENT_PIX_ORGA_TOS_ID_V1 = COMMON_OFFSET_ID;
const LEGAL_DOCUMENT_PIX_ORGA_TOS_ID_V2 = COMMON_OFFSET_ID + 1;
const LEGAL_DOCUMENT_PIX_APP_TOS_ID_V1 = COMMON_OFFSET_ID + 2;
const LEGAL_DOCUMENT_PIX_APP_TOS_ID_V2 = COMMON_OFFSET_ID + 3;
const LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V1 = COMMON_OFFSET_ID + 4;
const LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V2 = COMMON_OFFSET_ID + 5;

//TAGS
const AGRICULTURE_TAG = {
Expand Down Expand Up @@ -122,6 +124,8 @@ export {
IMPORT_FORMAT_ONDE_ID,
LEGAL_DOCUMENT_PIX_APP_TOS_ID_V1,
LEGAL_DOCUMENT_PIX_APP_TOS_ID_V2,
LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V1,
LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V2,
LEGAL_DOCUMENT_PIX_ORGA_TOS_ID_V1,
LEGAL_DOCUMENT_PIX_ORGA_TOS_ID_V2,
LYCEE_TAG,
Expand Down
17 changes: 17 additions & 0 deletions api/db/seeds/data/common/tooling/legal-documents.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
LEGAL_DOCUMENT_PIX_APP_TOS_ID_V1,
LEGAL_DOCUMENT_PIX_APP_TOS_ID_V2,
LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V1,
LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V2,
LEGAL_DOCUMENT_PIX_ORGA_TOS_ID_V1,
LEGAL_DOCUMENT_PIX_ORGA_TOS_ID_V2,
} from '../constants.js';
Expand Down Expand Up @@ -49,3 +51,18 @@ export function createPixAppTermsOfService(databaseBuilder) {
versionAt: '2022-01-01',
});
}

export function createPixCertifTermsOfService(databaseBuilder) {
databaseBuilder.factory.buildLegalDocumentVersion({
id: LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V1,
type: 'TOS',
service: 'pix-certif',
versionAt: '2018-01-01',
});
databaseBuilder.factory.buildLegalDocumentVersion({
id: LEGAL_DOCUMENT_PIX_CERTIF_TOS_ID_V2,
type: 'TOS',
service: 'pix-certif',
versionAt: '2021-01-01',
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,8 @@ export class LegalDocumentStatus {
documentPath: null,
});
}

get isAccepted() {
Comment thread
nlepage marked this conversation as resolved.
return this.status === STATUS.ACCEPTED;
}
}