Skip to end of banner
Go to start of banner

Spike: Guarantee of the PO Line status up-to-date

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Requirements  MODORDERS-106 - Getting issue details... STATUS

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:

  • there are pieces related to PO line that are in the RECEIVED and EXPECTED statuses - the PO line must be in the PARTIALLY_RECEIVED status;
  • all pieces are in RECEIVED status - the PO line must be in FULLY_RECEIVED status.

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 check the status of pieces and change the status of the PO line if necessary; “injection-style” mechanism that monitor changes in the status of pieces and change the status of the PO line if necessary.

  1. Scheduled-style mechanism

    This group of approaches is based on periodic scanning of all saved pieces and determining the status of poline on this basis. A typical algorithm for such mechanism might look as shown on Figure 1.

  2. Checking and updating the PO line status upon retrieving

    PostgreSQL Trigger Functions

    Vert.X Periodic Timer

    #_executing_periodic_and_delayed_actions

  3. Interceptor-style mechanisms

    Separate Scheduler Application

    PostgreSQL cron-job

    pg_cron

Solution Proposal

  • No labels