DEV Community

Cover image for The CHED Lifecycle as a State Machine: Five Transitions, One Final State
iCustoms
iCustoms

Posted on

The CHED Lifecycle as a State Machine: Five Transitions, One Final State

Why a state machine is the right mental model

The Common Health Entry Document process is linear, gated, and ends in a terminal state. That makes it a natural fit for a state machine, and modelling it that way exposes exactly where your team has control and where it does not.

The states

  1. Drafting. The operator completes Part 1 in TRACES NT: consignment details, origin, health certificates and establishment approval numbers. Fully mutable.
  2. Submitted. Lodged before arrival, ahead of the border control post's notice period. Still amendable while it remains on your side.
  3. Under control. Documentary checks on all consignments, then identity checks matching seals and labels to paperwork, then risk-based physical checks with sampling.
  4. Decided. The border control post writes Part 2: accepted, accepted with channelling, or refused. Terminal.
  5. Referenced. The CHED reference is quoted in the customs declaration so the goods can be released. Walking through the CHED lifecycle workflow end to end makes clear how little of the process sits after submission.

The transitions that cost you

The drafting to submitted transition is where the notice period bites. Miss it and you are not in a failed state, you are in a waiting state, which is often more expensive.

The under control to decided transition is one way. Refusal branches to re-export, destruction, or supervised transformation, none of which are cheap.

Where to put your effort

Almost all recoverable error lives in the first two states. Build your checks there, not in exception handling. To see pre-submission validation applied to a live consignment, watch a demo.

Top comments (0)