Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe Commits: d284b07e by Tony Chemit at 2022-10-24T09:01:16+02:00 Le schooltype devrait être obligatoire en cas d'activité PS logbook de type 6 - Pêche - Closes #2484 - - - - - 2cbb9d2d by Tony Chemit at 2022-10-24T09:01:16+02:00 update referential validation result - - - - - ce412c8c by Tony Chemit at 2022-10-24T09:01:16+02:00 Quadrants des océans Méditerranée et Multiples non initialisés - Closes ultreiaio/ird-observe#2488 - - - - - 17 changed files: - core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json - core/api/validation/src/main/i18n/getters/validation-messages.getter - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-create-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-update-error-validation.xml - core/persistence/resources/src/main/resources/db/migration/v9/9.0/100-tck_add_referential_for_delete_test-common.sql - core/persistence/resources/src/main/resources/db/migration/v9/9.0/21_0_adapt_table_common_ocean-common.sql - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-create.json - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-update.json - core/persistence/test/src/test/resources/fixtures/persistence/table_count/referential.properties - core/services/i18n/src/main/i18n/translations/services_en_GB.properties - core/services/i18n/src/main/i18n/translations/services_es_ES.properties - core/services/i18n/src/main/i18n/translations/services_fr_FR.properties - core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-dataResult.json - core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-referentialResult.json - model/src/main/models/Observe/dto/attribute/notNullIf.properties - model/src/main/resources/fixtures/global.properties - model/src/main/resources/fixtures/variables.properties Changes: ===================================== core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json ===================================== @@ -9438,7 +9438,8 @@ { "name": "schoolType", "comments": [ - "check if referential schoolType is disabled (only if validation is strong)" + "check if referential schoolType is disabled (only if validation is strong)", + "schoolType is mandatory except if !setEnabled" ] }, { @@ -9709,7 +9710,8 @@ { "name": "schoolType", "comments": [ - "check if referential schoolType is disabled (only if validation is strong)" + "check if referential schoolType is disabled (only if validation is strong)", + "schoolType is mandatory except if !setEnabled" ] }, { ===================================== core/api/validation/src/main/i18n/getters/validation-messages.getter ===================================== @@ -79,6 +79,7 @@ observe.data.ps.localmarket.Survey.validation.date.after.currentPsCommonTrip.end observe.data.ps.localmarket.Survey.validation.date.after.currentPsCommonTrip.startDate observe.data.ps.localmarket.Survey.validation.date.delay.too.long observe.data.ps.localmarket.Survey.validation.uniqueKey +observe.data.ps.logbook.Activity.schoolType.validation.required observe.data.ps.logbook.Activity.setCount.validation.required observe.data.ps.logbook.Activity.setSuccessStatus.validation.required observe.data.ps.logbook.Catch.weight.validation.required ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-create-error-validation.xml ===================================== @@ -231,6 +231,12 @@ </field> <field name="schoolType"> + <!-- schoolType is mandatory except if !setEnabled --> + <field-validator type="mandatory" short-circuit="true"> + <param name="skip"><![CDATA[ !setEnabled ]]></param> + <message>observe.data.ps.logbook.Activity.schoolType.validation.required</message> + </field-validator> + <!-- check if referential schoolType is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/ActivityDto-update-error-validation.xml ===================================== @@ -231,6 +231,12 @@ </field> <field name="schoolType"> + <!-- schoolType is mandatory except if !setEnabled --> + <field-validator type="mandatory" short-circuit="true"> + <param name="skip"><![CDATA[ !setEnabled ]]></param> + <message>observe.data.ps.logbook.Activity.schoolType.validation.required</message> + </field-validator> + <!-- check if referential schoolType is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/100-tck_add_referential_for_delete_test-common.sql ===================================== @@ -20,7 +20,8 @@ -- #L% --- -- Ocean -INSERT INTO common.ocean(topiaId, topiaCreateDate, topiaVersion, lastUpdateDate, code, uri, homeId, needComment, status, label1, label2, label3, label4, label5, label6, label7, label8, northEastAllowed, southEastAllowed, southWestAllowed, northWestAllowed) VALUES ('fr.ird.referential.common.Ocean#0#0', '2009-04-15 00:00:00.002', 16, '2021-09-17 00:00:00.0', '32', NULL, NULL, false, 1, 'Med', 'Méditerranée', 'Méditerrano', NULL, NULL, NULL, NULL, NULL, true, true, true, true); +INSERT INTO common.ocean(topiaId, topiaCreateDate, topiaVersion, lastUpdateDate, code, uri, homeId, needComment, status, label1, label2, label3, label4, label5, label6, label7, label8, northEastAllowed, southEastAllowed, southWestAllowed, northWestAllowed) VALUES ('fr.ird.referential.common.Ocean#1651431107744#0.7000579392148572', '2009-04-15 00:00:00.002', 16, '2021-09-17 00:00:00.0', '4', NULL, NULL, false, 1, 'Med', 'Méditerranée', 'Méditerrano', NULL, NULL, NULL, NULL, NULL, true, false, false, true); +INSERT INTO common.ocean(topiaId, topiaCreateDate, topiaVersion, lastUpdateDate, code, uri, homeId, needComment, status, label1, label2, label3, label4, label5, label6, label7, label8, northEastAllowed, southEastAllowed, southWestAllowed, northWestAllowed) VALUES ('fr.ird.referential.common.Ocean#1651650345031#0.44320492543276846', '2009-04-15 00:00:00.002', 16, '2021-09-17 00:00:00.0', '99', NULL, NULL, false, 1, 'Multiple', 'Multiples', 'múltiple', NULL, NULL, NULL, NULL, NULL, true, true, true, true); -- Organism INSERT INTO common.organism(topiaId, topiaCreateDate, topiaVersion, lastUpdateDate, code, uri, homeId, needComment, status, label1, label2, label3, label4, label5, label6, label7, label8, description, country) VALUES ('fr.ird.referential.common.Organism#0#0', '2015-09-03 11:20:43.546', 2, '2018-10-19 13:30:23.388', '92', NULL, NULL, false, 1, 'Mayotte Marine National Parc 2', 'Parc Naturel Marin de Mayotte 2', 'Parc Naturel Marin de Mayotte 2', NULL, NULL, NULL, NULL, NULL, NULL, 'fr.ird.referential.common.Country#1239832675583#0.9493110781716075'); -- Sex ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/21_0_adapt_table_common_ocean-common.sql ===================================== @@ -31,8 +31,8 @@ UPDATE common.Ocean set lastUpdateDate = ${CURRENT_TIMESTAMP}, topiaVersion = to -- For Ocean 3 Pacific UPDATE common.Ocean set lastUpdateDate = ${CURRENT_TIMESTAMP}, topiaVersion = topiaVersion + 1, northEastAllowed = TRUE, southEastAllowed = TRUE, southWestAllowed = TRUE, northWestAllowed = TRUE WHERE topiaId = 'fr.ird.referential.common.Ocean#1239832686152#0.7039171539191688'; -- For Ocean 4 -UPDATE common.Ocean set lastUpdateDate = ${CURRENT_TIMESTAMP}, topiaVersion = topiaVersion + 1, northEastAllowed = TRUE, northWestAllowed = TRUE WHERE topiaId = 'fr.ird.entities.referentiel.Ocean#1651431107744#0.7000579392148572'; +UPDATE common.Ocean set lastUpdateDate = ${CURRENT_TIMESTAMP}, topiaVersion = topiaVersion + 1, northEastAllowed = TRUE, northWestAllowed = TRUE WHERE topiaId = 'fr.ird.entities.referential.common.Ocean#1651431107744#0.7000579392148572'; -- For Ocean 99 -UPDATE common.Ocean set lastUpdateDate = ${CURRENT_TIMESTAMP}, topiaVersion = topiaVersion + 1, northEastAllowed = TRUE, southEastAllowed = TRUE, southWestAllowed = TRUE, northWestAllowed = TRUE WHERE topiaId = 'fr.ird.entities.referentiel.Ocean#1651650345031#0.44320492543276846'; +UPDATE common.Ocean set lastUpdateDate = ${CURRENT_TIMESTAMP}, topiaVersion = topiaVersion + 1, northEastAllowed = TRUE, southEastAllowed = TRUE, southWestAllowed = TRUE, northWestAllowed = TRUE WHERE topiaId = 'fr.ird.entities.referential.common.Ocean#1651650345031#0.44320492543276846'; UPDATE common.LastUpdateDate SET lastUpdateDate = ${CURRENT_TIMESTAMP} WHERE type ='fr.ird.observe.entities.referential.common.Ocean'; \ No newline at end of file ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-create.json ===================================== @@ -122,7 +122,8 @@ }, "schoolType": { "errors": [ - "check if referential schoolType is disabled (only if validation is strong)" + "check if referential schoolType is disabled (only if validation is strong)", + "schoolType is mandatory except if !setEnabled" ], "warnings": [ "check if referential schoolType is disabled (only if validation is not strong)" ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/Activity/validation-update.json ===================================== @@ -122,7 +122,8 @@ }, "schoolType": { "errors": [ - "check if referential schoolType is disabled (only if validation is strong)" + "check if referential schoolType is disabled (only if validation is strong)", + "schoolType is mandatory except if !setEnabled" ], "warnings": [ "check if referential schoolType is disabled (only if validation is not strong)" ===================================== core/persistence/test/src/test/resources/fixtures/persistence/table_count/referential.properties ===================================== @@ -29,7 +29,7 @@ common.harbour=98 common.lengthLengthParameter=1 common.lengthMeasureMethod=4 common.lengthWeightParameter=365 -common.ocean=4 +common.ocean=5 common.organism=11 common.person=741 common.sex=6 ===================================== core/services/i18n/src/main/i18n/translations/services_en_GB.properties ===================================== @@ -1079,6 +1079,7 @@ observe.data.ps.logbook.Activity.number=Order number observe.data.ps.logbook.Activity.observedSystemTab=Observed systems observe.data.ps.logbook.Activity.originalDataModified=Original data modified? observe.data.ps.logbook.Activity.physicalMeasurements=Physical measurements +observe.data.ps.logbook.Activity.schoolType.validation.required=Mandatory if set operation observe.data.ps.logbook.Activity.setCount=Set count observe.data.ps.logbook.Activity.setCount.validation.required=Mandatory if set operation observe.data.ps.logbook.Activity.setMeasurements=Set measurements ===================================== core/services/i18n/src/main/i18n/translations/services_es_ES.properties ===================================== @@ -1079,6 +1079,7 @@ observe.data.ps.logbook.Activity.number=Order number \#TODO observe.data.ps.logbook.Activity.observedSystemTab=Sistema observado observe.data.ps.logbook.Activity.originalDataModified=Original data modified?\#TODO observe.data.ps.logbook.Activity.physicalMeasurements=Physical measurements +observe.data.ps.logbook.Activity.schoolType.validation.required=Mandatory if set operation \#TODO observe.data.ps.logbook.Activity.setCount=Fishing operation count observe.data.ps.logbook.Activity.setCount.validation.required=Mandatory if set operation \#TODO observe.data.ps.logbook.Activity.setMeasurements=Fishing operation measurements ===================================== core/services/i18n/src/main/i18n/translations/services_fr_FR.properties ===================================== @@ -1079,6 +1079,7 @@ observe.data.ps.logbook.Activity.number=Numéro d'ordre observe.data.ps.logbook.Activity.observedSystemTab=Systèmes observés observe.data.ps.logbook.Activity.originalDataModified=Données d'origine modifiées ? observe.data.ps.logbook.Activity.physicalMeasurements=Paramètres physiques +observe.data.ps.logbook.Activity.schoolType.validation.required=Obligatoire si opération de pêche observe.data.ps.logbook.Activity.setCount=Nombre de coups de pêche observe.data.ps.logbook.Activity.setCount.validation.required=Obligatoire si opération de pêche observe.data.ps.logbook.Activity.setMeasurements=Paramètres de calée ===================================== core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-dataResult.json ===================================== @@ -39059,6 +39059,11 @@ "scope": "WARNING", "message": "Le champ n\u0027est pas renseigné." }, + { + "fieldName": "schoolType", + "scope": "ERROR", + "message": "Obligatoire si opération de pêche" + }, { "fieldName": "seaSurfaceTemperature", "scope": "WARNING", @@ -39133,6 +39138,11 @@ "scope": "WARNING", "message": "Le champ n\u0027est pas renseigné." }, + { + "fieldName": "schoolType", + "scope": "ERROR", + "message": "Obligatoire si opération de pêche" + }, { "fieldName": "seaSurfaceTemperature", "scope": "WARNING", @@ -39212,6 +39222,11 @@ "scope": "WARNING", "message": "Le champ n\u0027est pas renseigné." }, + { + "fieldName": "schoolType", + "scope": "ERROR", + "message": "Obligatoire si opération de pêche" + }, { "fieldName": "seaSurfaceTemperature", "scope": "WARNING", ===================================== core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-referentialResult.json ===================================== @@ -27309,7 +27309,7 @@ "content": { "code": "110", "label": "Chavirage de la poche", - "allowObservation": false, + "allowObservation": true, "allowLogbook": true, "needComment": false, "enabled": true, @@ -174033,7 +174033,7 @@ "localMarketWellsSampling": true, "localMarketSurveySampling": true, "advancedSampling": true, - "fieldEnabler": true, + "fieldEnabler": false, "needComment": false, "enabled": true, "id": "fr.ird.referential.ps.common.AcquisitionStatus#1464000000000#999", @@ -177677,6 +177677,54 @@ } ] }, + { + "reference": { + "type": "fr.ird.observe.dto.referential.ps.common.ObservedSystemReference", + "content": { + "code": "74", + "label": "Poisson à rostre", + "allowObservation": false, + "allowLogbook": true, + "needComment": false, + "enabled": true, + "id": "fr.ird.referential.ps.common.ObservedSystem#1464000000000#74", + "lastUpdateDate": "2021-09-17T00:00:00.000Z", + "topiaVersion": 0, + "topiaCreateDate": "2021-09-17T00:00:00.000Z" + } + }, + "messages": [ + { + "fieldName": "label3", + "scope": "WARNING", + "message": "Le libellé espagnol n\u0027est pas traduit." + } + ] + }, + { + "reference": { + "type": "fr.ird.observe.dto.referential.ps.common.ObservedSystemReference", + "content": { + "code": "81", + "label": "Charogne", + "allowObservation": false, + "allowLogbook": true, + "needComment": false, + "enabled": true, + "id": "fr.ird.referential.ps.common.ObservedSystem#1464000000000#81", + "lastUpdateDate": "2021-09-17T00:00:00.000Z", + "topiaVersion": 0, + "topiaCreateDate": "2021-09-17T00:00:00.000Z" + } + }, + "messages": [ + { + "fieldName": "label3", + "scope": "WARNING", + "message": "Le libellé espagnol n\u0027est pas traduit." + } + ] + }, { "reference": { "type": "fr.ird.observe.dto.referential.ps.common.ProgramReference", ===================================== model/src/main/models/Observe/dto/attribute/notNullIf.properties ===================================== @@ -46,6 +46,7 @@ data.ps.localmarket.Batch.attribute.weight=countOrWeightValid data.ps.logbook.Activity.attribute.latitude=floatingObjectEnabled && !setEnabled data.ps.logbook.Activity.attribute.longitude=floatingObjectEnabled && !setEnabled data.ps.logbook.Activity.attribute.quadrant=floatingObjectEnabled && !setEnabled +data.ps.logbook.Activity.attribute.schoolType=!setEnabled data.ps.logbook.Activity.attribute.setCount=!setEnabled data.ps.logbook.Activity.attribute.setSuccessStatus=!setEnabled || reasonForNoFishing != null data.ps.logbook.Catch.attribute.weight=count != null && count > 0 ===================================== model/src/main/resources/fixtures/global.properties ===================================== @@ -25,4 +25,4 @@ REFERENCE_DATA_COUNT=66 ENTITIES_LIMIT_SIZE=100 # fr.ird.observe.services.service.referential.ReferentialService # fr.ird.observe.services.local.service.referential.DifferentialModelTest -REFERENTIAL_COUNT=4092 +REFERENTIAL_COUNT=4093 ===================================== model/src/main/resources/fixtures/variables.properties ===================================== @@ -96,7 +96,7 @@ referential.common.common.Harbour.id=fr.ird.referential.common.Harbour#11#0.7 referential.common.common.LengthLengthParameter.id=fr.ird.referential.common.LengthLengthParameter#1464000000000#0 referential.common.common.LengthMeasureMethod.id=fr.ird.referential.common.LengthMeasureMethod#666#01 referential.common.common.LengthWeightParameter.id=fr.ird.referential.common.LengthWeightParameter#201008191245#0.63 -referential.common.common.Ocean.id.delete=fr.ird.referential.common.Ocean#0#0 +referential.common.common.Ocean.id.delete=fr.ird.referential.common.Ocean#1651431107744#0.7000579392148572 referential.common.common.Ocean.id=fr.ird.referential.common.Ocean#1239832686151#0.17595105505051245 referential.common.common.Organism.id.delete=fr.ird.referential.common.Organism#0#0 referential.common.common.Organism.id=fr.ird.referential.common.Organism#1267835067241#0.6705236825871838 View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/771e64e4f9cb0d1362eeb6c44... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/771e64e4f9cb0d1362eeb6c44... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT (@tchemit)