slpa: add the Electronic Cargo Declaration Note (ECDN) submission flow - #26
slpa: add the Electronic Cargo Declaration Note (ECDN) submission flow#26Aravinda-HWK wants to merge 5 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Suggest
- Harden approval/invoice gateways: make sure
decision/paymentnamespaces always exist, or restructure conditions like SLTB #38 (first-pass edge using only known namespaces + unconditional fallback) - Correct the PR description to reflect the full 4-step flow and list all engine dependencies
Or split into smaller PRs: merge ECDN-only (step 1) once engine #345 is deployed, then follow with service order / approval / payment artifacts as their engine PRs land. That will match what is described in the current PR description
b5dc94a to
5ae83cb
Compare
|
Superseded — folded into #41, which now carries the full SLPA ECDN + consolidation + gate pass flow as a single PR against main. |
5ae83cb to
158ebfd
Compare
The trader fills the ECDN form, NSW renders it as the XML SLPA's Cargo Management System expects, and uploads it. SLPA is the system of record for the declaration, so the flow ends once the CMS accepts it; a rejection returns the trader to the form with the CMS's own reasons. The form mirrors SLPA's own ECDN form at mpma.slpa.lk/ecdn field for field, including its code lists (35 customs offices, 6 terminals, 24 package types, FCL/LCL) and the repeating container table. The 18 fields SLPA marks mandatory are required here; the rest stay optional as they are there. SLPA identifies the submitting company by a key it issues per registered company, so the flow reads it from the company profile the workflow carries: the split that spawns an agency flow puts the company in the branch payload, and the mapping here picks out the key. Nothing about the key is hardcoded. Also adds the flow to the HS-code picker, and regenerates the selection summary from that picker's own option list — the two had drifted, so the CDA ASYCUDA approval flow was rendering in the summary as a bare id.
…ce order workflows
…h associated templates and messages
158ebfd to
905111c
Compare
Draft: do not merge before OpenNSW/nsw-srilanka#322 is merged and deployed. These artifacts reference the
SLPA_ECDN_UPLOADtask type, and an artifact naming a task type the deployment does not have fails at runtime — the activity retriesartifact not foundindefinitely rather than failing loudly.Adds the SLPA leg of the export flow: the trader fills the ECDN form, NSW renders it as the XML SLPA's Cargo Management System expects, and uploads it. SLPA is the system of record for the declaration, so the flow ends once the CMS accepts it; a rejection returns the trader to the form with the CMS's own reasons, shown by the
cig_rejection-style markdown section.Shape
1-ecdn_submission/carries the task template, the two subtasks (USER_INPUT,SLPA_ECDN_UPLOAD), the render config, the completion message and the rejection template.The form
userinput_jsonform.jsonmirrors SLPA's own ECDN form atmpma.slpa.lk/ecdnfield for field, so a trader filling this and a clerk filling theirs produce the same declaration. That includes their code lists verbatim — 35 customs office codes, 6 terminals (JCT/CICT/SAGT/UCT/ECT/CWIT), 24 package types, FCL/LCL — and the repeating container table (type, size, seal, mark, commodity). The 18 fields SLPA marks mandatory arerequiredhere; the rest stay optional, as they are there.Fields SLPA's XML derives rather than collects are not asked for:
CusDecSerialis composed from the office, declaration number and year, and the container key from the declaration and date.Company identity
SLPA identifies the submitting company by the
slpacmsuser-keyit issues per registered company. That is not configuration here — it rides the consignment:A branch child starts with only its iteration context, so anything an agency flow needs has to be placed in the split item payload. The builder carries the company verbatim, so another agency wanting a different field is a mapping change here rather than a code change.
Also in this PR
The flow is added to the HS-code picker as SLPA Electronic Cargo Declaration Note (SLPA Flow), placed next to Customs since the ECDN quotes the CusDec.
summary_markdown.jsonis regenerated from the picker's own option list. The two had drifted independently: the summary never learnedcda-kernel-asycuda-approval, so that flow rendered as a bare id instead of its name. Generating from the picker keeps them from disagreeing again.Checks run
task_template, micro nodes →subtask_template,SPLIT_TASK→ a registeredworkflow), and no edge points at an undeclared node.constresolves to a registered workflow — the check that catches a selectable flow that would die at runtime.Known gaps
SLPA has not published the XSD, so the document shape rests on one reference file their generator produced. Worth diffing against the schema if they share it.
Their CMS currently fails inserting containers (
Unknown column 'ISOType'), which blocks the last step of a real submission — see OpenNSW/nsw-srilanka#322 for the detail. The flow reaches that point correctly.