Add EDI document 947 support (RSX v.7.1.0)#5
Conversation
There was a problem hiding this comment.
Pull request overview
Adds RSX v7.1.0 support for the EDI 947 “Warehouse Inventory Adjustment Advice” document by introducing the v710 JSON schema, generated PHP RSX model classes, and a sample payload, plus updating the generator script to handle both v710 and v777.
Changes:
- Added
json-schema/v710/WarehouseInventoryAdjustmentAdvices.jsonand generatedsrc/RSX/v710/WarehouseInventoryAdjustmentAdvices/*PHP models. - Added
sample-files/WarehouseInventoryAdjustmentAdvices(947)/947_Sample.jsonas an example payload. - Updated
generate.shto generate for bothv710andv777, including a patching step to wrap v710 schemas into a definitions block for codegen.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceSummary.php | Adds v710 Summary model for 947. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceMeta.php | Adds v710 Meta model for 947. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsReferenceItems.php | Adds line-item reference model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsMiscellaneousItems.php | Adds line-item miscellaneous model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsItemDetail.php | Adds line-item detail model (incl. enums/required fields). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsDateItems.php | Adds line-item date model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsAddressItemsReferenceItems.php | Adds address reference model (line-item level). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsAddressItemsReferenceIdentificationsItems.php | Adds address reference identifications model (line-item level). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsAddressItemsDateItems.php | Adds address date model (line-item level). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsAddressItemsContactItems.php | Adds address contact model (line-item level). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItemsAddressItems.php | Adds address container model (line-item level). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItemsLineItemItems.php | Adds line-item container model (ItemDetail + subcollections). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceLineItems.php | Adds LineItems container model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderReferenceItems.php | Adds header reference model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderNotesItems.php | Adds header notes model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderMiscellaneousItems.php | Adds header miscellaneous model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderHeaderOrder.php | Adds HeaderOrder model (core header fields). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderDateItems.php | Adds header date model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderContactItems.php | Adds header contact model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderAddressItemsReferenceItems.php | Adds header address reference model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderAddressItemsReferenceIdentificationsItems.php | Adds header address reference identifications model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderAddressItemsDateItems.php | Adds header address date model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderAddressItemsContactItems.php | Adds header address contact model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeaderAddressItems.php | Adds header address container model. |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdviceHeader.php | Adds Header container model (HeaderOrder + subcollections). |
| src/RSX/v710/WarehouseInventoryAdjustmentAdvices/WarehouseInventoryAdjustmentAdvice.php | Adds top-level 947 document model (Meta/Header/LineItems/Summary). |
| sample-files/WarehouseInventoryAdjustmentAdvices(947)/947_Sample.json | Adds example 947 JSON payload (currently mismatches schema in a couple places). |
| json-schema/v710/WarehouseInventoryAdjustmentAdvices.json | Adds v710 JSON schema for 947. |
| generate.sh | Updates generator to run for v710 + v777 and patch v710 schemas for codegen. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [[ "$version" == "v710" ]]; then | ||
| # Older schema format without definitions block — use a patch to wrap it | ||
| patch=$(mktemp -p .) | ||
| cat > "$patch" <<PATCH | ||
| [{"op":"add","path":"/definitions","value":{"$class":{"type":"object"}}},{"op":"copy","from":"/properties","path":"/definitions/$class/properties"},{"op":"copy","from":"/required","path":"/definitions/$class/required"}] |
There was a problem hiding this comment.
The temp patch file is created via mktemp -p . and then deleted only after the docker run completes. On systems with BSD mktemp (e.g., macOS), mktemp -p . without a template can fail, and with set -e the rm -f will be skipped if generation errors, leaving stray temp files. Use a portable mktemp invocation (with an explicit template) and register an EXIT trap to ensure the temp file is always cleaned up.
| "TradingPartnerId" : "", | ||
| "DocumentId" : "", | ||
| "RecordType" : "", | ||
| "NoteInformationField" : "String" |
There was a problem hiding this comment.
This sample uses a string for NoteInformationField, but the schema defines Header.Notes[].NoteInformationField as an array of strings (maxItems=2). Update the sample to provide an array so it validates against the schema and matches the generated PHP model.
| "NoteInformationField" : "String" | |
| "NoteInformationField" : [ "String" ] |
| "PartDescription2" : "String", | ||
| "AdjReasonCode" : "AA", | ||
| "QtyAdjusted" : 0.0, | ||
| "QtyAdjustedUOM" : "DZ", |
There was a problem hiding this comment.
QtyAdjustedUOM in the sample is set to "DZ", but the schema (and generated PHP enum) only allows EA or CA. Either change the sample to an allowed value or expand the schema enum if DZ is intended to be supported.
| "QtyAdjustedUOM" : "DZ", | |
| "QtyAdjustedUOM" : "EA", |
No description provided.