Original Problem

...

Requirements 
Jira Legacy
serverSystem Jira
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId01505d01-b853-3c2e-90f1-ee9b165564fc
keyMODORDERS-106

The last step in receiving/check-in flow is to update the status of PO

...

Line to "Partially Received" or "Fully Received". It's possible that something may go wrong and status won't be updated even though the items were actually received.
So the mechanism to guarantee the status is up-to-date needs to be worked out.

Investigation

From the technical side, this means that there may be a discrepancy between the status of the PO line and the statuses of its associated Pieces in the database. The following connections are possible between PO line with PARTIALLY_RECEIVED and FULLY_RECEIVED statuses and state of pieces:

...

Thus, the task is to create a mechanism that would allow changing the status of the PO line when the status of its associated pieces changes.

...

 

Two types of approaches can be offered - "scheduled-style" mechanism that checks check the status of pieces and change the status of the PO line if necessary; “interceptor-style” mechanism that monitor changes in the status of pieces and change the status of the PO line if necessary.

Checking and updating the PO line status upon retrieving

...

PostgreSQL Trigger Functions

Vert.X Periodic Timer

#_executing_periodic_and_delayed_actions

PostgreSQL cron-job

pg_cron

...

Solution Proposal