Skip to content

Add EDI document 947 support (RSX v.7.1.0)#5

Merged
colinmollenhour merged 7 commits intomainfrom
add-edi-document-947
Mar 31, 2026
Merged

Add EDI document 947 support (RSX v.7.1.0)#5
colinmollenhour merged 7 commits intomainfrom
add-edi-document-947

Conversation

@colinmollenhour
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 31, 2026 16:20
@colinmollenhour colinmollenhour merged commit 9302df1 into main Mar 31, 2026
2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json and generated src/RSX/v710/WarehouseInventoryAdjustmentAdvices/* PHP models.
  • Added sample-files/WarehouseInventoryAdjustmentAdvices(947)/947_Sample.json as an example payload.
  • Updated generate.sh to generate for both v710 and v777, 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.

Comment thread generate.sh
Comment on lines +31 to +35
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"}]
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
"TradingPartnerId" : "",
"DocumentId" : "",
"RecordType" : "",
"NoteInformationField" : "String"
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"NoteInformationField" : "String"
"NoteInformationField" : [ "String" ]

Copilot uses AI. Check for mistakes.
"PartDescription2" : "String",
"AdjReasonCode" : "AA",
"QtyAdjusted" : 0.0,
"QtyAdjustedUOM" : "DZ",
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"QtyAdjustedUOM" : "DZ",
"QtyAdjustedUOM" : "EA",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants