@@ -26,6 +26,7 @@ import { PIX_ADMIN } from '../src/authorization/domain/constants.js';
26
26
import * as tutorialRepository from '../src/devcomp/infrastructure/repositories/tutorial-repository.js' ;
27
27
import * as missionRepository from '../src/school/infrastructure/repositories/mission-repository.js' ;
28
28
import { config } from '../src/shared/config.js' ;
29
+ import { ORGANIZATION_FEATURE } from '../src/shared/domain/constants.js' ;
29
30
import { Membership } from '../src/shared/domain/models/index.js' ;
30
31
import * as tokenService from '../src/shared/domain/services/token-service.js' ;
31
32
import { featureToggles } from '../src/shared/infrastructure/feature-toggles/index.js' ;
@@ -192,6 +193,14 @@ async function insertOrganizationUserWithRoleAdmin() {
192
193
return { adminUser, organization } ;
193
194
}
194
195
196
+ // We insert a multiple sending feature by default for each new organization created.
197
+ // It is under feature for now because we want to be able to deactivate it when asked.
198
+ async function insertMultipleSendingFeatureForNewOrganization ( ) {
199
+ const feature = databaseBuilder . factory . buildFeature ( ORGANIZATION_FEATURE . MULTIPLE_SENDING_ASSESSMENT ) ;
200
+ await databaseBuilder . commit ( ) ;
201
+ return feature . id ;
202
+ }
203
+
195
204
// Hapi
196
205
const hFake = {
197
206
response ( source ) {
@@ -348,6 +357,7 @@ export {
348
357
generateValidRequestAuthorizationHeaderForApplication ,
349
358
hFake ,
350
359
HttpTestServer ,
360
+ insertMultipleSendingFeatureForNewOrganization ,
351
361
insertOrganizationUserWithRoleAdmin ,
352
362
insertUserWithRoleCertif ,
353
363
insertUserWithRoleSuperAdmin ,
0 commit comments