-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UNIONVMS-4660] added creationDate rules for movements
- Loading branch information
Showing
17 changed files
with
549 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
LIQUIBASE/changelog/v3.4/db-changelog-UNIONVMS-4660.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
<changeSet id="UNIONVMS-4660-template-for-MovementRules" author="nomikosi"> | ||
<insert tableName="template"> | ||
<column name="template_id" value="36" /> | ||
<column name="template_name" value="Movement report document" /> | ||
<column name="fact_template" value="MOVEMENT_REPORT_DOCUMENT" /> | ||
</insert> | ||
|
||
<rollback> | ||
<delete tableName="template"> | ||
<where>template_id = 36</where> | ||
</delete> | ||
</rollback> | ||
</changeSet> | ||
|
||
<changeSet id="UNIONVMS-4660-update-MO-R01-00-0001" author="nomikosi"> | ||
<insert tableName="rule"> | ||
<column name="template_id" value="36" /> | ||
<column name="property_names" value="creationDateTime" /> | ||
<column name="note" value="Check presence. Must be present." /> | ||
<column name="level" value="L00" /> | ||
<column name="error_type" value="ERROR" /> | ||
<column name="disabled" value="false" /> | ||
<column name="br_id" value="MO-R01-00-0001" /> | ||
<column name="rule_id" value="700"/> | ||
</insert> | ||
<insert tableName="context_expression"> | ||
<column name="expression" value="creationDateTime == null "/> | ||
<column name="failure_message" value="Message creation date/time missing."/> | ||
<column name="context" value="EU"/> | ||
<column name="rule_id" value="700"/> | ||
<column name="id" value="700"/> | ||
</insert> | ||
|
||
<rollback> | ||
<delete tableName="context_expression"> | ||
<where>rule_id = 700</where> | ||
</delete> | ||
<delete tableName="rule"> | ||
<where>br_id = 'MO-R01-00-0001'</where> | ||
</delete> | ||
</rollback> | ||
</changeSet> | ||
|
||
<changeSet id="UNIONVMS-4660-update-MO-R01-00-0002" author="nomikosi"> | ||
<insert tableName="rule"> | ||
<column name="template_id" value="36" /> | ||
<column name="property_names" value="creationDateTime" /> | ||
<column name="note" value="Format must be date in UTC according to ISO8601" /> | ||
<column name="level" value="L01" /> | ||
<column name="error_type" value="ERROR" /> | ||
<column name="disabled" value="false" /> | ||
<column name="br_id" value="MO-R01-00-0002" /> | ||
<column name="rule_id" value="701"/> | ||
</insert> | ||
<insert tableName="context_expression"> | ||
<column name="expression" value="!isEmpty(creationDateTimeString) && !isIsoDateStringValidFormat(creationDateTimeString)"/> | ||
<column name="failure_message" value="Invalid message creation date/time."/> | ||
<column name="context" value="EU"/> | ||
<column name="rule_id" value="701"/> | ||
<column name="id" value="701"/> | ||
</insert> | ||
|
||
<rollback> | ||
<delete tableName="context_expression"> | ||
<where>rule_id = 701</where> | ||
</delete> | ||
<delete tableName="rule"> | ||
<where>br_id = 'MO-R01-00-0002'</where> | ||
</delete> | ||
</rollback> | ||
</changeSet> | ||
|
||
<changeSet id="UNIONVMS-4660-update-MO-R01-00-0003" author="nomikosi"> | ||
<insert tableName="rule"> | ||
<column name="template_id" value="36" /> | ||
<column name="property_names" value="creationDateTime" /> | ||
<column name="note" value="A threshold to compensate for incorrect clock synchronization of the exchanging systems must be taken into account." /> | ||
<column name="level" value="L03" /> | ||
<column name="error_type" value="WARNING" /> | ||
<column name="disabled" value="false" /> | ||
<column name="br_id" value="MO-R01-00-0003" /> | ||
<column name="rule_id" value="702"/> | ||
</insert > | ||
<insert tableName="context_expression"> | ||
<column name="expression" value="creationDateTime != null && dateNotInPast(creationDateTime, 10)"/> | ||
<column name="failure_message" value="Message creation date/time not in the past."/> | ||
<column name="context" value="EU"/> | ||
<column name="rule_id" value="702"/> | ||
<column name="id" value="702"/> | ||
</insert > | ||
|
||
<rollback> | ||
<delete tableName="context_expression"> | ||
<where>rule_id = 702</where> | ||
</delete> | ||
<delete tableName="rule"> | ||
<where>br_id = 'MO-R01-00-0003'</where> | ||
</delete> | ||
</rollback> | ||
</changeSet> | ||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.