diff --git a/src/main/java/fr/insee/pearljam/api/surveyunit/dto/IdentificationDto.java b/src/main/java/fr/insee/pearljam/api/surveyunit/dto/IdentificationDto.java index 377c242..9f946eb 100644 --- a/src/main/java/fr/insee/pearljam/api/surveyunit/dto/IdentificationDto.java +++ b/src/main/java/fr/insee/pearljam/api/surveyunit/dto/IdentificationDto.java @@ -1,6 +1,5 @@ package fr.insee.pearljam.api.surveyunit.dto; -import com.fasterxml.jackson.annotation.JsonProperty; import fr.insee.pearljam.domain.surveyunit.model.Identification; import fr.insee.pearljam.domain.surveyunit.model.question.*; @@ -10,15 +9,10 @@ public record IdentificationDto( SituationQuestionValue situation, CategoryQuestionValue category, OccupantQuestionValue occupant, - @JsonProperty("individual_status") IndividualStatusQuestionValue individualStatus, - @JsonProperty("interviewer_can_process") InterviewerCanProcessQuestionValue interviewerCanProcess, - @JsonProperty("number_of_respondents") NumberOfRespondentsQuestionValue numberOfRespondents, - @JsonProperty("present_in_previous_home") PresentInPreviousHomeQuestionValue presentInPreviousHome, - @JsonProperty("household_composition") HouseholdCompositionQuestionValue householdComposition ) { diff --git a/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/HouseholdCompositionQuestionValue.java b/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/HouseholdCompositionQuestionValue.java index e2a93e2..b5f3198 100644 --- a/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/HouseholdCompositionQuestionValue.java +++ b/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/HouseholdCompositionQuestionValue.java @@ -1,5 +1,5 @@ package fr.insee.pearljam.domain.surveyunit.model.question; public enum HouseholdCompositionQuestionValue { - SAMECOMPO, OTHERCOMPO + SAME_COMPO, OTHER_COMPO } diff --git a/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/IndividualStatusQuestionValue.java b/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/IndividualStatusQuestionValue.java index 49353d6..d1b7719 100644 --- a/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/IndividualStatusQuestionValue.java +++ b/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/IndividualStatusQuestionValue.java @@ -1,5 +1,5 @@ package fr.insee.pearljam.domain.surveyunit.model.question; public enum IndividualStatusQuestionValue { - DCD, NOIDENT, NOFIELD, SAMEADDRESS, OTHERADDRESS + DCD, NOIDENT, NOFIELD, SAME_ADDRESS, OTHER_ADDRESS } diff --git a/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/PresentInPreviousHomeQuestionValue.java b/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/PresentInPreviousHomeQuestionValue.java index 8d0017a..31ac06a 100644 --- a/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/PresentInPreviousHomeQuestionValue.java +++ b/src/main/java/fr/insee/pearljam/domain/surveyunit/model/question/PresentInPreviousHomeQuestionValue.java @@ -1,5 +1,5 @@ package fr.insee.pearljam.domain.surveyunit.model.question; public enum PresentInPreviousHomeQuestionValue { - ATLEASTONE, NONE + AT_LEAST_ONE, NONE } diff --git a/src/main/resources/db/dataset/reinit-test-data.sql b/src/main/resources/db/dataset/reinit-test-data.sql index 9ea92cf..63964ff 100644 --- a/src/main/resources/db/dataset/reinit-test-data.sql +++ b/src/main/resources/db/dataset/reinit-test-data.sql @@ -197,7 +197,7 @@ INSERT INTO closing_cause (date, type, survey_unit_id) VALUES INSERT INTO public.identification (survey_unit_id, identification,access,situation,category,occupant,individual_status,interviewer_can_process,number_of_respondents,present_in_previous_home,household_composition) VALUES - ('11', 'IDENTIFIED', 'ACC', 'ORDINARY', 'PRIMARY', 'IDENTIFIED','SAMEADDRESS','YES','MANY','ATLEASTONE','SAMECOMPO'), + ('11', 'IDENTIFIED', 'ACC', 'ORDINARY', 'PRIMARY', 'IDENTIFIED','SAME_ADDRESS','YES','MANY','AT_LEAST_ONE','SAME_COMPO'), ('21', 'IDENTIFIED', 'ACC', 'ORDINARY', 'PRIMARY', 'IDENTIFIED', null, null, null, null, null); INSERT INTO public.communication_template (meshuggah_id, medium, type, campaign_id) VALUES diff --git a/src/test/java/fr/insee/pearljam/domain/surveyunit/service/SurveyUnitUpdateServiceImplTest.java b/src/test/java/fr/insee/pearljam/domain/surveyunit/service/SurveyUnitUpdateServiceImplTest.java index 2de0d8a..ce329d0 100644 --- a/src/test/java/fr/insee/pearljam/domain/surveyunit/service/SurveyUnitUpdateServiceImplTest.java +++ b/src/test/java/fr/insee/pearljam/domain/surveyunit/service/SurveyUnitUpdateServiceImplTest.java @@ -237,11 +237,11 @@ void testUpdateIdentification01() { SituationQuestionValue.NOORDINARY, CategoryQuestionValue.VACANT, OccupantQuestionValue.UNIDENTIFIED, - IndividualStatusQuestionValue.OTHERADDRESS, + IndividualStatusQuestionValue.OTHER_ADDRESS, InterviewerCanProcessQuestionValue.NO, NumberOfRespondentsQuestionValue.MANY, PresentInPreviousHomeQuestionValue.NONE, - HouseholdCompositionQuestionValue.OTHERCOMPO + HouseholdCompositionQuestionValue.OTHER_COMPO ); surveyUnitDto = createSurveyUnitDto(identification, null, null); @@ -253,11 +253,11 @@ void testUpdateIdentification01() { assertThat(identificationResult.getSituation()).isEqualTo(SituationQuestionValue.NOORDINARY); assertThat(identificationResult.getCategory()).isEqualTo(CategoryQuestionValue.VACANT); assertThat(identificationResult.getOccupant()).isEqualTo(OccupantQuestionValue.UNIDENTIFIED); - assertThat(identificationResult.getIndividualStatus()).isEqualTo(IndividualStatusQuestionValue.OTHERADDRESS); + assertThat(identificationResult.getIndividualStatus()).isEqualTo(IndividualStatusQuestionValue.OTHER_ADDRESS); assertThat(identificationResult.getInterviewerCanProcess()).isEqualTo(InterviewerCanProcessQuestionValue.NO); assertThat(identificationResult.getNumberOfRespondents()).isEqualTo(NumberOfRespondentsQuestionValue.MANY); assertThat(identificationResult.getPresentInPreviousHome()).isEqualTo(PresentInPreviousHomeQuestionValue.NONE); - assertThat(identificationResult.getHouseholdComposition()).isEqualTo(HouseholdCompositionQuestionValue.OTHERCOMPO); + assertThat(identificationResult.getHouseholdComposition()).isEqualTo(HouseholdCompositionQuestionValue.OTHER_COMPO); assertThat(identificationResult.getSurveyUnit()).isEqualTo(surveyUnit); } @@ -280,11 +280,11 @@ void testUpdateIdentification03() { SituationQuestionValue.NOORDINARY, CategoryQuestionValue.VACANT, OccupantQuestionValue.UNIDENTIFIED, - IndividualStatusQuestionValue.OTHERADDRESS, + IndividualStatusQuestionValue.OTHER_ADDRESS, InterviewerCanProcessQuestionValue.NO, NumberOfRespondentsQuestionValue.MANY, PresentInPreviousHomeQuestionValue.NONE, - HouseholdCompositionQuestionValue.OTHERCOMPO); + HouseholdCompositionQuestionValue.OTHER_COMPO); surveyUnitDto = createSurveyUnitDto(identification, null, null); surveyUnitService.updateSurveyUnitInfos(surveyUnit, surveyUnitDto); @@ -297,11 +297,11 @@ void testUpdateIdentification03() { assertThat(identificationResult.getCategory()).isEqualTo(CategoryQuestionValue.VACANT); assertThat(identificationResult.getOccupant()).isEqualTo(OccupantQuestionValue.UNIDENTIFIED); assertThat(identificationResult.getSurveyUnit()).isEqualTo(surveyUnit); - assertThat(identificationResult.getIndividualStatus()).isEqualTo(IndividualStatusQuestionValue.OTHERADDRESS); + assertThat(identificationResult.getIndividualStatus()).isEqualTo(IndividualStatusQuestionValue.OTHER_ADDRESS); assertThat(identificationResult.getInterviewerCanProcess()).isEqualTo(InterviewerCanProcessQuestionValue.NO); assertThat(identificationResult.getNumberOfRespondents()).isEqualTo(NumberOfRespondentsQuestionValue.MANY); assertThat(identificationResult.getPresentInPreviousHome()).isEqualTo(PresentInPreviousHomeQuestionValue.NONE); - assertThat(identificationResult.getHouseholdComposition()).isEqualTo(HouseholdCompositionQuestionValue.OTHERCOMPO); + assertThat(identificationResult.getHouseholdComposition()).isEqualTo(HouseholdCompositionQuestionValue.OTHER_COMPO); } private SurveyUnitUpdateDto createSurveyUnitDto(IdentificationDto identification, List comments, List communicationRequests) { @@ -316,11 +316,11 @@ private IdentificationDB createIdentificationDB() { SituationQuestionValue.ORDINARY, CategoryQuestionValue.SECONDARY, OccupantQuestionValue.IDENTIFIED, - IndividualStatusQuestionValue.SAMEADDRESS, + IndividualStatusQuestionValue.SAME_ADDRESS, InterviewerCanProcessQuestionValue.YES, NumberOfRespondentsQuestionValue.ONE, - PresentInPreviousHomeQuestionValue.ATLEASTONE, - HouseholdCompositionQuestionValue.SAMECOMPO, + PresentInPreviousHomeQuestionValue.AT_LEAST_ONE, + HouseholdCompositionQuestionValue.SAME_COMPO, surveyUnit); } } diff --git a/src/test/java/fr/insee/pearljam/integration/surveyunit/SurveyUnitIT.java b/src/test/java/fr/insee/pearljam/integration/surveyunit/SurveyUnitIT.java index a231707..836b827 100644 --- a/src/test/java/fr/insee/pearljam/integration/surveyunit/SurveyUnitIT.java +++ b/src/test/java/fr/insee/pearljam/integration/surveyunit/SurveyUnitIT.java @@ -237,11 +237,11 @@ void testGetSurveyUnitDetail() throws Exception { "situation":"ORDINARY", "category":"PRIMARY", "occupant":"IDENTIFIED", - "individual_status":"SAMEADDRESS", - "interviewer_can_process":"YES", - "number_of_respondents":"MANY", - "present_in_previous_home":"ATLEASTONE", - "household_composition":"SAMECOMPO" + "individualStatus":"SAME_ADDRESS", + "interviewerCanProcess":"YES", + "numberOfRespondents":"MANY", + "presentInPreviousHome":"AT_LEAST_ONE", + "householdComposition":"SAME_COMPO" }, "communicationTemplates":[ {