Skip to content

Commit 378aa10

Browse files
committed
multiple fixes after review
add missing cross-env for root package fix attributesRestore for composed objects use ExtendedPlaceAttributes instead of generic object in Place children classes fix missing underscore in _journeyUuid param fix copyright year in object registry test files fix import at wrong place fix wrong test description add weights validation for junction (all other weightable classes add the weights validation, but it was missing for Junction) move slugify to devDep (it was only used in tests) use Promise.all for audits updates remove testing from root move auditLocales test to backend remove restoreAttributes (not needed since the parsers can do the same work and we should limit these restoration to a minimum)
1 parent 82d2ca3 commit 378aa10

File tree

115 files changed

+3435
-5589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3435
-5589
lines changed

jest.config.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

locales/__tests__/AuditLocales.test.ts

Lines changed: 0 additions & 126 deletions
This file was deleted.

locales/en/audits.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
{
2-
"I_M_Uuid": "Interview UUID is missing",
3-
"I_M_Id": "Interview ID is missing",
4-
"I_M_Response": "Interview has no response",
2+
"I_M_Languages": "Interview languages are missing",
53

64
"HH_I_Size": "Household size is out of range (should be between 1 and 20)",
7-
"HH_M_Uuid": "Household UUID is missing",
5+
"HH_M_Size": "Household size is missing",
86

97
"HM_M_Geography": "Home geography is missing",
10-
"HM_M_Uuid": "Home UUID is missing",
8+
"HM_I_Geography": "Home geography is invalid",
119

12-
"P_M_Uuid": "Person UUID is missing",
1310
"P_M_Age": "Person age is missing",
1411

15-
"J_M_Uuid": "Journey UUID is missing",
16-
"J_M_StartTime": "Journey start time is missing",
12+
"J_M_StartDate": "Journey start date is missing",
1713

1814
"VP_M_Geography": "Visited place geography is missing",
19-
"VP_M_Uuid": "Visited place UUID is missing",
15+
"VP_I_Geography": "Visited place geography is invalid",
2016

21-
"T_M_Uuid": "Trip UUID is missing",
22-
"T_M_StartDate": "Trip start date is missing",
17+
"T_M_Segments": "Trip segments are missing",
2318

24-
"S_M_Uuid": "Segment UUID is missing",
2519
"S_M_Mode": "Segment mode is missing"
2620
}

locales/fr/audits.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
{
2-
"I_M_Uuid": "Le UUID de l'entrevue est manquant",
3-
"I_M_Id": "Le ID de l'entrevue est manquant",
4-
"I_M_Response": "L'entrevue ne contient pas de réponse",
2+
"I_M_Languages": "Les langues de l'entrevue sont manquantes",
53

64
"HH_I_Size": "La taille du ménage est en dehors de la plage autorisée (devrait être entre 1 et 20)",
7-
"HH_M_Uuid": "Le UUID du ménage est manquant",
5+
"HH_M_Size": "La taille du ménage est manquante",
86

97
"HM_M_Geography": "La géographie du domicile est manquante",
10-
"HM_M_Uuid": "Le UUID du domicile est manquant",
8+
"HM_I_Geography": "La géographie du domicile est invalide",
119

12-
"P_M_Uuid": "Le UUID de la personne est manquant",
1310
"P_M_Age": "L'âge de la personne est manquant",
1411

15-
"J_M_Uuid": "Le UUID du séjour est manquant",
16-
"J_M_StartTime": "L'heure de début du séjour est manquante",
12+
"J_M_StartDate": "La date de début du séjour est manquante",
1713

1814
"VP_M_Geography": "La géographie du lieu visité est manquante",
19-
"VP_M_Uuid": "Le UUID du lieu visité est manquant",
15+
"VP_I_Geography": "La géographie du lieu visité est invalide",
2016

21-
"T_M_Uuid": "Le UUID du déplacement est manquant",
22-
"T_M_StartDate": "La date de début du déplacement est manquante",
17+
"T_M_Segments": "Les segments du déplacement sont manquants",
2318

24-
"S_M_Uuid": "Le UUID du segment est manquant",
2519
"S_M_Mode": "Le mode du segment est manquant"
2620
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"start:debug": "yarn workspace demo_survey run start:debug",
3939
"start:tracing": "yarn workspace demo_survey run start:tracing",
4040
"start:generator": "yarn workspace demo_generator run start",
41-
"test": "cross-env NODE_ENV=test jest --config=jest.config.js && yarn workspace evolution-common run test && yarn workspace evolution-backend run test && yarn workspace evolution-frontend run test && yarn workspace evolution-interviewer run test",
42-
"test:unit": "cross-env NODE_ENV=test jest --config=jest.config.js && yarn workspace evolution-common run test:unit && yarn workspace evolution-backend run test:unit && yarn workspace evolution-frontend run test:unit && yarn workspace evolution-interviewer run test:unit",
41+
"test": "yarn workspace evolution-common run test && yarn workspace evolution-backend run test && yarn workspace evolution-frontend run test && yarn workspace evolution-interviewer run test",
42+
"test:unit": "yarn workspace evolution-common run test:unit && yarn workspace evolution-backend run test:unit && yarn workspace evolution-frontend run test:unit && yarn workspace evolution-interviewer run test:unit",
4343
"test:sequential": "yarn workspace evolution-common run test:sequential && yarn workspace evolution-backend run test:sequential && yarn workspace evolution-frontend run test:sequential && yarn workspace evolution-interviewer run test:sequential",
4444
"test:generator": "python -m pytest -s -W ignore packages/evolution-generator/src/tests/",
4545
"test:ui": "yarn workspace demo_survey run test:ui",

packages/evolution-backend/src/api/survey.validation.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ router.get(
4444
}
4545
// Run audits on the corrected_response
4646
const objectsAndAudits: SurveyObjectsWithAudits =
47-
await SurveyObjectsAndAuditsFactory.createSurveyObjectsAndAudit(interview);
47+
await SurveyObjectsAndAuditsFactory.createSurveyObjectsAndSaveAuditsToDb(interview);
4848

4949
// TODO Here, the response field should not make it to frontend. But make sure there are no side effect in the frontend, where the _response is used or checked.
5050
const { response, corrected_response, ...rest } = interview;

packages/evolution-backend/src/config/projectConfig.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { SurveyObjectsWithAudits } from 'evolution-common/lib/services/audits/types';
88
import { ServerFieldUpdateCallback } from '../services/interviews/serverFieldUpdate';
99
import { ServerValidation } from '../services/validations/serverValidation';
10-
import { AttributesToRestore, SurveyObjectParsers } from '../services/audits/types';
10+
import { SurveyObjectParsers } from '../services/audits/types';
1111
import {
1212
InterviewAttributes,
1313
InterviewListAttributes,
@@ -29,12 +29,6 @@ interface ProjectServerConfig {
2929
* individual audits. It is optional. If the survey does not require auditing, just leave blank.
3030
*/
3131
auditInterview?: (attributes: InterviewAttributes) => Promise<SurveyObjectsWithAudits>;
32-
/**
33-
* Configuration for restoring attributes from original responses during audit workflow.
34-
* This allows preserving respondent preferences that may have been overwritten during admin corrections.
35-
* Optional - if not provided, no attribute restoration will occur.
36-
*/
37-
attributesToRestore?: AttributesToRestore;
3832
/**
3933
* Configuration for parsing survey response values before object creation.
4034
* This allows converting string values like 'yes'/'no' to proper types like boolean

0 commit comments

Comments
 (0)