Skip to content

Commit 04cbb38

Browse files
[FEATURE] Ajouter les attributs d'archivage d'un centre de certification (PIX-16748)
#11928
2 parents fcdad1c + c936545 commit 04cbb38

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

api/db/database-builder/factory/build-certification-center.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const buildCertificationCenter = function ({
99
updatedAt,
1010
isV3Pilot = false,
1111
isScoBlockedAccessWhitelist = false,
12+
archivedAt = null,
13+
archivedBy = null,
1214
} = {}) {
1315
const values = {
1416
id,
@@ -19,6 +21,8 @@ const buildCertificationCenter = function ({
1921
updatedAt,
2022
isV3Pilot,
2123
isScoBlockedAccessWhitelist,
24+
archivedAt,
25+
archivedBy,
2226
};
2327
return databaseBuffer.pushInsertable({
2428
tableName: 'certification-centers',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const TABLE_NAME = 'certification-centers';
2+
3+
const up = async function (knex) {
4+
await knex.schema.table(TABLE_NAME, function (table) {
5+
table.timestamp('archivedAt');
6+
table.bigInteger('archivedBy').references('users.id').index();
7+
});
8+
};
9+
10+
const down = async function (knex) {
11+
await knex.schema.table(TABLE_NAME, function (table) {
12+
table.dropColumn('archivedAt');
13+
table.dropColumn('archivedBy');
14+
});
15+
};
16+
17+
export { down, up };

api/tests/tooling/domain-builder/factory/build-certification-center.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const buildCertificationCenter = function ({
99
updatedAt,
1010
habilitations = [],
1111
isV3Pilot = false,
12+
archivedAt,
13+
archivedBy,
1214
} = {}) {
1315
return new CertificationCenter({
1416
id,
@@ -19,6 +21,8 @@ const buildCertificationCenter = function ({
1921
createdAt,
2022
habilitations,
2123
isV3Pilot,
24+
archivedAt,
25+
archivedBy,
2226
});
2327
};
2428

0 commit comments

Comments
 (0)