Skip to main content

Test Guide — Flow B

Purpose

Verify that uploading an OCR-processed Order Document with autoUpdateFor = CIMA correctly triggers the CIMA supplier data sync and updates the associated Order fields.


Prerequisites

  • An existing Order with autoUpdateFor = CIMA on its OrderDocument
  • A matching CimaDeliveryInfo record where deliveryOrderNumber = OrderDocument.referenceKey AND plateNo = OrderDocument.plateNo
  • The Order's saleOrderNo must match the uploaded document's SO#
  • Access to the database to verify results

Steps to Run

  1. Upload the Order Document (OCR processed) via API
  2. Confirm OrderDocument.documentStatus is set to Pending Auto Update (CIMA)
  3. Confirm a MicroserviceTask is created with code = Auto Update CIMA Supplier Data and status = Pending
  4. Wait for autoUpdateCIMASupplierData cron to run (every 3 minutes)
  5. Confirm order fields are updated and task status is Success

What to Check

After Document Upload (OCR Processed)

Table Field Expected
order_document document_status Pending Auto Update (CIMA)
microservice_task code Auto Update CIMA Supplier Data
microservice_task status Pending
microservice_task value { orderDocumentId: <id>, documentStatus: "Pending Auto Update (CIMA)" }

If SO# does not match the order's saleOrderNo → document_status will be Auto Rejected and no task is created.

After autoUpdateCIMASupplierData Runs

Table Field Expected
microservice_task status Success
order_document document_status Auto Approved
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
cima_delivery_info status Completed
cima_delivery_info sale_order_no Backfilled from order.saleOrderNo (only if was null)
order_job_tracking_log action CIMA Supplier Data Auto Update

Common Failure Scenarios

Symptom Likely Cause
document_status stays Pending Auto Update (CIMA), task not created Check autoUpdateFor field on OrderDocument — must be CIMA
Task status Fail, order not updated Error in cron — check logs for autoUpdateCIMASupplierData
CimaDeliveryInfo not found No record matching deliveryOrderNumber + plateNo — verify OrderDocument.referenceKey and plateNo match a CimaDeliveryInfo row
OrderDocument not found orderDocumentId in task payload is invalid or record deleted
Order send_to changed unexpectedly Should not happen after fix — verify no other process is overwriting it