Church Hill Classics DSV Integration - Shopify EDI Processor Changes
Summary
The Shopify EDI processor (P3-EDI-Processor) was modified to support Church Hill Classics (vendor code CHR) as a DSV trading partner. The single material change is a new vendor-specific PO number format. No changes were required on the inbound 855/856/810 parsing side; round-trip lookup continues to use the existing OrderShopMapping table.
New DSV PO Number Format for Church Hill
Format: 10 numeric digits, no letters, no separators.
Construction:
- Take the customer-facing Shopify order name (the number after the
#, e.g.#18071155->18071155). - Reduce it to a 9-digit base:
- If shorter than 9 digits, left-pad with zeros.
- If longer than 9 digits, take the rightmost 9 digits (preserves the most recent entropy).
- Append a 1-digit vendor-group suffix (defaults to
1; increments when an order splits across multiple vendors). Suffixes greater than 9 are clamped to 9; in practice splits never exceed 9 vendor groups. - Concatenate base + suffix = 10-digit PO.
Worked examples:
| Shopify order name | Vendor group | CHR PO |
|---|---|---|
#18071155 | 1 | 0180711551 |
#18071155 | 2 | 0180711552 |
#1234567 | 1 | 0012345671 |
#1234567890 | 1 | 2345678901 |
For comparison, the default PO format (used by all other DSV vendors) is E{shopifyOrderId}-{groupIndex} (e.g. E6373785665721-1), capped at 16 characters.
Design Changes in the Codebase
-
Vendor allowlist for numeric-only POs. A new constant
NUMERIC_PO_VENDORS(a Set keyed by vendorsupplierId) was added to the central PO-builder module. CHR is currently the only member. Adding another numeric-PO vendor in the future is a one-line addition. -
Vendor-aware PO builder. The existing
buildPONumber()function now accepts an optional{ orderName, vendorCode }context. When the vendor matches the allowlist, it routes to a newbuildNumericPONumber()helper that produces the 10-digit format; for all other vendors the existing E-prefix (or D-prefix) behavior is preserved verbatim. Non-CHR PO output is byte-for-byte unchanged. -
Vendor + order-name plumbed through the 850 pipeline. Both 850 entry points pass the new context through:
- The OMS 850 generator (the fixed-width file format Church Hill consumes), which previously rebuilt the PO internally without vendor awareness. The generator now reads vendor code from
data.vendor.tpCodeand order name fromdata.header.webOrderNumberand forwards them to the PO builder. - The EDI 850 (X12) generator path, for consistency, even though Church Hill primarily consumes the OMS format.
- The OMS 850 generator (the fixed-width file format Church Hill consumes), which previously rebuilt the PO internally without vendor awareness. The generator now reads vendor code from
-
OMS 850 fixed-width record unchanged. Church Hill's file layout (HDR/BIT/SHT/SOT/RET/DTL lines, byte positions) is unchanged. Only the value written to HDR positions 12-33 (the PO field, 22 chars total) is shorter; the 10-character PO is right-padded with spaces so every downstream column still starts at its original byte offset.
-
SFTP filename format unchanged. Files continue to follow the
850oms.CRH.{PO}.{date}.txtpattern; the new PO simply slots into the PO segment.