Test Guide — Flow A
Purpose
Verify that uploading a CIMA Lorry In/Out Report file correctly parses the data, populates CimaDeliveryInfo, and updates the associated Order fields.
Prerequisites
- A valid CIMA Lorry In/Out Report file (correct format)
- An existing Order with matching
saleOrderNo or deliveryOrderNumber
- An
OrderDocument with autoUpdateFor = CIMA linked to the order
- Access to the database to verify results
Steps to Run
- Upload the CIMA Lorry In/Out Report file via API
- Confirm a
MicroserviceTask is created with code = Process CIMA Lorry In_Out Report and status = Pending
- Wait for
processCimaLorryInoutReports cron to run (every 2 hours) — or manually set task status to Pending and wait
- Confirm task status changes to
Running then Success
- Wait for
autoUpdateCIMASupplierDataBySupplierData cron to run (every 10 minutes)
- Confirm order fields are updated
What to Check
After File Upload
| Table |
Field |
Expected |
microservice_task |
code |
Process CIMA Lorry In_Out Report |
microservice_task |
status |
Pending |
microservice_task |
value |
{ cima_lorry_in_out_report_id: <id> } |
After processCimaLorryInoutReports Runs
| Table |
Field |
Expected |
microservice_task |
status (Process task) |
Success |
cima_delivery_info |
status |
Pending (newly created records) |
cima_delivery_info |
delivery_order_number |
Matches DO# in uploaded file |
cima_delivery_info |
plate_no |
Matches plate in uploaded file |
microservice_task |
code (new task) |
Auto Update CIMA Supplier Data By Supplier Data |
microservice_task |
status (new task) |
Pending |
After autoUpdateCIMASupplierDataBySupplierData Runs
| Table |
Field |
Expected |
cima_delivery_info |
status |
Completed |
order |
actual_loaded_quantity |
= cimaInfo.netWeight |
order |
gross_weight |
= cimaInfo.grossWeight |
order |
net_weight |
= cimaInfo.netWeight |
order |
tare_weight |
= cimaInfo.tareWeight |
order |
seal_number |
= cimaInfo.sealNo |
order |
supplier_do_datetime |
= cimaInfo.deliveryDatetime |
order |
supplier_do_plate_no |
= cimaInfo.plateNo |
order |
delivery_order_number |
= cimaInfo.deliveryOrderNumber |
order |
send_to |
Unchanged from original value |
order_document |
document_status |
Auto Approved (if was Pending Auto Update (CIMA)) |
order_job_tracking_log |
action |
CIMA Supplier Data Auto Update by Supplier Data |
microservice_task |
status (By Supplier Data task) |
Success |
Common Failure Scenarios
| Symptom |
Likely Cause |
processCimaLorryInoutReports task stays Running |
CimaLorryInOutReport record not found — check cima_lorry_in_out_report_id in task value |
cima_delivery_info records not created |
File parsing failed — check error logs for processCimaLorryInOutReport |
Order not updated, task still Success |
No matching OrderDocument found for DO# + plateNo + autoUpdateFor = CIMA |
Order not updated, documentStatus mismatch |
OrderDocument.documentStatus not in allowed list (Approved, Auto Approved, Pending Auto Update (CIMA)) |
cima_delivery_info delivery_datetime older than 1 month |
Record filtered out — update delivery_datetime to within last month |