Skip to content

ASN Sandbox

This document describes the sandbox scenario for ASN, as implemented in the ASNSandbox class.

When an ASN is created, the sandbox automatically marks it as accepted, sets progress to finished, and creates a final GRN entity derived from ASN logistics units.

Trigger:

  • default

Result:

  • Received status: ACCEPTED
  • providerReference: ASN-REF-<asn_id>
  • Progress status: FINISHED
  • GRN entity created at grn/<asn_id>-final with:
    • receiptedAt: current timestamp
    • stockIssues, logisticsUnitIssues, deliveryIssues, unidentifiedStockIssues: empty arrays
    • logisticsUnits: mapped from ASN logistics units
    • Each ASN line mapped to GRN line with:
      • received_quantity = ASN line quantity
      • expected_quantity = ASN line quantity
      • received_batch copied from ASN line batch_number
      • received_batch_expiry copied from ASN line batch_expiry
      • condition copied from ASN line condition (defaults to GOOD when null)