Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 4d1534e0 by Tony Chemit at 2024-04-27T10:24:54+02:00 Le form PS logbook a perdu sa valeur Data quality par défaut lorsque la marée est créée par le programme logbook - Closes #2876 - - - - - 41034cbe by Tony Chemit at 2024-04-27T12:29:56+02:00 Il est possible de sauver un FOB sans lui avoir donné de type d'opération, et cela plante - Closes #2877 - - - - - 74b1a777 by Tony Chemit at 2024-04-27T12:30:37+02:00 Remove FloatingObjectUI.jcss and only use FloatingObjectUICommon.jcss - - - - - 30 changed files: - client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/FloatingObjectUICommon.jcss - − client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/FloatingObjectUI.jcss - − client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/FloatingObjectUI.jcss - core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/FloatingObjectDto-create-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/FloatingObjectDto-update-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/FloatingObjectDto-create-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/FloatingObjectDto-update-error-validation.xml - core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java - core/persistence/java/src/main/resources/META-INF/persistence/Observe/TopiaEntitySqlUsageModel.json - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/logbook/FloatingObjectImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/observation/FloatingObjectImpl.hbm.xml - core/persistence/migration/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_3.java - + core/persistence/migration/src/main/resources/db/migration/v9/9.3/04_issue-2877-common.sql - core/persistence/migration/src/main/resources/db/migration/v9/9.3/empty-schema-H2.sql - core/persistence/migration/src/main/resources/db/migration/v9/9.3/empty-schema-PG.sql - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/FloatingObject/validation-create.json - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/FloatingObject/validation-update.json - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/FloatingObject/validation-create.json - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/FloatingObject/validation-update.json - model/src/main/models/Observe/dto/attribute/notNull.properties - model/src/main/models/Observe/persistence/attribute/notNull.properties - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-create-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-create.json - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-update-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-update.json - server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-create-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-create.json - server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-update-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-update.json Changes: ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/FloatingObjectUICommon.jcss ===================================== @@ -194,3 +194,12 @@ i18nProperty:comment; } +#coordinate1Label { + text:"observe.Common.coordinate"; +} + +#coordinate1 { + propertyLatitude:{TransmittingBuoyDto.PROPERTY_LATITUDE}; + propertyLongitude:{TransmittingBuoyDto.PROPERTY_LONGITUDE}; + propertyQuadrant:{TransmittingBuoyDto.PROPERTY_QUADRANT}; +} ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/FloatingObjectUI.jcss deleted ===================================== @@ -1,31 +0,0 @@ -/* - * #%L - * ObServe Client :: DataSource :: Editor :: PS - * %% - * Copyright (C) 2008 - 2023 IRD, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -#coordinate1Label { - text:"observe.Common.coordinate"; -} - -#coordinate1 { - propertyLatitude:{TransmittingBuoyDto.PROPERTY_LATITUDE}; - propertyLongitude:{TransmittingBuoyDto.PROPERTY_LONGITUDE}; - propertyQuadrant:{TransmittingBuoyDto.PROPERTY_QUADRANT}; -} ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/FloatingObjectUI.jcss deleted ===================================== @@ -1,31 +0,0 @@ -/* - * #%L - * ObServe Client :: DataSource :: Editor :: PS - * %% - * Copyright (C) 2008 - 2023 IRD, Ultreia.io - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -#coordinate1Label { - text:"observe.Common.coordinate"; -} - -#coordinate1 { - propertyLatitude:{TransmittingBuoyDto.PROPERTY_LATITUDE}; - propertyLongitude:{TransmittingBuoyDto.PROPERTY_LONGITUDE}; - propertyQuadrant:{TransmittingBuoyDto.PROPERTY_QUADRANT}; -} ===================================== core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json ===================================== @@ -10844,7 +10844,8 @@ { "name": "objectOperation", "comments": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ] }, { @@ -10897,7 +10898,8 @@ { "name": "objectOperation", "comments": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ] }, { @@ -13267,7 +13269,8 @@ { "name": "objectOperation", "comments": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ] }, { @@ -13320,7 +13323,8 @@ { "name": "objectOperation", "comments": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ] }, { ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/FloatingObjectDto-create-error-validation.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation 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/FloatingObjectDto-update-error-validation.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/FloatingObjectDto-create-error-validation.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/FloatingObjectDto-update-error-validation.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java ===================================== @@ -42,6 +42,7 @@ import fr.ird.observe.entities.data.DataEntity; import fr.ird.observe.entities.data.ps.landing.Landing; import fr.ird.observe.entities.data.ps.logbook.Activity; import fr.ird.observe.entities.data.ps.logbook.Route; +import fr.ird.observe.entities.referential.common.DataQuality; import fr.ird.observe.entities.referential.common.Ocean; import fr.ird.observe.entities.referential.common.Species; import fr.ird.observe.entities.referential.common.SpeciesList; @@ -113,17 +114,22 @@ public class TripSpi extends GeneratedTripSpi { } AcquisitionStatus acquisitionStatus = AcquisitionStatus.loadEntity(context, ProtectedIdsPs.PS_COMMON_DEFAULT_ACQUISITION_STATUS_ID); AcquisitionStatus acquisitionStatusDone = AcquisitionStatus.loadEntity(context, ProtectedIdsPs.PS_COMMON_DONE_ACQUISITION_STATUS_ID); - if (preCreated.getObservationsProgram() != null) { + if (preCreated.getObservationsProgram() == null) { + preCreated.setObservationsAcquisitionStatus(acquisitionStatus); + } else { //FIXME Should we add some default values? preCreated.setObservationsAcquisitionStatus(acquisitionStatusDone); - } else { - preCreated.setObservationsAcquisitionStatus(acquisitionStatus); + } - if (preCreated.getLogbookProgram() != null) { - //FIXME Should we add some default values? - preCreated.setLogbookAcquisitionStatus(acquisitionStatusDone); - }else { + if (preCreated.getLogbookProgram() == null) { preCreated.setLogbookAcquisitionStatus(acquisitionStatus); + } else { + preCreated.setLogbookAcquisitionStatus(acquisitionStatusDone); + WellContentStatus wellContentStatus = WellContentStatus.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_DEFAULT_WELL_CONTENT_STATUS_ID); + preCreated.setDepartureWellContentStatus(wellContentStatus); + preCreated.setLandingWellContentStatus(wellContentStatus); + DataQuality dataQuality = DataQuality.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_TRIP_DEFAULT_DATA_QUALITY_ID); + preCreated.setLogbookDataQuality(dataQuality); } preCreated.setTargetWellsSamplingAcquisitionStatus(acquisitionStatus); preCreated.setLandingAcquisitionStatus(acquisitionStatus); @@ -131,10 +137,6 @@ public class TripSpi extends GeneratedTripSpi { preCreated.setLocalMarketWellsSamplingAcquisitionStatus(acquisitionStatus); preCreated.setLocalMarketSurveySamplingAcquisitionStatus(acquisitionStatus); preCreated.setAdvancedSamplingAcquisitionStatus(acquisitionStatus); - - WellContentStatus wellContentStatus = WellContentStatus.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_DEFAULT_WELL_CONTENT_STATUS_ID); - preCreated.setDepartureWellContentStatus(wellContentStatus); - preCreated.setLandingWellContentStatus(wellContentStatus); preCreated.setActivitiesAcquisitionMode(ActivitiesAcquisitionMode.BY_TIME); return super.preCreate(context, preCreated); } ===================================== core/persistence/java/src/main/resources/META-INF/persistence/Observe/TopiaEntitySqlUsageModel.json ===================================== @@ -808,7 +808,7 @@ ] }, "fr.ird.observe.entities.referential.ps.common.ObjectOperation": { - "reverseCompositions": [ + "reverseMandatoryCompositions": [ "fr.ird.observe.entities.data.ps.observation.FloatingObject~objectOperation", "fr.ird.observe.entities.data.ps.logbook.FloatingObject~objectOperation" ] ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/logbook/FloatingObjectImpl.hbm.xml ===================================== @@ -38,7 +38,7 @@ <property name="comment" access="field" type="java.lang.String" length="8192"> <column length="8192" name="comment"/> </property> - <many-to-one name="objectOperation" class="fr.ird.observe.entities.referential.ps.common.ObjectOperationImpl" column="objectOperation" foreign-key="fk_ps_logbook_floatingobject_objectoperation" /> + <many-to-one name="objectOperation" class="fr.ird.observe.entities.referential.ps.common.ObjectOperationImpl" column="objectOperation" foreign-key="fk_ps_logbook_floatingobject_objectoperation" not-null="true" /> <property name="supportVesselName" access="field" type="java.lang.String" length="32"> <column length="32" name="supportVesselName"/> </property> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/observation/FloatingObjectImpl.hbm.xml ===================================== @@ -46,7 +46,7 @@ <key column="floatingObject" foreign-key="fk_ps_observation_floatingobject_objectobservedspecies" not-null="true" /> <one-to-many class="fr.ird.observe.entities.data.ps.observation.ObjectObservedSpeciesImpl"/> </set> - <many-to-one name="objectOperation" class="fr.ird.observe.entities.referential.ps.common.ObjectOperationImpl" column="objectOperation" foreign-key="fk_ps_observation_floatingobject_objectoperation" /> + <many-to-one name="objectOperation" class="fr.ird.observe.entities.referential.ps.common.ObjectOperationImpl" column="objectOperation" foreign-key="fk_ps_observation_floatingobject_objectoperation" not-null="true" /> <property name="supportVesselName" access="field" type="java.lang.String" length="32"> <column length="32" name="supportVesselName"/> </property> ===================================== core/persistence/migration/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_3.java ===================================== @@ -40,7 +40,7 @@ public class DataSourceMigrationForVersion_9_3 extends ByMajorMigrationVersionRe public DataSourceMigrationForVersion_9_3() { super(Version.valueOf("9.3"), false); - createResourceScriptVariables(this, "2024-04-26", "2023-12-01 00:00:00.000000"); + createResourceScriptVariables(this, "2024-04-29", "2023-12-01 00:00:00.000000"); } @Override @@ -53,6 +53,8 @@ public class DataSourceMigrationForVersion_9_3 extends ByMajorMigrationVersionRe executor.addScript("02", "issue-2857"); // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2869 executor.addScript("03", "issue-2869"); + // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2877 + executor.addScript("04", "issue-2877"); } } ===================================== core/persistence/migration/src/main/resources/db/migration/v9/9.3/04_issue-2877-common.sql ===================================== @@ -0,0 +1,23 @@ +--- +-- #%L +-- ObServe Core :: Persistence :: Migration +-- %% +-- Copyright (C) 2008 - 2024 IRD, Ultreia.io +-- %% +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/gpl-3.0.html>. +-- #L% +--- +ALTER TABLE ps_logbook.FloatingObject ALTER COLUMN objectOperation SET NOT NULL; +ALTER TABLE ps_observation.FloatingObject ALTER COLUMN objectOperation SET NOT NULL; ===================================== core/persistence/migration/src/main/resources/db/migration/v9/9.3/empty-schema-H2.sql ===================================== @@ -162,7 +162,7 @@ create table ps_localmarket.surveyPart (topiaId varchar(255) not null, topiaVers create table ps_logbook.activity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), time time, latitude numeric, longitude numeric, latitudeOriginal numeric, longitudeOriginal numeric, originalDataModified boolean default false not null, vmsDivergent boolean default false not null, positionCorrected boolean default false not null, number integer not null, setCount integer, seaSurfaceTemperature numeric, windDirection integer, vesselActivity varchar(255) not null, wind varchar(255), totalWeight numeric, currentSpeed numeric, currentDirection integer, schoolType varchar(255), relatedObservedActivity varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), informationSource varchar(255), reasonForNoFishing varchar(255), setSuccessStatus varchar(255), reasonForNullSet varchar(255), route varchar(255) not null, primary key (topiaId)); create table ps_logbook.activity_observedSystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem)); create table ps_logbook.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), species varchar(255) not null, weightCategory varchar(255), speciesFate varchar(255) not null, weight numeric, count integer, weightMeasureMethod varchar(255), well varchar(255), activity varchar(255) not null, activity_idx integer, primary key (topiaId)); -create table ps_logbook.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255), supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); +create table ps_logbook.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255) not null, supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); create table ps_logbook.floatingObjectPart (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), whenArriving varchar(255), whenLeaving varchar(255), objectMaterial varchar(255) not null, floatingObject varchar(255) not null, primary key (topiaId)); create table ps_logbook.informationSource (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_logbook.route (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), date date not null, timeAtSea integer, fishingTime integer, trip varchar(255) not null, primary key (topiaId)); @@ -184,7 +184,7 @@ create table ps_observation.activity (topiaId varchar(255) not null, topiaVersio create table ps_observation.activity_observedSystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem)); create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, minWeight numeric, meanWeight numeric, maxWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255) not null, species varchar(255) not null, weightMeasureMethod varchar(255), sizeMeasureMethod varchar(255), speciesFate varchar(255) not null, set varchar(255) not null, set_idx integer, primary key (topiaId)); create table ps_observation.detectionMode (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); -create table ps_observation.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255), supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); +create table ps_observation.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255) not null, supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); create table ps_observation.floatingObjectPart (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), whenArriving varchar(255), whenLeaving varchar(255), objectMaterial varchar(255) not null, floatingObject varchar(255) not null, primary key (topiaId)); create table ps_observation.informationSource (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_observation.nonTargetCatchRelease (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), length numeric, count integer not null, brailNumber integer, acquisitionMode integer, species varchar(255) not null, status varchar(255) not null, sex varchar(255) not null, speciesGroupReleaseMode varchar(255) not null, conformity varchar(255), handlingPlace varchar(255), releasingTime varchar(255), sizeMeasureMethod varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); ===================================== core/persistence/migration/src/main/resources/db/migration/v9/9.3/empty-schema-PG.sql ===================================== @@ -162,7 +162,7 @@ create table ps_localmarket.surveyPart (topiaId varchar(255) not null, topiaVers create table ps_logbook.activity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), time time, latitude numeric, longitude numeric, latitudeOriginal numeric, longitudeOriginal numeric, originalDataModified boolean default false not null, vmsDivergent boolean default false not null, positionCorrected boolean default false not null, number integer not null, setCount integer, seaSurfaceTemperature numeric, windDirection integer, vesselActivity varchar(255) not null, wind varchar(255), totalWeight numeric, currentSpeed numeric, currentDirection integer, schoolType varchar(255), relatedObservedActivity varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), informationSource varchar(255), reasonForNoFishing varchar(255), setSuccessStatus varchar(255), reasonForNullSet varchar(255), route varchar(255) not null, primary key (topiaId)); create table ps_logbook.activity_observedSystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem)); create table ps_logbook.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), species varchar(255) not null, weightCategory varchar(255), speciesFate varchar(255) not null, weight numeric, count integer, weightMeasureMethod varchar(255), well varchar(255), activity varchar(255) not null, activity_idx integer, primary key (topiaId)); -create table ps_logbook.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255), supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); +create table ps_logbook.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255) not null, supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); create table ps_logbook.floatingObjectPart (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), whenArriving varchar(255), whenLeaving varchar(255), objectMaterial varchar(255) not null, floatingObject varchar(255) not null, primary key (topiaId)); create table ps_logbook.informationSource (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_logbook.route (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), date date not null, timeAtSea integer, fishingTime integer, trip varchar(255) not null, primary key (topiaId)); @@ -184,7 +184,7 @@ create table ps_observation.activity (topiaId varchar(255) not null, topiaVersio create table ps_observation.activity_observedSystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem)); create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, minWeight numeric, meanWeight numeric, maxWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255) not null, species varchar(255) not null, weightMeasureMethod varchar(255), sizeMeasureMethod varchar(255), speciesFate varchar(255) not null, set varchar(255) not null, set_idx integer, primary key (topiaId)); create table ps_observation.detectionMode (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); -create table ps_observation.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255), supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); +create table ps_observation.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255) not null, supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); create table ps_observation.floatingObjectPart (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), whenArriving varchar(255), whenLeaving varchar(255), objectMaterial varchar(255) not null, floatingObject varchar(255) not null, primary key (topiaId)); create table ps_observation.informationSource (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_observation.nonTargetCatchRelease (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), length numeric, count integer not null, brailNumber integer, acquisitionMode integer, species varchar(255) not null, status varchar(255) not null, sex varchar(255) not null, speciesGroupReleaseMode varchar(255) not null, conformity varchar(255), handlingPlace varchar(255), releasingTime varchar(255), sizeMeasureMethod varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/FloatingObject/validation-create.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/FloatingObject/validation-update.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/FloatingObject/validation-create.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/FloatingObject/validation-update.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== model/src/main/models/Observe/dto/attribute/notNull.properties ===================================== @@ -147,6 +147,7 @@ data.ps.logbook.Activity.attribute.observedSystem=true data.ps.logbook.Activity.attribute.vesselActivity=true data.ps.logbook.Catch.attribute.species=true data.ps.logbook.Catch.attribute.speciesFate=true +data.ps.logbook.FloatingObject.attribute.objectOperation=true data.ps.logbook.FloatingObjectPart.attribute.objectMaterial=true data.ps.logbook.Route.attribute.date=true data.ps.logbook.Sample.attribute.number=true @@ -181,6 +182,7 @@ data.ps.observation.Activity.attribute.vesselActivity=true data.ps.observation.Catch.attribute.informationSource=true data.ps.observation.Catch.attribute.species=true data.ps.observation.Catch.attribute.speciesFate=true +data.ps.observation.FloatingObject.attribute.objectOperation=true data.ps.observation.FloatingObjectPart.attribute.objectMaterial=true data.ps.observation.NonTargetCatchRelease.attribute.count=true data.ps.observation.NonTargetCatchRelease.attribute.sex=true ===================================== model/src/main/models/Observe/persistence/attribute/notNull.properties ===================================== @@ -151,6 +151,7 @@ data.ps.logbook.Activity.attribute.vesselActivity=true data.ps.logbook.Activity.attribute.vmsDivergent=true data.ps.logbook.Catch.attribute.species=true data.ps.logbook.Catch.attribute.speciesFate=true +data.ps.logbook.FloatingObject.attribute.objectOperation=true data.ps.logbook.FloatingObjectPart.attribute.objectMaterial=true data.ps.logbook.Route.attribute.date=true data.ps.logbook.Sample.attribute.number=true @@ -184,6 +185,7 @@ data.ps.observation.Activity.attribute.vesselActivity=true data.ps.observation.Catch.attribute.informationSource=true data.ps.observation.Catch.attribute.species=true data.ps.observation.Catch.attribute.speciesFate=true +data.ps.observation.FloatingObject.attribute.objectOperation=true data.ps.observation.FloatingObjectPart.attribute.objectMaterial=true data.ps.observation.NonTargetCatchRelease.attribute.count=true data.ps.observation.NonTargetCatchRelease.attribute.sex=true ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-create-error.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-create.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-update-error.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/logbook/FloatingObject/validation-update.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-create-error.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-create.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-update-error.xml ===================================== @@ -60,6 +60,11 @@ </field> <field name="objectOperation"> + <!-- objectOperation is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential objectOperation is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/FloatingObject/validation-update.json ===================================== @@ -18,7 +18,8 @@ }, "objectOperation": { "errors": [ - "check if referential objectOperation is disabled (only if validation is strong)" + "check if referential objectOperation is disabled (only if validation is strong)", + "objectOperation is mandatory" ], "warnings": [ "check if referential objectOperation is disabled (only if validation is not strong)" View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/bb506c43d63dc97c1f0db0d39... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/bb506c43d63dc97c1f0db0d39... You're receiving this email because of your account on gitlab.com.