-
Notifications
You must be signed in to change notification settings - Fork 1
Importing Order Feed
A scheduled job will be responsible to fetch the brokered orders feed file from the SFTP server,
- Moqui SFTP supports this through the poll#SystemMessageSftp service. We need to provide the receiveUrl, hostname, username, and password
- Create a systemMessageType specifically for the fulfillment, with consumer service and incoming message receive service receive#IncomingSystemMessage
- Create service job data
- Implement the consumer service
- this service reads the file content and invokes the service that creates order and related entities in the system.
Sample feed file
[ { "orderName": "SMUS#12369", "currencyUom": "USD", "salesChannelEnumId": "", "placedDate": "2023-03-07T05:57:20-05:00", "externalOrderId": "40531", "customer_details": { "customerPartyId": "45110", "firstName" : "Test", "lastName" : "Thomas" }, "shipping_details": { "address": { "toName": "Test Thomas", "address1": "465 North 100 West", "address2": "", "city": "Redmond", "stateProvinceGeoId": "UT", "countryGeoId": "USA", "postalCode": "84652" }, "phone": { "countryCode": "+91", "areaCode": "24234", "contactNumber": "23432" } }, "orderItems": [ { "productStoreId": "SM_STORE", "orderId": "40531", "orderName": "SMUS#12369", "orderDate": "2023-03-07T05:57:20-05:00", "orderStatusId": "ORDER_APPROVED", "entryDate": "2023-03-07T05:57:47-05:00", "currency": "USD", "grandTotal": 54.95, "orderItemSeqId": "00101", "itemStatusId": "ITEM_APPROVED", "quantity": 1, "unitPrice": 54.95, "orderItemExternalId": "12248387649607", "shipGroupSeqId": "00003", "shipmentMethodTypeId": "STANDARD", } ] } ]
OrderHeader | Field |
---|---|
orderId | FM123 (auto-generated) |
orderName | SM_123 |
placedDate | 2022-06-01 18:29 |
statusId | ORDER_CREATED |
currencyUomId | USD |
productStoreId | 9000 |
externalId | ABC123 |
grandTotal | 23.6 |
completedDate | |
firstName | Test |
lastName | Thomas |
address1 | 11 Walepole Steet |
city | Dover |
state | MA |
countryGeoId | USA |
zipcode | 02030 |
countryCode | +1 |
areaCode | 24234 |
contactNumber | 24234 |
OrderItemShipGroup | Field |
---|---|
orderId | FM123 |
shipGroupSeqId | 0001 |
shipmentMethodTypeId | STANDARD |
facilityId | 9000 |
OrderItem | Field |
---|---|
orderId | FM123 |
orderItemSeqId | 0001 |
shipGroupSeqId | 0001 |
externalSeqId | 00101 |
statusId | ITEM_CREATED |
productId | 10000 |
quantity | 1 |
itemDescription | 2750 FRANELAWOOLW OLIVE |
Note:
- Additional product details like weight, color, size, length, and height will be fetched from the search documents.
- Since we are exploding the order items, we will always get 1 quantity per item
- Create 1 ship group per line item