@things-factory/operato-hub 4.3.669 → 4.3.671
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.development.js +20 -12
- package/openapi/v1/inbound.yaml +12 -1
- package/openapi/v1/outbound.yaml +11 -1
- package/openapi/v1/upload-attachments.yaml +83 -0
- package/package.json +45 -45
- package/server/routers/api/restful-apis/v1/middlewares/validation-middleware.ts +95 -0
- package/server/routers/api/restful-apis/v1/utils/params.ts +7 -3
- package/server/routers/api/restful-apis/v1/warehouse/add-inbound-order.ts +22 -2
- package/server/routers/api/restful-apis/v1/warehouse/add-release-order.ts +23 -2
- package/server/routers/api/restful-apis/v1/warehouse/index.ts +2 -1
- package/server/routers/api/restful-apis/v1/warehouse/upload-attachments.ts +113 -0
- package/dist-server/controllers/bizplace-initializer/codes.js +0 -21
- package/dist-server/controllers/bizplace-initializer/codes.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/dataset/codes.js +0 -403
- package/dist-server/controllers/bizplace-initializer/dataset/codes.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/dataset/groups.js +0 -24
- package/dist-server/controllers/bizplace-initializer/dataset/groups.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/dataset/index.js +0 -22
- package/dist-server/controllers/bizplace-initializer/dataset/index.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/dataset/menus.js +0 -504
- package/dist-server/controllers/bizplace-initializer/dataset/menus.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/dataset/roles-privileges.js +0 -406
- package/dist-server/controllers/bizplace-initializer/dataset/roles-privileges.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/dataset/settings.js +0 -112
- package/dist-server/controllers/bizplace-initializer/dataset/settings.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain-roles.js +0 -26
- package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain-roles.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain.js +0 -43
- package/dist-server/controllers/bizplace-initializer/generate-bizplace-domain.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/groups.js +0 -18
- package/dist-server/controllers/bizplace-initializer/groups.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/index.js +0 -22
- package/dist-server/controllers/bizplace-initializer/index.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/menus.js +0 -28
- package/dist-server/controllers/bizplace-initializer/menus.js.map +0 -1
- package/dist-server/controllers/bizplace-initializer/settings.js +0 -16
- package/dist-server/controllers/bizplace-initializer/settings.js.map +0 -1
- package/dist-server/controllers/company-initializer/business-register.js +0 -48
- package/dist-server/controllers/company-initializer/business-register.js.map +0 -1
- package/dist-server/controllers/company-initializer/codes.js +0 -137
- package/dist-server/controllers/company-initializer/codes.js.map +0 -1
- package/dist-server/controllers/company-initializer/generate-company-roles.js +0 -117
- package/dist-server/controllers/company-initializer/generate-company-roles.js.map +0 -1
- package/dist-server/controllers/company-initializer/index.js +0 -23
- package/dist-server/controllers/company-initializer/index.js.map +0 -1
- package/dist-server/controllers/company-initializer/menus.js +0 -348
- package/dist-server/controllers/company-initializer/menus.js.map +0 -1
- package/dist-server/controllers/company-initializer/settings.js +0 -36
- package/dist-server/controllers/company-initializer/settings.js.map +0 -1
- package/dist-server/controllers/company-initializer/transporter.js +0 -18
- package/dist-server/controllers/company-initializer/transporter.js.map +0 -1
- package/dist-server/controllers/index.js +0 -1
- package/dist-server/controllers/index.js.map +0 -1
- package/dist-server/controllers/invitation.js +0 -118
- package/dist-server/controllers/invitation.js.map +0 -1
- package/dist-server/controllers/utils/make-invitation-token.js +0 -12
- package/dist-server/controllers/utils/make-invitation-token.js.map +0 -1
- package/dist-server/controllers/utils/save-invitation-token.js +0 -13
- package/dist-server/controllers/utils/save-invitation-token.js.map +0 -1
- package/dist-server/entities/email-attachment.js +0 -81
- package/dist-server/entities/email-attachment.js.map +0 -1
- package/dist-server/entities/email-recipient.js +0 -69
- package/dist-server/entities/email-recipient.js.map +0 -1
- package/dist-server/entities/email.js +0 -98
- package/dist-server/entities/email.js.map +0 -1
- package/dist-server/entities/index.js +0 -11
- package/dist-server/entities/index.js.map +0 -1
- package/dist-server/errors/index.js +0 -18
- package/dist-server/errors/index.js.map +0 -1
- package/dist-server/errors/validation-error.js +0 -14
- package/dist-server/errors/validation-error.js.map +0 -1
- package/dist-server/graphql/index.js +0 -33
- package/dist-server/graphql/index.js.map +0 -1
- package/dist-server/graphql/resolvers/email/index.js +0 -6
- package/dist-server/graphql/resolvers/email/index.js.map +0 -1
- package/dist-server/graphql/resolvers/email/send-emails.js +0 -263
- package/dist-server/graphql/resolvers/email/send-emails.js.map +0 -1
- package/dist-server/graphql/resolvers/generators/generate-bizplace.js +0 -39
- package/dist-server/graphql/resolvers/generators/generate-bizplace.js.map +0 -1
- package/dist-server/graphql/resolvers/generators/generate-company.js +0 -62
- package/dist-server/graphql/resolvers/generators/generate-company.js.map +0 -1
- package/dist-server/graphql/resolvers/generators/index.js +0 -8
- package/dist-server/graphql/resolvers/generators/index.js.map +0 -1
- package/dist-server/graphql/resolvers/generators/update-domain-extType.js +0 -45
- package/dist-server/graphql/resolvers/generators/update-domain-extType.js.map +0 -1
- package/dist-server/graphql/resolvers/index.js +0 -35
- package/dist-server/graphql/resolvers/index.js.map +0 -1
- package/dist-server/graphql/resolvers/invitations/index.js +0 -6
- package/dist-server/graphql/resolvers/invitations/index.js.map +0 -1
- package/dist-server/graphql/resolvers/invitations/partner-invitation.js +0 -52
- package/dist-server/graphql/resolvers/invitations/partner-invitation.js.map +0 -1
- package/dist-server/graphql/resolvers/oauth2/company-roles-by-scope.js +0 -30
- package/dist-server/graphql/resolvers/oauth2/company-roles-by-scope.js.map +0 -1
- package/dist-server/graphql/resolvers/oauth2/index.js +0 -6
- package/dist-server/graphql/resolvers/oauth2/index.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/admiral-asn-report.js +0 -127
- package/dist-server/graphql/resolvers/reports/admiral-asn-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/asn-report.js +0 -126
- package/dist-server/graphql/resolvers/reports/asn-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/custom/elccl/aging-report.js +0 -157
- package/dist-server/graphql/resolvers/reports/custom/elccl/aging-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/custom/elccl/custom-elccl-fn-dispatch-report.js +0 -74
- package/dist-server/graphql/resolvers/reports/custom/elccl/custom-elccl-fn-dispatch-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/custom/elccl/custom-elccl-fn-monthly-dispatch-report.js +0 -99
- package/dist-server/graphql/resolvers/reports/custom/elccl/custom-elccl-fn-monthly-dispatch-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/custom/elccl/export-report.js +0 -156
- package/dist-server/graphql/resolvers/reports/custom/elccl/export-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/custom/posmy/custom-posmy-aging-report.js +0 -131
- package/dist-server/graphql/resolvers/reports/custom/posmy/custom-posmy-aging-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/custom/yltc/custom-yltc-inventory-report.js +0 -216
- package/dist-server/graphql/resolvers/reports/custom/yltc/custom-yltc-inventory-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +0 -189
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/index.js +0 -17
- package/dist-server/graphql/resolvers/reports/index.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +0 -231
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/receiving-report.js +0 -103
- package/dist-server/graphql/resolvers/reports/receiving-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/shortage-report.js +0 -164
- package/dist-server/graphql/resolvers/reports/shortage-report.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/auto-update-all-marketplace-product-variation-quantity.js +0 -187
- package/dist-server/graphql/resolvers/synchronization/auto-update-all-marketplace-product-variation-quantity.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/create-dat-shipments.js +0 -58
- package/dist-server/graphql/resolvers/synchronization/create-dat-shipments.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/fetch-sync-invoices.js +0 -41
- package/dist-server/graphql/resolvers/synchronization/fetch-sync-invoices.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/fetch-sync-products.js +0 -79
- package/dist-server/graphql/resolvers/synchronization/fetch-sync-products.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/fetch-sync-purchase-orders.js +0 -57
- package/dist-server/graphql/resolvers/synchronization/fetch-sync-purchase-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/get-lmd-awb.js +0 -34
- package/dist-server/graphql/resolvers/synchronization/get-lmd-awb.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/index.js +0 -30
- package/dist-server/graphql/resolvers/synchronization/index.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/mms-retry-create-lmd-parcels.js +0 -70
- package/dist-server/graphql/resolvers/synchronization/mms-retry-create-lmd-parcels.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/powrup-get-airway-bill.js +0 -78
- package/dist-server/graphql/resolvers/synchronization/powrup-get-airway-bill.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/powrup-get-tracking-no.js +0 -61
- package/dist-server/graphql/resolvers/synchronization/powrup-get-tracking-no.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/powrup-initiate-shipment.js +0 -88
- package/dist-server/graphql/resolvers/synchronization/powrup-initiate-shipment.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/powrup-pack-order.js +0 -185
- package/dist-server/graphql/resolvers/synchronization/powrup-pack-order.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/refresh-lmd-access-token.js +0 -72
- package/dist-server/graphql/resolvers/synchronization/refresh-lmd-access-token.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/retry-create-lmd-parcels.js +0 -96
- package/dist-server/graphql/resolvers/synchronization/retry-create-lmd-parcels.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sellercraft-initiate-shipment.js +0 -97
- package/dist-server/graphql/resolvers/synchronization/sellercraft-initiate-shipment.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sellercraft-pack-marketplace-order.js +0 -202
- package/dist-server/graphql/resolvers/synchronization/sellercraft-pack-marketplace-order.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sync-all-products-to-powrup.js +0 -32
- package/dist-server/graphql/resolvers/synchronization/sync-all-products-to-powrup.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sync-all-products-to-sellercraft.js +0 -35
- package/dist-server/graphql/resolvers/synchronization/sync-all-products-to-sellercraft.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sync-products-from-account.js +0 -32
- package/dist-server/graphql/resolvers/synchronization/sync-products-from-account.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-account.js +0 -53
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-account.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-powrup.js +0 -100
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-powrup.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js +0 -142
- package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/versafleet-fetch-driver-runsheet.js +0 -45
- package/dist-server/graphql/resolvers/synchronization/versafleet-fetch-driver-runsheet.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/webspert-initiate-shipment.js +0 -37
- package/dist-server/graphql/resolvers/synchronization/webspert-initiate-shipment.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/webspert-pack-and-get.js +0 -66
- package/dist-server/graphql/resolvers/synchronization/webspert-pack-and-get.js.map +0 -1
- package/dist-server/graphql/resolvers/synchronization/webspert-update-stocks.js +0 -27
- package/dist-server/graphql/resolvers/synchronization/webspert-update-stocks.js.map +0 -1
- package/dist-server/graphql/types/generators/generate-bizplace-input.js +0 -17
- package/dist-server/graphql/types/generators/generate-bizplace-input.js.map +0 -1
- package/dist-server/graphql/types/generators/generate-company-input.js +0 -17
- package/dist-server/graphql/types/generators/generate-company-input.js.map +0 -1
- package/dist-server/graphql/types/generators/index.js +0 -13
- package/dist-server/graphql/types/generators/index.js.map +0 -1
- package/dist-server/graphql/types/generators/update-domain-type-input.js +0 -14
- package/dist-server/graphql/types/generators/update-domain-type-input.js.map +0 -1
- package/dist-server/graphql/types/index.js +0 -35
- package/dist-server/graphql/types/index.js.map +0 -1
- package/dist-server/graphql/types/invitations/index.js +0 -9
- package/dist-server/graphql/types/invitations/index.js.map +0 -1
- package/dist-server/graphql/types/oauth2/company-role.js +0 -14
- package/dist-server/graphql/types/oauth2/company-role.js.map +0 -1
- package/dist-server/graphql/types/oauth2/index.js +0 -9
- package/dist-server/graphql/types/oauth2/index.js.map +0 -1
- package/dist-server/graphql/types/reports/admiral-asn-report-list.js +0 -14
- package/dist-server/graphql/types/reports/admiral-asn-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/admiral-asn-report.js +0 -21
- package/dist-server/graphql/types/reports/admiral-asn-report.js.map +0 -1
- package/dist-server/graphql/types/reports/asn-report-list.js +0 -14
- package/dist-server/graphql/types/reports/asn-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/asn-report.js +0 -21
- package/dist-server/graphql/types/reports/asn-report.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/elccl/agingreport/aging-report-list.js +0 -14
- package/dist-server/graphql/types/reports/custom/elccl/agingreport/aging-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/elccl/agingreport/aging-report.js +0 -31
- package/dist-server/graphql/types/reports/custom/elccl/agingreport/aging-report.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/elccl/dispatchreport/custom-elccl-fn-dispatch-report-list.js +0 -14
- package/dist-server/graphql/types/reports/custom/elccl/dispatchreport/custom-elccl-fn-dispatch-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/elccl/dispatchreport/custom-elccl-fn-dispatch-report.js +0 -26
- package/dist-server/graphql/types/reports/custom/elccl/dispatchreport/custom-elccl-fn-dispatch-report.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/elccl/exportreport/export-report-list.js +0 -14
- package/dist-server/graphql/types/reports/custom/elccl/exportreport/export-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/elccl/exportreport/export-report.js +0 -31
- package/dist-server/graphql/types/reports/custom/elccl/exportreport/export-report.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/posmy/custom-posmy-aging-report-list.js +0 -13
- package/dist-server/graphql/types/reports/custom/posmy/custom-posmy-aging-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/posmy/custom-posmy-aging-report.js +0 -28
- package/dist-server/graphql/types/reports/custom/posmy/custom-posmy-aging-report.js.map +0 -1
- package/dist-server/graphql/types/reports/custom/yltc/custom-yltc-inventory-report.js +0 -23
- package/dist-server/graphql/types/reports/custom/yltc/custom-yltc-inventory-report.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-order-details-report-list.js +0 -14
- package/dist-server/graphql/types/reports/inbound-order-details-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-order-details-report.js +0 -59
- package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/types/reports/index.js +0 -63
- package/dist-server/graphql/types/reports/index.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report-list.js +0 -14
- package/dist-server/graphql/types/reports/outbound-order-details-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +0 -76
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/types/reports/receiving-report-list.js +0 -14
- package/dist-server/graphql/types/reports/receiving-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/receiving-report.js +0 -23
- package/dist-server/graphql/types/reports/receiving-report.js.map +0 -1
- package/dist-server/graphql/types/reports/shortage-report-list.js +0 -14
- package/dist-server/graphql/types/reports/shortage-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/shortage-report-type.js +0 -26
- package/dist-server/graphql/types/reports/shortage-report-type.js.map +0 -1
- package/dist-server/graphql/types/synchronization/index.js +0 -49
- package/dist-server/graphql/types/synchronization/index.js.map +0 -1
- package/dist-server/graphql/types/synchronization/sync-invoice-list.js +0 -14
- package/dist-server/graphql/types/synchronization/sync-invoice-list.js.map +0 -1
- package/dist-server/graphql/types/synchronization/sync-invoice-set.js +0 -44
- package/dist-server/graphql/types/synchronization/sync-invoice-set.js.map +0 -1
- package/dist-server/graphql/types/synchronization/sync-product-list.js +0 -14
- package/dist-server/graphql/types/synchronization/sync-product-list.js.map +0 -1
- package/dist-server/graphql/types/synchronization/sync-product-set.js +0 -14
- package/dist-server/graphql/types/synchronization/sync-product-set.js.map +0 -1
- package/dist-server/graphql/types/synchronization/sync-purchase-order-list.js +0 -14
- package/dist-server/graphql/types/synchronization/sync-purchase-order-list.js.map +0 -1
- package/dist-server/graphql/types/synchronization/sync-purchase-order-set.js +0 -34
- package/dist-server/graphql/types/synchronization/sync-purchase-order-set.js.map +0 -1
- package/dist-server/index.js +0 -43
- package/dist-server/index.js.map +0 -1
- package/dist-server/middlewares/business-middleware.js +0 -32
- package/dist-server/middlewares/business-middleware.js.map +0 -1
- package/dist-server/middlewares/index.js +0 -21
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/middlewares/store-middleware.js +0 -34
- package/dist-server/middlewares/store-middleware.js.map +0 -1
- package/dist-server/middlewares/warehouse-middleware.js +0 -33
- package/dist-server/middlewares/warehouse-middleware.js.map +0 -1
- package/dist-server/migrations/1597668478399-SeedBusinessDomain.js +0 -27
- package/dist-server/migrations/1597668478399-SeedBusinessDomain.js.map +0 -1
- package/dist-server/migrations/1597668478401-SeedBusinessRoles.js +0 -377
- package/dist-server/migrations/1597668478401-SeedBusinessRoles.js.map +0 -1
- package/dist-server/migrations/1608009991065-SeedUser.js +0 -53
- package/dist-server/migrations/1608009991065-SeedUser.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/routers/api/index.js +0 -5
- package/dist-server/routers/api/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-contact-point.js +0 -76
- package/dist-server/routers/api/restful-apis/unstable/add-contact-point.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-draft-release-order.js +0 -174
- package/dist-server/routers/api/restful-apis/unstable/add-draft-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-inbound-order.js +0 -217
- package/dist-server/routers/api/restful-apis/unstable/add-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-marketplace-order.js +0 -144
- package/dist-server/routers/api/restful-apis/unstable/add-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-products.js +0 -88
- package/dist-server/routers/api/restful-apis/unstable/add-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-release-order.js +0 -1080
- package/dist-server/routers/api/restful-apis/unstable/add-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/add-sales-invoice.js +0 -140
- package/dist-server/routers/api/restful-apis/unstable/add-sales-invoice.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/bizplace.js +0 -45
- package/dist-server/routers/api/restful-apis/unstable/bizplace.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/cancel-marketplace-order.js +0 -63
- package/dist-server/routers/api/restful-apis/unstable/cancel-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/cancel-release-order.js +0 -82
- package/dist-server/routers/api/restful-apis/unstable/cancel-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-contact-point-list.js +0 -103
- package/dist-server/routers/api/restful-apis/unstable/get-contact-point-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-detail.js +0 -47
- package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-detail.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-list.js +0 -124
- package/dist-server/routers/api/restful-apis/unstable/get-delivery-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-delivery-orders.js +0 -164
- package/dist-server/routers/api/restful-apis/unstable/get-delivery-orders.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-goods-received-notes.js +0 -120
- package/dist-server/routers/api/restful-apis/unstable/get-goods-received-notes.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-detail.js +0 -115
- package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-detail.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-list.js +0 -125
- package/dist-server/routers/api/restful-apis/unstable/get-inbound-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-inventory-overall-product-group.js +0 -88
- package/dist-server/routers/api/restful-apis/unstable/get-inventory-overall-product-group.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-inventory-product-group.js +0 -95
- package/dist-server/routers/api/restful-apis/unstable/get-inventory-product-group.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-marketplace-order-shipping-list.js +0 -146
- package/dist-server/routers/api/restful-apis/unstable/get-marketplace-order-shipping-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-marketplace-store-list.js +0 -79
- package/dist-server/routers/api/restful-apis/unstable/get-marketplace-store-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-onhand-inventories.js +0 -110
- package/dist-server/routers/api/restful-apis/unstable/get-onhand-inventories.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-partners.js +0 -23
- package/dist-server/routers/api/restful-apis/unstable/get-partners.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-products.js +0 -214
- package/dist-server/routers/api/restful-apis/unstable/get-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-release-order-detail.js +0 -125
- package/dist-server/routers/api/restful-apis/unstable/get-release-order-detail.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-release-order-list.js +0 -195
- package/dist-server/routers/api/restful-apis/unstable/get-release-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/get-warehouses.js +0 -20
- package/dist-server/routers/api/restful-apis/unstable/get-warehouses.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/index.js +0 -35
- package/dist-server/routers/api/restful-apis/unstable/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/reject-inbound-order.js +0 -35
- package/dist-server/routers/api/restful-apis/unstable/reject-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-delivered.js +0 -45
- package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-delivered.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-failed-delivery.js +0 -45
- package/dist-server/routers/api/restful-apis/unstable/set-marketplace-order-failed-delivery.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/update-marketplace-order.js +0 -93
- package/dist-server/routers/api/restful-apis/unstable/update-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/update-marketplace-shipping-order.js +0 -88
- package/dist-server/routers/api/restful-apis/unstable/update-marketplace-shipping-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/unstable/update-release-order-details.js +0 -82
- package/dist-server/routers/api/restful-apis/unstable/update-release-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/add-contact-points.js +0 -105
- package/dist-server/routers/api/restful-apis/v1/company/add-contact-points.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/add-products.js +0 -157
- package/dist-server/routers/api/restful-apis/v1/company/add-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-bizplace-list.js +0 -49
- package/dist-server/routers/api/restful-apis/v1/company/get-bizplace-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-contact-point-list.js +0 -62
- package/dist-server/routers/api/restful-apis/v1/company/get-contact-point-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-partner-list.js +0 -88
- package/dist-server/routers/api/restful-apis/v1/company/get-partner-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-product-by-skus.js +0 -95
- package/dist-server/routers/api/restful-apis/v1/company/get-product-by-skus.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js +0 -104
- package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-webhook-details.js +0 -58
- package/dist-server/routers/api/restful-apis/v1/company/get-webhook-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/index.js +0 -14
- package/dist-server/routers/api/restful-apis/v1/company/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/upsert-product.js +0 -111
- package/dist-server/routers/api/restful-apis/v1/company/upsert-product.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/upsert-products.js +0 -356
- package/dist-server/routers/api/restful-apis/v1/company/upsert-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/upsert-webhooks.js +0 -146
- package/dist-server/routers/api/restful-apis/v1/company/upsert-webhooks.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/index.js +0 -6
- package/dist-server/routers/api/restful-apis/v1/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/add-marketplace-order.js +0 -254
- package/dist-server/routers/api/restful-apis/v1/marketplace/add-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/add-marketplace-products.js +0 -78
- package/dist-server/routers/api/restful-apis/v1/marketplace/add-marketplace-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/cancel-marketplace-order.js +0 -90
- package/dist-server/routers/api/restful-apis/v1/marketplace/cancel-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/get-marketplace-order-shipping-list.js +0 -138
- package/dist-server/routers/api/restful-apis/v1/marketplace/get-marketplace-order-shipping-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/get-marketplace-store-list.js +0 -51
- package/dist-server/routers/api/restful-apis/v1/marketplace/get-marketplace-store-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/index.js +0 -11
- package/dist-server/routers/api/restful-apis/v1/marketplace/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/update-marketplace-order-delivered.js +0 -62
- package/dist-server/routers/api/restful-apis/v1/marketplace/update-marketplace-order-delivered.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/update-marketplace-product.js +0 -76
- package/dist-server/routers/api/restful-apis/v1/marketplace/update-marketplace-product.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/marketplace/update-marketplace-shipping-order.js +0 -40
- package/dist-server/routers/api/restful-apis/v1/marketplace/update-marketplace-shipping-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/business-middleware.js +0 -70
- package/dist-server/routers/api/restful-apis/v1/middlewares/business-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/index.js +0 -40
- package/dist-server/routers/api/restful-apis/v1/middlewares/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/logging-middleware.js +0 -53
- package/dist-server/routers/api/restful-apis/v1/middlewares/logging-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/store-middleware.js +0 -32
- package/dist-server/routers/api/restful-apis/v1/middlewares/store-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/validation-middleware.js +0 -118
- package/dist-server/routers/api/restful-apis/v1/middlewares/validation-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/warehouse-middleware.js +0 -31
- package/dist-server/routers/api/restful-apis/v1/middlewares/warehouse-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/utils/error-util.js +0 -71
- package/dist-server/routers/api/restful-apis/v1/utils/error-util.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/utils/params.js +0 -1164
- package/dist-server/routers/api/restful-apis/v1/utils/params.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/utils/validate-util.js +0 -68
- package/dist-server/routers/api/restful-apis/v1/utils/validate-util.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-inbound-order.js +0 -254
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js +0 -1091
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-return-order.js +0 -325
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-return-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-sales-invoice.js +0 -97
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-sales-invoice.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-inbound-order.js +0 -199
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-release-order.js +0 -197
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/complete-delivery-order.js +0 -170
- package/dist-server/routers/api/restful-apis/v1/warehouse/complete-delivery-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/dispatch-delivery-order.js +0 -327
- package/dist-server/routers/api/restful-apis/v1/warehouse/dispatch-delivery-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-delivery-order-list.js +0 -223
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-delivery-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-do-document.js +0 -65
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-do-document.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-draft-order-details.js +0 -144
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-draft-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-draft-order-list.js +0 -305
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-draft-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-goods-received-note-list.js +0 -100
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-goods-received-note-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-grn-document.js +0 -102
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-grn-document.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-details.js +0 -179
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-list.js +0 -96
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-adjustment-details.js +0 -146
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-adjustment-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-adjustment-list.js +0 -214
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-adjustment-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.js +0 -90
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-manifest-details.js +0 -138
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-manifest-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.js +0 -106
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js +0 -278
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-list.js +0 -142
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-return-order-details.js +0 -106
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-return-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-return-order-list.js +0 -63
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-return-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-warehouse-bizplace-onhand-inventories.js +0 -68
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-warehouse-bizplace-onhand-inventories.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/index.js +0 -32
- package/dist-server/routers/api/restful-apis/v1/warehouse/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-gan-to-arrived.js +0 -96
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-gan-to-arrived.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-order-package-details.js +0 -46
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-order-package-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-release-order-details.js +0 -70
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-release-order-details.js.map +0 -1
- package/dist-server/routers/auth-invitation-router.js +0 -25
- package/dist-server/routers/auth-invitation-router.js.map +0 -1
- package/dist-server/routers/business/bizplace-register-router.js +0 -25
- package/dist-server/routers/business/bizplace-register-router.js.map +0 -1
- package/dist-server/routers/business/business-register-router.js +0 -31
- package/dist-server/routers/business/business-register-router.js.map +0 -1
- package/dist-server/routers/business/index.js +0 -20
- package/dist-server/routers/business/index.js.map +0 -1
- package/dist-server/routers/business/path-base-business-router.js +0 -21
- package/dist-server/routers/business/path-base-business-router.js.map +0 -1
- package/dist-server/routers/internal/apis/create-bizplace.js +0 -70
- package/dist-server/routers/internal/apis/create-bizplace.js.map +0 -1
- package/dist-server/routers/internal/apis/create-company.js +0 -77
- package/dist-server/routers/internal/apis/create-company.js.map +0 -1
- package/dist-server/routers/internal/apis/create-partner.js +0 -41
- package/dist-server/routers/internal/apis/create-partner.js.map +0 -1
- package/dist-server/routers/internal/apis/create-user.js +0 -23
- package/dist-server/routers/internal/apis/create-user.js.map +0 -1
- package/dist-server/routers/internal/apis/index.js +0 -37
- package/dist-server/routers/internal/apis/index.js.map +0 -1
- package/dist-server/routers/internal/apis/invite-user.js +0 -48
- package/dist-server/routers/internal/apis/invite-user.js.map +0 -1
- package/dist-server/routers/internal/apis/terminate-partner.js +0 -38
- package/dist-server/routers/internal/apis/terminate-partner.js.map +0 -1
- package/dist-server/routers/internal/apis/terminate-user.js +0 -53
- package/dist-server/routers/internal/apis/terminate-user.js.map +0 -1
- package/dist-server/routers/internal/apis/update-bizplace.js +0 -52
- package/dist-server/routers/internal/apis/update-bizplace.js.map +0 -1
- package/dist-server/routers/internal/apis/update-company.js +0 -55
- package/dist-server/routers/internal/apis/update-company.js.map +0 -1
- package/dist-server/routers/internal/apis/update-user.js +0 -33
- package/dist-server/routers/internal/apis/update-user.js.map +0 -1
- package/dist-server/routers/internal/index.js +0 -8
- package/dist-server/routers/internal/index.js.map +0 -1
- package/dist-server/routers/internal/middlewares/index.js +0 -20
- package/dist-server/routers/internal/middlewares/index.js.map +0 -1
- package/dist-server/routers/internal/middlewares/logging-middleware.js +0 -23
- package/dist-server/routers/internal/middlewares/logging-middleware.js.map +0 -1
- package/dist-server/routers/internal/middlewares/validation-middleware.js +0 -110
- package/dist-server/routers/internal/middlewares/validation-middleware.js.map +0 -1
- package/dist-server/routers/internal/powrup-router.js +0 -291
- package/dist-server/routers/internal/powrup-router.js.map +0 -1
- package/dist-server/routers/internal/sellercraft-router.js +0 -53
- package/dist-server/routers/internal/sellercraft-router.js.map +0 -1
- package/dist-server/routers/internal/utils/error-util.js +0 -71
- package/dist-server/routers/internal/utils/error-util.js.map +0 -1
- package/dist-server/routers/internal/utils/params.js +0 -153
- package/dist-server/routers/internal/utils/params.js.map +0 -1
- package/dist-server/routers/support-router.js +0 -386
- package/dist-server/routers/support-router.js.map +0 -1
- package/dist-server/routers/webhook-service/versafleet-router.js +0 -93
- package/dist-server/routers/webhook-service/versafleet-router.js.map +0 -1
- package/dist-server/routers/xilnex-router.js +0 -1103
- package/dist-server/routers/xilnex-router.js.map +0 -1
- package/dist-server/routes.js +0 -26
- package/dist-server/routes.js.map +0 -1
- package/dist-server/templates/account-unlock-email.js +0 -69
- package/dist-server/templates/account-unlock-email.js.map +0 -1
- package/dist-server/templates/invitation-email.js +0 -70
- package/dist-server/templates/invitation-email.js.map +0 -1
- package/dist-server/templates/reset-password-email.js +0 -66
- package/dist-server/templates/reset-password-email.js.map +0 -1
- package/dist-server/templates/verification-email.js +0 -70
- package/dist-server/templates/verification-email.js.map +0 -1
- package/dist-server/utils/build-map.js +0 -19
- package/dist-server/utils/build-map.js.map +0 -1
- package/dist-server/utils/get-warehouses.js +0 -113
- package/dist-server/utils/get-warehouses.js.map +0 -1
- package/dist-server/utils/index.js +0 -21
- package/dist-server/utils/index.js.map +0 -1
- package/dist-server/utils/order-no-generator.js +0 -11
- package/dist-server/utils/order-no-generator.js.map +0 -1
- package/dist-server/utils/report-query-util.js +0 -42
- package/dist-server/utils/report-query-util.js.map +0 -1
|
@@ -1,1103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.xilnexRouter = void 0;
|
|
7
|
-
const koa_router_1 = __importDefault(require("koa-router"));
|
|
8
|
-
const typeorm_1 = require("typeorm");
|
|
9
|
-
const uuid_1 = require("uuid");
|
|
10
|
-
const biz_base_1 = require("@things-factory/biz-base");
|
|
11
|
-
const env_1 = require("@things-factory/env");
|
|
12
|
-
const id_rule_base_1 = require("@things-factory/id-rule-base");
|
|
13
|
-
const integration_accounting_1 = require("@things-factory/integration-accounting");
|
|
14
|
-
// import { createPayloadLog, PayloadType } from '@things-factory/integration-base'
|
|
15
|
-
const product_base_1 = require("@things-factory/product-base");
|
|
16
|
-
const sales_base_1 = require("@things-factory/sales-base");
|
|
17
|
-
const setting_base_1 = require("@things-factory/setting-base");
|
|
18
|
-
const shell_1 = require("@things-factory/shell");
|
|
19
|
-
const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
20
|
-
const index_1 = require("../errors/index");
|
|
21
|
-
const debug = require('debug')('things-factory:integration-accounting:xilnex-router');
|
|
22
|
-
exports.xilnexRouter = new koa_router_1.default();
|
|
23
|
-
exports.xilnexRouter.post('/webhook-xilnex-po', async (context, next) => {
|
|
24
|
-
const originalContext = context;
|
|
25
|
-
try {
|
|
26
|
-
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
27
|
-
const { id, warehouseId } = context.query;
|
|
28
|
-
const { body, header } = context.request;
|
|
29
|
-
const data = (body === null || body === void 0 ? void 0 : body.Data) ? JSON.parse(body.Data) : {};
|
|
30
|
-
const account = await integration_accounting_1.AccountingAPI.getAccounting(id);
|
|
31
|
-
if (!account) {
|
|
32
|
-
context.throw(400, `${id} not found in Account`);
|
|
33
|
-
}
|
|
34
|
-
const { webhookKey } = account;
|
|
35
|
-
const signature = header['xilnex-webhook-signature'];
|
|
36
|
-
const xilnex = new integration_accounting_1.Xilnex({});
|
|
37
|
-
if (!xilnex.isValidSignature(body, webhookKey, signature)) {
|
|
38
|
-
let errBody = JSON.stringify({
|
|
39
|
-
body,
|
|
40
|
-
webhookKey,
|
|
41
|
-
signature
|
|
42
|
-
});
|
|
43
|
-
context.throw(400, `Signature validation failed: ${errBody}`);
|
|
44
|
-
}
|
|
45
|
-
const customerDomain = account.domain;
|
|
46
|
-
const customerBizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
|
|
47
|
-
where: { domain: customerDomain }
|
|
48
|
-
});
|
|
49
|
-
const custCompanyBizplace = await (0, biz_base_1.getCompanyBizplace)(null, null, customerBizplace.id, tx);
|
|
50
|
-
const warehouseDomain = await tx.getRepository(shell_1.Domain).findOne({
|
|
51
|
-
where: { id: warehouseId, extType: 'warehouse' }
|
|
52
|
-
});
|
|
53
|
-
if (!warehouseDomain) {
|
|
54
|
-
context.throw(400, `${warehouseId} not found in warehouse domain`);
|
|
55
|
-
}
|
|
56
|
-
let accountWebhookOrder = {
|
|
57
|
-
name: (0, uuid_1.v4)(),
|
|
58
|
-
request: body,
|
|
59
|
-
platform: integration_accounting_1.ACCOUNT_PLATFORM.XILNEX,
|
|
60
|
-
domain: account.domain,
|
|
61
|
-
status: integration_accounting_1.ACCOUNT_SYNC_STATUS.FAILED
|
|
62
|
-
};
|
|
63
|
-
if (data === null || data === void 0 ? void 0 : data.id) {
|
|
64
|
-
const purchaseOrder = await integration_accounting_1.AccountingAPI.getPurchaseOrder(account, { orderId: data.id });
|
|
65
|
-
const { orderInfo, orderItems } = purchaseOrder;
|
|
66
|
-
let accountInfo = (account === null || account === void 0 ? void 0 : account.accountInfo) ? JSON.parse(account.accountInfo) : {};
|
|
67
|
-
if (accountInfo.outlet == orderInfo.toOutlet) {
|
|
68
|
-
const poNoSetting = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
69
|
-
where: {
|
|
70
|
-
domain: warehouseDomain,
|
|
71
|
-
name: sales_base_1.ORDER_NUMBER_SETTING_KEY.PO_NUMBER_RULE
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
let orderNo = poNoSetting
|
|
75
|
-
? await (0, id_rule_base_1.generateId)({ domain: warehouseDomain, type: sales_base_1.ORDER_NUMBER_RULE_TYPE.PO_NUMBER, seed: {} })
|
|
76
|
-
: sales_base_1.OrderNoGenerator.purchaseOrder();
|
|
77
|
-
let purchaseOrder = {
|
|
78
|
-
name: orderNo,
|
|
79
|
-
refNo: orderInfo.orderId,
|
|
80
|
-
refNo2: null,
|
|
81
|
-
refNo3: null,
|
|
82
|
-
etaDate: orderInfo.etaDate,
|
|
83
|
-
ownTransport: orderInfo.ownTransport,
|
|
84
|
-
importCargo: orderInfo.importCargo,
|
|
85
|
-
container: orderInfo.container,
|
|
86
|
-
remark: orderInfo.remark,
|
|
87
|
-
currency: (orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.currency) || 'MYR',
|
|
88
|
-
source: 'XILNEX',
|
|
89
|
-
orderSourceType: 'XILNEX_PO',
|
|
90
|
-
domain: warehouseDomain,
|
|
91
|
-
bizplace: customerBizplace,
|
|
92
|
-
status: sales_base_1.PURCHASE_ORDER_STATUS.DRAFT
|
|
93
|
-
};
|
|
94
|
-
purchaseOrder = await tx.getRepository(sales_base_1.PurchaseOrder).save(purchaseOrder);
|
|
95
|
-
let orderProducts = [];
|
|
96
|
-
await Promise.all(orderItems.map(async (item) => {
|
|
97
|
-
const refCode = item.product.refCode;
|
|
98
|
-
let productDetail = await tx.getRepository(product_base_1.ProductDetail).findOne({
|
|
99
|
-
where: { domain: custCompanyBizplace.domain, refCode: refCode },
|
|
100
|
-
relations: ['product']
|
|
101
|
-
});
|
|
102
|
-
if (!productDetail) {
|
|
103
|
-
const sku = item.product.sku;
|
|
104
|
-
const product = await tx.getRepository(product_base_1.Product).findOne({
|
|
105
|
-
where: { domain: custCompanyBizplace.domain, sku }
|
|
106
|
-
});
|
|
107
|
-
if (product) {
|
|
108
|
-
productDetail = await tx.getRepository(product_base_1.ProductDetail).findOne({
|
|
109
|
-
where: { domain: custCompanyBizplace.domain, product },
|
|
110
|
-
relations: ['product']
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
context.throw(404, `error.sku ${sku} and refCode ${refCode} not exist in product master`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
let orderProduct = {
|
|
118
|
-
name: sales_base_1.OrderNoGenerator.orderProduct(),
|
|
119
|
-
product: productDetail === null || productDetail === void 0 ? void 0 : productDetail.product,
|
|
120
|
-
productDetail,
|
|
121
|
-
batchId: (item === null || item === void 0 ? void 0 : item.batchId) || '-',
|
|
122
|
-
packingType: productDetail === null || productDetail === void 0 ? void 0 : productDetail.packingType,
|
|
123
|
-
packingSize: productDetail === null || productDetail === void 0 ? void 0 : productDetail.packingSize,
|
|
124
|
-
uom: productDetail === null || productDetail === void 0 ? void 0 : productDetail.uom,
|
|
125
|
-
uomValue: productDetail === null || productDetail === void 0 ? void 0 : productDetail.uomValue,
|
|
126
|
-
packQty: item.confirmedQty,
|
|
127
|
-
palletQty: 1,
|
|
128
|
-
totalUomValue: `${(productDetail.uomValue * item.confirmedQty).toFixed(2)} ${productDetail.uom}`,
|
|
129
|
-
status: sales_base_1.PURCHASE_ORDER_STATUS.DRAFT,
|
|
130
|
-
unitPrice: item.unitCost || 1,
|
|
131
|
-
taxRate: item.taxAmount,
|
|
132
|
-
refItemId: item.refItemId,
|
|
133
|
-
purchaseOrder,
|
|
134
|
-
domain: warehouseDomain,
|
|
135
|
-
bizplace: customerBizplace
|
|
136
|
-
};
|
|
137
|
-
orderProducts.push(orderProduct);
|
|
138
|
-
}));
|
|
139
|
-
await tx.getRepository(sales_base_1.OrderProduct).save(orderProducts);
|
|
140
|
-
}
|
|
141
|
-
accountWebhookOrder.status = integration_accounting_1.ACCOUNT_SYNC_STATUS.SUCCESS;
|
|
142
|
-
await tx.getRepository(integration_accounting_1.AccountWebhookOrder).save(accountWebhookOrder);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
context.status = 200;
|
|
146
|
-
}
|
|
147
|
-
catch (err) {
|
|
148
|
-
env_1.logger.error(`xilnex-router[webhook-xilnex-po-original-context]: ${JSON.stringify(originalContext)}`);
|
|
149
|
-
env_1.logger.error(`xilnex-router[webhook-xilnex-po]: ${err}`);
|
|
150
|
-
context.status = 400;
|
|
151
|
-
context.throw(400, err);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
exports.xilnexRouter.post('/webhook-xilnex-transfer-note', async (context, next) => {
|
|
155
|
-
const originalContext = context;
|
|
156
|
-
try {
|
|
157
|
-
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
158
|
-
const { id, warehouseId } = context.query;
|
|
159
|
-
const { body, header } = context.request;
|
|
160
|
-
const data = (body === null || body === void 0 ? void 0 : body.Data) ? JSON.parse(body.Data) : {};
|
|
161
|
-
const account = await integration_accounting_1.AccountingAPI.getAccounting(id);
|
|
162
|
-
if (!account) {
|
|
163
|
-
context.throw(400, `${id} not found in Account`);
|
|
164
|
-
}
|
|
165
|
-
const { webhookKey } = account;
|
|
166
|
-
const signature = header['xilnex-webhook-signature'];
|
|
167
|
-
const xilnex = new integration_accounting_1.Xilnex({});
|
|
168
|
-
if (!xilnex.isValidSignature(body, webhookKey, signature)) {
|
|
169
|
-
let errBody = JSON.stringify({
|
|
170
|
-
body,
|
|
171
|
-
webhookKey,
|
|
172
|
-
signature
|
|
173
|
-
});
|
|
174
|
-
context.throw(400, `Signature validation failed: ${errBody}`);
|
|
175
|
-
}
|
|
176
|
-
const customerDomain = account.domain;
|
|
177
|
-
const customerBizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
|
|
178
|
-
where: { domain: customerDomain }
|
|
179
|
-
});
|
|
180
|
-
const custCompanyBizplace = await (0, biz_base_1.getCompanyBizplace)(null, null, customerBizplace.id, tx);
|
|
181
|
-
const warehouseDomain = await tx.getRepository(shell_1.Domain).findOne({
|
|
182
|
-
where: { id: warehouseId, extType: 'warehouse' }
|
|
183
|
-
});
|
|
184
|
-
if (!warehouseDomain) {
|
|
185
|
-
context.throw(400, `${warehouseId} not found in warehouse domain`);
|
|
186
|
-
}
|
|
187
|
-
let accountWebhookOrder = {
|
|
188
|
-
name: (0, uuid_1.v4)(),
|
|
189
|
-
request: body,
|
|
190
|
-
platform: integration_accounting_1.ACCOUNT_PLATFORM.XILNEX,
|
|
191
|
-
domain: account.domain,
|
|
192
|
-
status: integration_accounting_1.ACCOUNT_SYNC_STATUS.FAILED
|
|
193
|
-
};
|
|
194
|
-
let accountInfo = (account === null || account === void 0 ? void 0 : account.accountInfo) ? JSON.parse(account.accountInfo) : {};
|
|
195
|
-
if (data === null || data === void 0 ? void 0 : data.id) {
|
|
196
|
-
const transferNote = await integration_accounting_1.AccountingAPI.getTransferNote(account, { orderId: data.id });
|
|
197
|
-
const { orderInfo, orderItems } = transferNote;
|
|
198
|
-
if (orderInfo.fromLocation == accountInfo.outlet || orderInfo.toLocation == accountInfo.outlet) {
|
|
199
|
-
// VDC release
|
|
200
|
-
if (accountInfo.outlet == orderInfo.fromLocation) {
|
|
201
|
-
let releaseGood = {
|
|
202
|
-
domain: warehouseDomain,
|
|
203
|
-
bizplace: customerBizplace,
|
|
204
|
-
companyBizplace: custCompanyBizplace,
|
|
205
|
-
courierOption: false,
|
|
206
|
-
collectionOrderNo: orderInfo.orderId,
|
|
207
|
-
exportOption: false,
|
|
208
|
-
ownTransport: orderInfo.ownTransport,
|
|
209
|
-
packingOption: false,
|
|
210
|
-
refNo: orderInfo.orderId,
|
|
211
|
-
refNo2: orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.fromLocation,
|
|
212
|
-
refNo3: orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.toLocation,
|
|
213
|
-
releaseDate: orderInfo.issueDate,
|
|
214
|
-
type: 'b2b',
|
|
215
|
-
source: 'XILNEX',
|
|
216
|
-
orderSourceType: 'XILNEX_TRANSFER_NOTE',
|
|
217
|
-
marketplaceOrderStatus: orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.status,
|
|
218
|
-
remark: (orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.remark) || null
|
|
219
|
-
};
|
|
220
|
-
// check existing order
|
|
221
|
-
await checkExistingOrder(releaseGood, customerBizplace, true, context, tx);
|
|
222
|
-
//massage data
|
|
223
|
-
let massagedData = await massageOrderItems(releaseGood, orderItems, context);
|
|
224
|
-
// validation
|
|
225
|
-
let errorList = [];
|
|
226
|
-
await Promise.all(massagedData.combinedItems.map(async (item) => {
|
|
227
|
-
let itemList = await tx.query(`
|
|
228
|
-
select wboi.* from warehouse_bizplace_onhand_inventories wboi
|
|
229
|
-
where wboi."domain_id"= $1 and
|
|
230
|
-
wboi."bizplace_id" = $2 and
|
|
231
|
-
wboi."group_type" = 'SINGLE' and
|
|
232
|
-
wboi."product_id" = $3 and
|
|
233
|
-
wboi."packing_type" = $4 and
|
|
234
|
-
wboi."packing_size" = $5 and
|
|
235
|
-
wboi."uom" = $6 and
|
|
236
|
-
wboi."remain_qty" >= $7 and
|
|
237
|
-
wboi."remain_uom_value" >= $8
|
|
238
|
-
`, [
|
|
239
|
-
warehouseDomain.id,
|
|
240
|
-
customerBizplace.id,
|
|
241
|
-
item.product.id,
|
|
242
|
-
item.packingType,
|
|
243
|
-
item.packingSize,
|
|
244
|
-
item.uom,
|
|
245
|
-
item.releaseQty,
|
|
246
|
-
item.releaseUomValue
|
|
247
|
-
]);
|
|
248
|
-
if (itemList.length <= 0) {
|
|
249
|
-
errorList.push(JSON.stringify({
|
|
250
|
-
code: 'insufficient stock',
|
|
251
|
-
sku: item.product.sku,
|
|
252
|
-
packingType: item.packingType,
|
|
253
|
-
packingSize: item.packingSize,
|
|
254
|
-
uom: item.uom,
|
|
255
|
-
qty: item.releaseQty,
|
|
256
|
-
uom_value: item.releaseUomValue
|
|
257
|
-
}));
|
|
258
|
-
}
|
|
259
|
-
console.log();
|
|
260
|
-
}));
|
|
261
|
-
if (errorList.length > 0) {
|
|
262
|
-
context.throw(404, errorList.join(', '));
|
|
263
|
-
}
|
|
264
|
-
let assignedOrderProducts = await assignToInventory(massagedData.orderProducts, customerBizplace, warehouseDomain, context, tx);
|
|
265
|
-
let result = await createReleaseGood(releaseGood, assignedOrderProducts, customerBizplace, warehouseDomain, context, tx);
|
|
266
|
-
let addReleaseGood = {
|
|
267
|
-
id: result.id,
|
|
268
|
-
name: result.name,
|
|
269
|
-
refNo: result.refNo,
|
|
270
|
-
refNo2: result.refNo2,
|
|
271
|
-
refNo3: result.refNo3,
|
|
272
|
-
status: result.status,
|
|
273
|
-
truckNo: result.truckNo,
|
|
274
|
-
ownTransport: result.ownTransport,
|
|
275
|
-
crossDocking: result.crossDocking,
|
|
276
|
-
type: result.type,
|
|
277
|
-
exportOption: result.exportOption,
|
|
278
|
-
releaseDate: result.releaseDate,
|
|
279
|
-
collectionOrderNo: result.collectionOrderNo,
|
|
280
|
-
paidAmount: result === null || result === void 0 ? void 0 : result.paidAmount,
|
|
281
|
-
discountAmount: result === null || result === void 0 ? void 0 : result.discountAmount,
|
|
282
|
-
taxAmount: result === null || result === void 0 ? void 0 : result.taxAmount,
|
|
283
|
-
shippingFee: result === null || result === void 0 ? void 0 : result.shippingFee,
|
|
284
|
-
bizplace: { name: result.bizplace.name },
|
|
285
|
-
domain: { name: result.domain.name },
|
|
286
|
-
orderInventories: result.orderInventories
|
|
287
|
-
};
|
|
288
|
-
context.body = { result: { addReleaseGood } };
|
|
289
|
-
// createPayloadLog(
|
|
290
|
-
// customerBizplace.id,
|
|
291
|
-
// `/webhook-xilnex-stock-request`,
|
|
292
|
-
// stockRequest,
|
|
293
|
-
// context.body,
|
|
294
|
-
// context,
|
|
295
|
-
// PayloadType.INGESTION
|
|
296
|
-
// )
|
|
297
|
-
}
|
|
298
|
-
// VDC inbound
|
|
299
|
-
if (accountInfo.outlet == orderInfo.toLocation) {
|
|
300
|
-
const ganNoSetting = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
301
|
-
where: {
|
|
302
|
-
domain: warehouseDomain,
|
|
303
|
-
name: sales_base_1.ORDER_NUMBER_SETTING_KEY.GAN_NUMBER_RULE
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
let orderNo = '';
|
|
307
|
-
if (ganNoSetting) {
|
|
308
|
-
orderNo = await (0, id_rule_base_1.generateId)({ domain: warehouseDomain, type: sales_base_1.ORDER_NUMBER_RULE_TYPE.GAN_NUMBER, seed: {} });
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
orderNo = sales_base_1.OrderNoGenerator.arrivalNotice();
|
|
312
|
-
}
|
|
313
|
-
let arrivalNotice = {
|
|
314
|
-
name: orderNo,
|
|
315
|
-
refNo: orderInfo.orderId,
|
|
316
|
-
refNo2: orderInfo.fromLocation,
|
|
317
|
-
refNo3: orderInfo.toLocation,
|
|
318
|
-
etaDate: orderInfo.etaDate,
|
|
319
|
-
ownTransport: orderInfo.ownTransport,
|
|
320
|
-
importCargo: orderInfo.importCargo,
|
|
321
|
-
container: orderInfo.container,
|
|
322
|
-
remark: orderInfo.remark,
|
|
323
|
-
source: 'XILNEX',
|
|
324
|
-
orderSourceType: 'XILNEX_TRANSFER_NOTE',
|
|
325
|
-
domain: warehouseDomain,
|
|
326
|
-
bizplace: customerBizplace,
|
|
327
|
-
status: 'INTRANSIT'
|
|
328
|
-
};
|
|
329
|
-
arrivalNotice = await tx.getRepository(sales_base_1.ArrivalNotice).save(arrivalNotice);
|
|
330
|
-
let orderProducts = [];
|
|
331
|
-
await Promise.all(orderItems.map(async (item) => {
|
|
332
|
-
const refCode = item.product.refCode;
|
|
333
|
-
let productDetail = await tx.getRepository(product_base_1.ProductDetail).findOne({
|
|
334
|
-
where: { domain: custCompanyBizplace.domain, refCode: refCode },
|
|
335
|
-
relations: ['product']
|
|
336
|
-
});
|
|
337
|
-
if (!productDetail) {
|
|
338
|
-
const sku = item.product.sku;
|
|
339
|
-
const product = await tx.getRepository(product_base_1.Product).findOne({
|
|
340
|
-
where: { domain: custCompanyBizplace.domain, sku }
|
|
341
|
-
});
|
|
342
|
-
if (product) {
|
|
343
|
-
productDetail = await tx.getRepository(product_base_1.ProductDetail).findOne({
|
|
344
|
-
where: { domain: custCompanyBizplace.domain, product },
|
|
345
|
-
relations: ['product']
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
context.throw(404, `error.sku ${sku} and refCode ${refCode} not exist in product master`);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
let orderProduct = {
|
|
353
|
-
name: sales_base_1.OrderNoGenerator.orderProduct(),
|
|
354
|
-
product: productDetail === null || productDetail === void 0 ? void 0 : productDetail.product,
|
|
355
|
-
productDetail,
|
|
356
|
-
batchId: (item === null || item === void 0 ? void 0 : item.batchId) || '-',
|
|
357
|
-
packingType: productDetail === null || productDetail === void 0 ? void 0 : productDetail.packingType,
|
|
358
|
-
packingSize: productDetail === null || productDetail === void 0 ? void 0 : productDetail.packingSize,
|
|
359
|
-
uom: productDetail === null || productDetail === void 0 ? void 0 : productDetail.uom,
|
|
360
|
-
uomValue: productDetail === null || productDetail === void 0 ? void 0 : productDetail.uomValue,
|
|
361
|
-
packQty: item.confirmedQty,
|
|
362
|
-
palletQty: 1,
|
|
363
|
-
totalUomValue: `${(productDetail.uomValue * item.confirmedQty).toFixed(2)} ${productDetail.uom}`,
|
|
364
|
-
status: 'PENDING',
|
|
365
|
-
refItemId: item.orderItemId,
|
|
366
|
-
arrivalNotice,
|
|
367
|
-
domain: warehouseDomain,
|
|
368
|
-
bizplace: customerBizplace
|
|
369
|
-
};
|
|
370
|
-
orderProducts.push(orderProduct);
|
|
371
|
-
}));
|
|
372
|
-
await tx.getRepository(sales_base_1.OrderProduct).save(orderProducts);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
accountWebhookOrder.status = integration_accounting_1.ACCOUNT_SYNC_STATUS.SUCCESS;
|
|
377
|
-
await tx.getRepository(integration_accounting_1.AccountWebhookOrder).save(accountWebhookOrder);
|
|
378
|
-
});
|
|
379
|
-
context.status = 200;
|
|
380
|
-
}
|
|
381
|
-
catch (err) {
|
|
382
|
-
env_1.logger.error(`xilnex-router[webhook-xilnex-transfer-note-original-context]: ${JSON.stringify(originalContext)}`);
|
|
383
|
-
env_1.logger.error(`xilnex-router[webhook-xilnex-transfer-note]: ${err}`);
|
|
384
|
-
context.status = 400;
|
|
385
|
-
context.throw(400, err);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
exports.xilnexRouter.post('/webhook-xilnex-stock-request', async (context, next) => {
|
|
389
|
-
try {
|
|
390
|
-
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
391
|
-
const { id, warehouseId } = context.query;
|
|
392
|
-
const { body, headers } = context.request;
|
|
393
|
-
const data = (body === null || body === void 0 ? void 0 : body.Data) ? JSON.parse(body.Data) : {};
|
|
394
|
-
const account = await integration_accounting_1.AccountingAPI.getAccounting(id);
|
|
395
|
-
if (!account) {
|
|
396
|
-
throw new Error(`${id} not found in Account`);
|
|
397
|
-
}
|
|
398
|
-
const { webhookKey } = account;
|
|
399
|
-
const signature = headers['xilnex-webhook-signature'];
|
|
400
|
-
const xilnex = new integration_accounting_1.Xilnex({});
|
|
401
|
-
if (!xilnex.isValidSignature(body, webhookKey, signature)) {
|
|
402
|
-
context.throw(400, 'Signature validation failed');
|
|
403
|
-
}
|
|
404
|
-
const customerDomain = account.domain;
|
|
405
|
-
const customerBizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
|
|
406
|
-
where: { domain: customerDomain }
|
|
407
|
-
});
|
|
408
|
-
const custCompanyBizplace = await (0, biz_base_1.getCompanyBizplace)(null, null, customerBizplace.id, tx);
|
|
409
|
-
const warehouseDomain = await tx.getRepository(shell_1.Domain).findOne({
|
|
410
|
-
where: { id: warehouseId, extType: 'warehouse' }
|
|
411
|
-
});
|
|
412
|
-
if (!warehouseDomain) {
|
|
413
|
-
context.throw(400, `${warehouseId} not found in warehouse domain`);
|
|
414
|
-
}
|
|
415
|
-
let accountWebhookOrder = {
|
|
416
|
-
name: (0, uuid_1.v4)(),
|
|
417
|
-
request: body,
|
|
418
|
-
platform: integration_accounting_1.ACCOUNT_PLATFORM.XILNEX,
|
|
419
|
-
domain: account.domain,
|
|
420
|
-
status: integration_accounting_1.ACCOUNT_SYNC_STATUS.FAILED
|
|
421
|
-
};
|
|
422
|
-
let accountInfo = (account === null || account === void 0 ? void 0 : account.accountInfo) ? JSON.parse(account.accountInfo) : {};
|
|
423
|
-
if (data === null || data === void 0 ? void 0 : data.id) {
|
|
424
|
-
const stockRequest = await integration_accounting_1.AccountingAPI.getStockRequest(account, { orderId: data.id });
|
|
425
|
-
const { orderInfo, orderItems } = stockRequest;
|
|
426
|
-
if (orderInfo.fromLocation == accountInfo.outlet || orderInfo.toLocation == accountInfo.outlet) {
|
|
427
|
-
// VDC release
|
|
428
|
-
if (accountInfo.outlet == orderInfo.toLocation) {
|
|
429
|
-
let releaseGood = {
|
|
430
|
-
domain: warehouseDomain,
|
|
431
|
-
bizplace: customerBizplace,
|
|
432
|
-
companyBizplace: custCompanyBizplace,
|
|
433
|
-
courierOption: false,
|
|
434
|
-
collectionOrderNo: orderInfo.orderId,
|
|
435
|
-
exportOption: false,
|
|
436
|
-
ownTransport: orderInfo.ownTransport,
|
|
437
|
-
packingOption: false,
|
|
438
|
-
refNo: orderInfo.orderId,
|
|
439
|
-
refNo2: orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.fromLocation,
|
|
440
|
-
refNo3: orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.toLocation,
|
|
441
|
-
releaseDate: orderInfo.issueDate,
|
|
442
|
-
type: 'b2b',
|
|
443
|
-
source: 'XILNEX',
|
|
444
|
-
orderSourceType: 'XILNEX_STOCK_REQUEST',
|
|
445
|
-
marketplaceOrderStatus: orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.status,
|
|
446
|
-
remark: (orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.remark) || null
|
|
447
|
-
};
|
|
448
|
-
// check existing order
|
|
449
|
-
await checkExistingOrder(releaseGood, customerBizplace, true, context, tx);
|
|
450
|
-
//massage data
|
|
451
|
-
let massagedData = await massageOrderItems(releaseGood, orderItems, context);
|
|
452
|
-
// validation
|
|
453
|
-
let errorList = [];
|
|
454
|
-
await Promise.all(massagedData.combinedItems.map(async (item) => {
|
|
455
|
-
let itemList = await tx.query(`
|
|
456
|
-
select wboi.* from warehouse_bizplace_onhand_inventories wboi
|
|
457
|
-
where wboi."domain_id"= $1 and
|
|
458
|
-
wboi."bizplace_id" = $2 and
|
|
459
|
-
wboi."group_type" = 'SINGLE' and
|
|
460
|
-
wboi."product_id" = $3 and
|
|
461
|
-
wboi."packing_type" = $4 and
|
|
462
|
-
wboi."packing_size" = $5 and
|
|
463
|
-
wboi."uom" = $6 and
|
|
464
|
-
wboi."remain_qty" >= $7 and
|
|
465
|
-
wboi."remain_uom_value" >= $8
|
|
466
|
-
`, [
|
|
467
|
-
warehouseDomain.id,
|
|
468
|
-
customerBizplace.id,
|
|
469
|
-
item.product.id,
|
|
470
|
-
item.packingType,
|
|
471
|
-
item.packingSize,
|
|
472
|
-
item.uom,
|
|
473
|
-
item.releaseQty,
|
|
474
|
-
item.releaseUomValue
|
|
475
|
-
]);
|
|
476
|
-
if (itemList.length <= 0) {
|
|
477
|
-
errorList.push(JSON.stringify({
|
|
478
|
-
code: 'insufficient stock',
|
|
479
|
-
sku: item.product.sku,
|
|
480
|
-
packingType: item.packingType,
|
|
481
|
-
packingSize: item.packingSize,
|
|
482
|
-
uom: item.uom,
|
|
483
|
-
qty: item.releaseQty,
|
|
484
|
-
uom_value: item.releaseUomValue
|
|
485
|
-
}));
|
|
486
|
-
}
|
|
487
|
-
console.log();
|
|
488
|
-
}));
|
|
489
|
-
if (errorList.length > 0) {
|
|
490
|
-
context.throw(404, errorList.join(', '));
|
|
491
|
-
}
|
|
492
|
-
let assignedOrderProducts = await assignToInventory(massagedData.orderProducts, customerBizplace, warehouseDomain, context, tx);
|
|
493
|
-
let result = await createReleaseGood(releaseGood, assignedOrderProducts, customerBizplace, warehouseDomain, context, tx);
|
|
494
|
-
let addReleaseGood = {
|
|
495
|
-
id: result.id,
|
|
496
|
-
name: result.name,
|
|
497
|
-
refNo: result.refNo,
|
|
498
|
-
refNo2: result.refNo2,
|
|
499
|
-
refNo3: result.refNo3,
|
|
500
|
-
status: result.status,
|
|
501
|
-
truckNo: result.truckNo,
|
|
502
|
-
ownTransport: result.ownTransport,
|
|
503
|
-
crossDocking: result.crossDocking,
|
|
504
|
-
type: result.type,
|
|
505
|
-
exportOption: result.exportOption,
|
|
506
|
-
releaseDate: result.releaseDate,
|
|
507
|
-
collectionOrderNo: result.collectionOrderNo,
|
|
508
|
-
paidAmount: result === null || result === void 0 ? void 0 : result.paidAmount,
|
|
509
|
-
discountAmount: result === null || result === void 0 ? void 0 : result.discountAmount,
|
|
510
|
-
taxAmount: result === null || result === void 0 ? void 0 : result.taxAmount,
|
|
511
|
-
shippingFee: result === null || result === void 0 ? void 0 : result.shippingFee,
|
|
512
|
-
bizplace: { name: result.bizplace.name },
|
|
513
|
-
domain: { name: result.domain.name },
|
|
514
|
-
orderInventories: result.orderInventories
|
|
515
|
-
};
|
|
516
|
-
context.body = { result: { addReleaseGood } };
|
|
517
|
-
// createPayloadLog(
|
|
518
|
-
// customerBizplace.id,
|
|
519
|
-
// `/webhook-xilnex-stock-request`,
|
|
520
|
-
// stockRequest,
|
|
521
|
-
// context.body,
|
|
522
|
-
// context,
|
|
523
|
-
// PayloadType.INGESTION
|
|
524
|
-
// )
|
|
525
|
-
}
|
|
526
|
-
// VDC inbound
|
|
527
|
-
if (accountInfo.outlet == orderInfo.fromLocation) {
|
|
528
|
-
const ganNoSetting = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
529
|
-
where: {
|
|
530
|
-
domain: warehouseDomain,
|
|
531
|
-
name: sales_base_1.ORDER_NUMBER_SETTING_KEY.GAN_NUMBER_RULE
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
let orderNo = '';
|
|
535
|
-
if (ganNoSetting) {
|
|
536
|
-
orderNo = await (0, id_rule_base_1.generateId)({ domain: warehouseDomain, type: sales_base_1.ORDER_NUMBER_RULE_TYPE.GAN_NUMBER, seed: {} });
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
orderNo = sales_base_1.OrderNoGenerator.arrivalNotice();
|
|
540
|
-
}
|
|
541
|
-
let arrivalNotice = {
|
|
542
|
-
name: orderNo,
|
|
543
|
-
refNo: orderInfo.orderId,
|
|
544
|
-
refNo2: orderInfo.fromLocation,
|
|
545
|
-
refNo3: orderInfo.toLocation,
|
|
546
|
-
etaDate: orderInfo.etaDate,
|
|
547
|
-
ownTransport: orderInfo.ownTransport,
|
|
548
|
-
importCargo: orderInfo.importCargo,
|
|
549
|
-
container: orderInfo.container,
|
|
550
|
-
remark: orderInfo.remark,
|
|
551
|
-
source: 'XILNEX',
|
|
552
|
-
orderSourceType: 'XILNEX_STOCK_REQUEST',
|
|
553
|
-
domain: warehouseDomain,
|
|
554
|
-
bizplace: customerBizplace,
|
|
555
|
-
status: 'INTRANSIT'
|
|
556
|
-
};
|
|
557
|
-
arrivalNotice = await tx.getRepository(sales_base_1.ArrivalNotice).save(arrivalNotice);
|
|
558
|
-
let orderProducts = [];
|
|
559
|
-
await Promise.all(orderItems.map(async (item) => {
|
|
560
|
-
const productDetail = await (0, typeorm_1.getRepository)(product_base_1.ProductDetail).findOne({
|
|
561
|
-
where: { domain: custCompanyBizplace.domain, refCode: item.product.refCode },
|
|
562
|
-
relations: ['product']
|
|
563
|
-
});
|
|
564
|
-
if (!productDetail) {
|
|
565
|
-
context.throw(404, `no matching product found`);
|
|
566
|
-
}
|
|
567
|
-
let orderProduct = {
|
|
568
|
-
name: sales_base_1.OrderNoGenerator.orderProduct(),
|
|
569
|
-
product: productDetail === null || productDetail === void 0 ? void 0 : productDetail.product,
|
|
570
|
-
productDetail,
|
|
571
|
-
batchId: (item === null || item === void 0 ? void 0 : item.batchId) || '-',
|
|
572
|
-
packingType: productDetail === null || productDetail === void 0 ? void 0 : productDetail.packingType,
|
|
573
|
-
packingSize: productDetail === null || productDetail === void 0 ? void 0 : productDetail.packingSize,
|
|
574
|
-
uom: productDetail === null || productDetail === void 0 ? void 0 : productDetail.uom,
|
|
575
|
-
uomValue: productDetail === null || productDetail === void 0 ? void 0 : productDetail.uomValue,
|
|
576
|
-
packQty: item.confirmedQty,
|
|
577
|
-
totalUomValue: `${(productDetail.uomValue * item.confirmedQty).toFixed(2)} ${productDetail.uom}`,
|
|
578
|
-
status: 'PENDING',
|
|
579
|
-
arrivalNotice,
|
|
580
|
-
domain: warehouseDomain,
|
|
581
|
-
bizplace: customerBizplace
|
|
582
|
-
};
|
|
583
|
-
orderProducts.push(orderProduct);
|
|
584
|
-
}));
|
|
585
|
-
await tx.getRepository(sales_base_1.OrderProduct).save(orderProducts);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
accountWebhookOrder.status = integration_accounting_1.ACCOUNT_SYNC_STATUS.SUCCESS;
|
|
590
|
-
await tx.getRepository(integration_accounting_1.AccountWebhookOrder).save(accountWebhookOrder);
|
|
591
|
-
});
|
|
592
|
-
context.status = 200;
|
|
593
|
-
}
|
|
594
|
-
catch (err) {
|
|
595
|
-
env_1.logger.error(`xilnex-router[webhook-xilnex-stock-request]: ${err}`);
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
async function checkExistingOrder(releaseGood, bizplace, checkDuplicationValidation = true, context, tx) {
|
|
599
|
-
const { domain } = context.state;
|
|
600
|
-
const refNo = releaseGood.refNo;
|
|
601
|
-
const refNo2 = releaseGood.refNo2;
|
|
602
|
-
const refNo3 = releaseGood.refNo3;
|
|
603
|
-
if (checkDuplicationValidation) {
|
|
604
|
-
const foundDraftReleaseGood = await tx.getRepository(sales_base_1.DraftReleaseGood).findOne({
|
|
605
|
-
where: {
|
|
606
|
-
domain,
|
|
607
|
-
refNo: refNo || null,
|
|
608
|
-
refNo2: refNo2 || null,
|
|
609
|
-
refNo3: refNo3 || null,
|
|
610
|
-
status: (0, typeorm_1.Not)((0, typeorm_1.In)([sales_base_1.DRAFT_RELEASE_ORDER_STATUS.CANCELLED]))
|
|
611
|
-
}
|
|
612
|
-
});
|
|
613
|
-
if (foundDraftReleaseGood) {
|
|
614
|
-
throw new index_1.ValidationError({
|
|
615
|
-
errorCode: 'EXISTING_ORDER',
|
|
616
|
-
message: 'existing draft release order found',
|
|
617
|
-
detail: foundDraftReleaseGood.name
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
const foundReleaseGood = await tx.getRepository(sales_base_1.ReleaseGood).findOne({
|
|
621
|
-
where: {
|
|
622
|
-
domain: domain,
|
|
623
|
-
refNo,
|
|
624
|
-
status: (0, typeorm_1.Not)((0, typeorm_1.In)([sales_base_1.ORDER_STATUS.CANCELLED, sales_base_1.ORDER_STATUS.PENDING_CANCEL]))
|
|
625
|
-
},
|
|
626
|
-
relations: ['bizplace', 'bizplace.domain', 'bizplace.company', 'bizplace.company.domain']
|
|
627
|
-
});
|
|
628
|
-
if (foundReleaseGood) {
|
|
629
|
-
throw new index_1.ValidationError({
|
|
630
|
-
errorCode: 'EXISTING_ORDER',
|
|
631
|
-
message: 'existing release order found',
|
|
632
|
-
detail: foundReleaseGood.name
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
async function massageOrderItems(releaseGood, inputOrderProducts, context) {
|
|
638
|
-
try {
|
|
639
|
-
let orderProducts = [];
|
|
640
|
-
let errorList = [];
|
|
641
|
-
let totalReleaseQty = 0;
|
|
642
|
-
//combine any repeated skus
|
|
643
|
-
inputOrderProducts = inputOrderProducts.reduce((acc, itm, idx) => {
|
|
644
|
-
let { sku, refCode } = itm.product;
|
|
645
|
-
let { packingType, packingSize, confirmedQty, orderItemId } = itm;
|
|
646
|
-
if (!sku && !refCode) {
|
|
647
|
-
errorList.push(JSON.stringify({
|
|
648
|
-
code: 'INVALID_DATA',
|
|
649
|
-
message: 'sku or refCode not found',
|
|
650
|
-
sku: sku,
|
|
651
|
-
refCode: refCode,
|
|
652
|
-
packingType: packingType === null || packingType === void 0 ? void 0 : packingType.trim(),
|
|
653
|
-
packingSize: packingSize,
|
|
654
|
-
qty: confirmedQty
|
|
655
|
-
}));
|
|
656
|
-
}
|
|
657
|
-
if (confirmedQty <= 0) {
|
|
658
|
-
errorList.push(JSON.stringify({
|
|
659
|
-
code: 'INVALID_DATA',
|
|
660
|
-
message: 'negative stock request',
|
|
661
|
-
sku: sku,
|
|
662
|
-
refCode: refCode,
|
|
663
|
-
packingType: packingType === null || packingType === void 0 ? void 0 : packingType.trim(),
|
|
664
|
-
packingSize: packingSize,
|
|
665
|
-
qty: confirmedQty
|
|
666
|
-
}));
|
|
667
|
-
}
|
|
668
|
-
let existingIndex = acc.findIndex(itm => (itm === null || itm === void 0 ? void 0 : itm.sku) == (sku === null || sku === void 0 ? void 0 : sku.trim()) &&
|
|
669
|
-
(itm === null || itm === void 0 ? void 0 : itm.refCode) == (refCode === null || refCode === void 0 ? void 0 : refCode.trim()) &&
|
|
670
|
-
(itm === null || itm === void 0 ? void 0 : itm.packingType) == (packingType === null || packingType === void 0 ? void 0 : packingType.trim()) &&
|
|
671
|
-
(itm === null || itm === void 0 ? void 0 : itm.packingSize) == packingSize &&
|
|
672
|
-
(itm === null || itm === void 0 ? void 0 : itm.refItemId) == orderItemId.trim());
|
|
673
|
-
if (existingIndex >= 0 && confirmedQty > 0) {
|
|
674
|
-
acc[existingIndex].confirmedQty = acc[existingIndex].confirmedQty + confirmedQty;
|
|
675
|
-
totalReleaseQty += confirmedQty;
|
|
676
|
-
}
|
|
677
|
-
else {
|
|
678
|
-
acc.push({
|
|
679
|
-
sku: sku === null || sku === void 0 ? void 0 : sku.trim(),
|
|
680
|
-
refCode: refCode === null || refCode === void 0 ? void 0 : refCode.trim(),
|
|
681
|
-
packingType: packingType === null || packingType === void 0 ? void 0 : packingType.trim(),
|
|
682
|
-
packingSize: packingSize,
|
|
683
|
-
releaseQty: confirmedQty,
|
|
684
|
-
refItemId: orderItemId
|
|
685
|
-
});
|
|
686
|
-
totalReleaseQty += confirmedQty;
|
|
687
|
-
}
|
|
688
|
-
return acc;
|
|
689
|
-
}, []);
|
|
690
|
-
if (errorList.length > 0) {
|
|
691
|
-
throw new index_1.ValidationError({
|
|
692
|
-
errorCode: 'INVALID_DATA',
|
|
693
|
-
message: 'invalid data',
|
|
694
|
-
detail: errorList.join(', ')
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
//find customer sku in system
|
|
698
|
-
await Promise.all(inputOrderProducts.map(async (inputOrderItem) => {
|
|
699
|
-
const sku = inputOrderItem.sku;
|
|
700
|
-
const refCode = inputOrderItem.refCode;
|
|
701
|
-
const packingType = inputOrderItem.packingType;
|
|
702
|
-
const packingSize = inputOrderItem.packingSize;
|
|
703
|
-
const qb = (0, typeorm_1.getRepository)(product_base_1.ProductDetail)
|
|
704
|
-
.createQueryBuilder('PD')
|
|
705
|
-
.innerJoinAndSelect('PD.product', 'PROD')
|
|
706
|
-
.where('PROD.bizplace_id = :bizplaceId', { bizplaceId: releaseGood.companyBizplace.id });
|
|
707
|
-
if (!sku && !refCode) {
|
|
708
|
-
context.throw(404, `error.sku ${sku} or refCode ${refCode} not found`);
|
|
709
|
-
}
|
|
710
|
-
if (refCode) {
|
|
711
|
-
qb.andWhere('PD.ref_code = :refCode', { refCode });
|
|
712
|
-
}
|
|
713
|
-
if (sku) {
|
|
714
|
-
qb.andWhere('PROD.sku = :sku', { sku });
|
|
715
|
-
}
|
|
716
|
-
if (packingType) {
|
|
717
|
-
qb.andWhere('PD.packing_type = :packingType', { packingType });
|
|
718
|
-
}
|
|
719
|
-
if ((!packingType && !refCode) || !packingSize) {
|
|
720
|
-
qb.andWhere('PD.is_default = :isDefault', { isDefault: true });
|
|
721
|
-
}
|
|
722
|
-
const productDetail = await qb.getOne();
|
|
723
|
-
// order Product based on product detail
|
|
724
|
-
if (productDetail) {
|
|
725
|
-
let newOrderProduct = Object.assign({}, inputOrderItem);
|
|
726
|
-
newOrderProduct = Object.assign(Object.assign({}, newOrderProduct), { product: productDetail.product, productDetail: productDetail, packingType: productDetail.packingType, packingSize: packingSize || productDetail.packingSize, uom: productDetail.uom, uomValue: productDetail.uomValue, refCode: inputOrderItem.refCode, releaseQty: inputOrderItem.releaseQty, releaseUomValue: inputOrderItem.releaseQty * (productDetail.uomValue || 1), packQty: 0, actualPackQty: 0, palletQty: 0, actualPalletQty: 0, type: 'RELEASE_OF_GOODS', status: sales_base_1.ORDER_PRODUCT_STATUS.ASSIGNED, batchId: '-', sellingPrice: inputOrderItem === null || inputOrderItem === void 0 ? void 0 : inputOrderItem.sellingPrice });
|
|
727
|
-
newOrderProduct.orderInventories = [
|
|
728
|
-
Object.assign(Object.assign({}, newOrderProduct), { packQty: 0, actualPackQty: 0, palletQty: 0, actualPalletQty: 0, type: 'RELEASE_OF_GOODS', status: sales_base_1.ORDER_INVENTORY_STATUS.PENDING_WORKSHEET })
|
|
729
|
-
];
|
|
730
|
-
orderProducts.push(newOrderProduct);
|
|
731
|
-
}
|
|
732
|
-
if (!productDetail) {
|
|
733
|
-
const qb = (0, typeorm_1.getRepository)(product_base_1.ProductBundle)
|
|
734
|
-
.createQueryBuilder('PB')
|
|
735
|
-
.innerJoinAndSelect('PB.productBundleSettings', 'PBS')
|
|
736
|
-
.innerJoinAndSelect('PBS.productDetail', 'PBD')
|
|
737
|
-
.innerJoinAndSelect('PBD.product', 'PROD')
|
|
738
|
-
.where('PB.bizplace_id = :bizplaceId', { bizplaceId: releaseGood.companyBizplace.id });
|
|
739
|
-
if (!sku && !refCode) {
|
|
740
|
-
context.throw(404, `error.sku ${sku} or refCode ${refCode} not found`);
|
|
741
|
-
}
|
|
742
|
-
if (refCode) {
|
|
743
|
-
qb.andWhere('PB.ref_code = :refCode', { refCode });
|
|
744
|
-
}
|
|
745
|
-
if (sku) {
|
|
746
|
-
qb.andWhere('PB.sku = :sku', { sku });
|
|
747
|
-
}
|
|
748
|
-
if (packingType) {
|
|
749
|
-
qb.andWhere('PB.packing_type = :packingType', { packingType });
|
|
750
|
-
}
|
|
751
|
-
const foundProductBundle = await qb.getOne();
|
|
752
|
-
if (foundProductBundle) {
|
|
753
|
-
let orderProduct = {
|
|
754
|
-
productBundle: foundProductBundle,
|
|
755
|
-
refCode,
|
|
756
|
-
packingType: foundProductBundle.packingType,
|
|
757
|
-
packingSize: packingSize || 1,
|
|
758
|
-
uom: inputOrderItem === null || inputOrderItem === void 0 ? void 0 : inputOrderItem.uom,
|
|
759
|
-
releaseQty: inputOrderItem.releaseQty,
|
|
760
|
-
releaseUomValue: inputOrderItem.releaseQty,
|
|
761
|
-
packQty: 0,
|
|
762
|
-
actualPackQty: 0,
|
|
763
|
-
palletQty: 0,
|
|
764
|
-
actualPalletQty: 0,
|
|
765
|
-
orderInventories: [],
|
|
766
|
-
type: 'RELEASE_OF_GOODS',
|
|
767
|
-
status: sales_base_1.ORDER_PRODUCT_STATUS.ASSIGNED,
|
|
768
|
-
batchId: '-',
|
|
769
|
-
sellingPrice: inputOrderItem === null || inputOrderItem === void 0 ? void 0 : inputOrderItem.sellingPrice
|
|
770
|
-
};
|
|
771
|
-
const bundleProductSettings = foundProductBundle.productBundleSettings;
|
|
772
|
-
bundleProductSettings.map(bundleProductSetting => {
|
|
773
|
-
const productDetailBundle = bundleProductSetting.productDetail;
|
|
774
|
-
let newOrderInventory = {
|
|
775
|
-
product: productDetailBundle.product,
|
|
776
|
-
productDetail: productDetailBundle,
|
|
777
|
-
sku: productDetailBundle.product.sku,
|
|
778
|
-
packingType: productDetailBundle.packingType,
|
|
779
|
-
packingSize: productDetailBundle.packingSize,
|
|
780
|
-
uom: productDetailBundle.uom,
|
|
781
|
-
packQty: 0,
|
|
782
|
-
actualPackQty: 0,
|
|
783
|
-
palletQty: 0,
|
|
784
|
-
actualPalletQty: 0,
|
|
785
|
-
releaseQty: inputOrderItem.confirmedQty * bundleProductSetting.bundleQty,
|
|
786
|
-
releaseUomValue: inputOrderItem.confirmedQty *
|
|
787
|
-
bundleProductSetting.bundleQty *
|
|
788
|
-
(productDetailBundle.uomValue <= 0 ? 1 : productDetailBundle.uomValue),
|
|
789
|
-
type: 'RELEASE_OF_GOODS',
|
|
790
|
-
status: sales_base_1.ORDER_INVENTORY_STATUS.PENDING_WORKSHEET
|
|
791
|
-
};
|
|
792
|
-
orderProduct.orderInventories.push(newOrderInventory);
|
|
793
|
-
});
|
|
794
|
-
orderProducts.push(orderProduct);
|
|
795
|
-
}
|
|
796
|
-
else {
|
|
797
|
-
if (sku && refCode) {
|
|
798
|
-
context.throw(404, `error.sku ${sku} and refCode ${refCode} not exist in product / bundle master`);
|
|
799
|
-
}
|
|
800
|
-
if (sku) {
|
|
801
|
-
context.throw(404, `error.sku ${sku} not exist in product / bundle master`);
|
|
802
|
-
}
|
|
803
|
-
if (refCode) {
|
|
804
|
-
context.throw(404, `error.refCode ${refCode} not exist in product / bundle master`);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
}));
|
|
809
|
-
//combine any repeated skus
|
|
810
|
-
let combinedItems = orderProducts.reduce((acc, op, idx) => {
|
|
811
|
-
let oi = (op === null || op === void 0 ? void 0 : op.orderInventories) || [];
|
|
812
|
-
oi.forEach(itm => {
|
|
813
|
-
let { sku, refCode } = itm.product;
|
|
814
|
-
let { packingType, packingSize, batchId, releaseQty, product, productDetail, uom } = itm;
|
|
815
|
-
if (!sku && !refCode) {
|
|
816
|
-
context.throw(404, `sku ${sku} or refCode ${refCode} not found`);
|
|
817
|
-
}
|
|
818
|
-
let existingIndex = acc.findIndex(itm => (itm === null || itm === void 0 ? void 0 : itm.sku) == (sku === null || sku === void 0 ? void 0 : sku.trim()) &&
|
|
819
|
-
(itm === null || itm === void 0 ? void 0 : itm.refCode) == (refCode === null || refCode === void 0 ? void 0 : refCode.trim()) &&
|
|
820
|
-
(itm === null || itm === void 0 ? void 0 : itm.packingType) == (packingType === null || packingType === void 0 ? void 0 : packingType.trim()) &&
|
|
821
|
-
(itm === null || itm === void 0 ? void 0 : itm.packingSize) == packingSize &&
|
|
822
|
-
(itm === null || itm === void 0 ? void 0 : itm.batchId) == (batchId === null || batchId === void 0 ? void 0 : batchId.trim()) &&
|
|
823
|
-
(itm === null || itm === void 0 ? void 0 : itm.uom) == (uom === null || uom === void 0 ? void 0 : uom.trim()));
|
|
824
|
-
if (existingIndex >= 0 && releaseQty > 0) {
|
|
825
|
-
acc[existingIndex].releaseQty = acc[existingIndex].releaseQty + releaseQty;
|
|
826
|
-
acc[existingIndex].releaseUomValue =
|
|
827
|
-
acc[existingIndex].releaseUomValue + releaseQty * (productDetail.uomValue <= 0 ? 1 : productDetail.uomValue);
|
|
828
|
-
}
|
|
829
|
-
else {
|
|
830
|
-
let updateObj = {
|
|
831
|
-
sku: sku === null || sku === void 0 ? void 0 : sku.trim(),
|
|
832
|
-
packingType: packingType === null || packingType === void 0 ? void 0 : packingType.trim(),
|
|
833
|
-
packingSize: packingSize,
|
|
834
|
-
uom: uom === null || uom === void 0 ? void 0 : uom.trim(),
|
|
835
|
-
releaseQty: releaseQty,
|
|
836
|
-
releaseUomValue: releaseQty * (productDetail.uomValue <= 0 ? 1 : productDetail.uomValue),
|
|
837
|
-
product,
|
|
838
|
-
productDetail
|
|
839
|
-
};
|
|
840
|
-
if (refCode)
|
|
841
|
-
updateObj['refCode'] = refCode.trim();
|
|
842
|
-
updateObj['batchId'] = batchId ? batchId === null || batchId === void 0 ? void 0 : batchId.trim() : '-';
|
|
843
|
-
acc.push(updateObj);
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
return acc;
|
|
847
|
-
}, []);
|
|
848
|
-
return { orderProducts, combinedItems };
|
|
849
|
-
}
|
|
850
|
-
catch (error) {
|
|
851
|
-
throw error;
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
async function assignToInventory(orderProducts, customerBizplace, warehouseDomain, context, tx) {
|
|
855
|
-
const { client, domain, user } = context.state;
|
|
856
|
-
for (let opIdx = 0; opIdx < orderProducts.length; opIdx++) {
|
|
857
|
-
let orderProduct = orderProducts[opIdx];
|
|
858
|
-
let assignedOrderInventories = [];
|
|
859
|
-
const pickingProductSetting = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
860
|
-
where: { domain, name: 'rule-for-picking-product' }
|
|
861
|
-
});
|
|
862
|
-
const orderInventory = orderProduct.orderInventories[0];
|
|
863
|
-
let sortings = [];
|
|
864
|
-
switch (orderInventory.product.pickingStrategy) {
|
|
865
|
-
case 'LIFO':
|
|
866
|
-
sortings.push({ name: 'iv.created_at', desc: true });
|
|
867
|
-
if (pickingProductSetting === null || pickingProductSetting === void 0 ? void 0 : pickingProductSetting.value) {
|
|
868
|
-
for (const [key, value] of Object.entries(JSON.parse(pickingProductSetting.value))) {
|
|
869
|
-
sortings.push({ name: `loc.${key}`, desc: value == 'DESC' ? true : false });
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
else {
|
|
873
|
-
sortings.push({ name: 'loc.name', desc: false }, { name: 'iv.created_at', desc: false });
|
|
874
|
-
}
|
|
875
|
-
break;
|
|
876
|
-
case 'FEFO':
|
|
877
|
-
sortings.push({ name: 'iv.expiration_date', desc: false }, { name: 'iv.created_at', desc: false });
|
|
878
|
-
if (pickingProductSetting === null || pickingProductSetting === void 0 ? void 0 : pickingProductSetting.value) {
|
|
879
|
-
for (const [key, value] of Object.entries(JSON.parse(pickingProductSetting.value))) {
|
|
880
|
-
sortings.push({ name: `loc.${key}`, desc: value == 'DESC' ? true : false });
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
else {
|
|
884
|
-
sortings.push({ name: 'loc.name', desc: false }, { name: 'iv.created_at', desc: false });
|
|
885
|
-
}
|
|
886
|
-
break;
|
|
887
|
-
case 'FMFO':
|
|
888
|
-
sortings.push({ name: 'iv.manufacture_date', desc: false }, { name: 'iv.created_at', desc: false });
|
|
889
|
-
if (pickingProductSetting === null || pickingProductSetting === void 0 ? void 0 : pickingProductSetting.value) {
|
|
890
|
-
for (const [key, value] of Object.entries(JSON.parse(pickingProductSetting.value))) {
|
|
891
|
-
sortings.push({ name: `loc.${key}`, desc: value == 'DESC' ? true : false });
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
sortings.push({ name: 'loc.name', desc: false }, { name: 'iv.created_at', desc: false });
|
|
896
|
-
}
|
|
897
|
-
break;
|
|
898
|
-
case 'LOCATION':
|
|
899
|
-
if (pickingProductSetting === null || pickingProductSetting === void 0 ? void 0 : pickingProductSetting.value) {
|
|
900
|
-
for (const [key, value] of Object.entries(JSON.parse(pickingProductSetting.value))) {
|
|
901
|
-
sortings.push({ name: `loc.${key}`, desc: value == 'DESC' ? true : false });
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
else {
|
|
905
|
-
sortings.push({ name: 'loc.name', desc: false }, { name: 'iv.created_at', desc: false });
|
|
906
|
-
}
|
|
907
|
-
break;
|
|
908
|
-
//Every other case includes 'FIFO' will be applicable for this case
|
|
909
|
-
default:
|
|
910
|
-
sortings.push({ name: 'iv.created_at', desc: false });
|
|
911
|
-
if (pickingProductSetting === null || pickingProductSetting === void 0 ? void 0 : pickingProductSetting.value) {
|
|
912
|
-
for (const [key, value] of Object.entries(JSON.parse(pickingProductSetting.value))) {
|
|
913
|
-
sortings.push({ name: `loc.${key}`, desc: value == 'DESC' ? true : false });
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
else {
|
|
917
|
-
sortings.push({ name: 'loc.name', desc: false });
|
|
918
|
-
sortings.push({ name: 'iv.pallet_id', desc: false });
|
|
919
|
-
}
|
|
920
|
-
break;
|
|
921
|
-
}
|
|
922
|
-
let queryFilters = [];
|
|
923
|
-
let queryStrings = queryFilters.reduce((acc, itm, idx, arr) => {
|
|
924
|
-
acc.values.push(itm.filters);
|
|
925
|
-
switch (itm === null || itm === void 0 ? void 0 : itm.operator) {
|
|
926
|
-
case 'notin':
|
|
927
|
-
case 'in':
|
|
928
|
-
acc.query.push(`${itm.query} ${itm.operator == 'notin' ? 'NOT IN' : 'IN'} (${itm.filtes
|
|
929
|
-
.map((itm, idx) => {
|
|
930
|
-
return `$${acc.values.length + 1}`;
|
|
931
|
-
})
|
|
932
|
-
.join(',')})`);
|
|
933
|
-
break;
|
|
934
|
-
default:
|
|
935
|
-
acc.query.push(`${itm.query} ${(itm === null || itm === void 0 ? void 0 : itm.operator) ? itm.operator : '='} $${acc.values.length + 1}`);
|
|
936
|
-
break;
|
|
937
|
-
}
|
|
938
|
-
acc.query.push(`${itm.query} ${(itm === null || itm === void 0 ? void 0 : itm.operator) ? itm.operator : '='} $${acc.values.length + 1}`);
|
|
939
|
-
}, {
|
|
940
|
-
query: [],
|
|
941
|
-
values: []
|
|
942
|
-
});
|
|
943
|
-
let sortQuery = sortings
|
|
944
|
-
.map(itm => {
|
|
945
|
-
return `${itm.name} ${itm.desc ? 'DESC' : 'ASC'}`;
|
|
946
|
-
})
|
|
947
|
-
.join(`,`);
|
|
948
|
-
let updatedInventories = await tx.getRepository(warehouse_base_1.Inventory).query(`
|
|
949
|
-
update inventories tgt set locked_qty = coalesce(locked_qty,0) + src.reserve_qty,
|
|
950
|
-
locked_uom_value = coalesce(locked_uom_value,0) + src.reserve_uom_value,
|
|
951
|
-
updated_at = NOW(),
|
|
952
|
-
updater_id = $1
|
|
953
|
-
from (
|
|
954
|
-
select "id", "pallet_id","carton_id", "batch_id", "batch_id_ref", "unit", "uom", "packing_type", "packing_size", "manufacture_year",
|
|
955
|
-
"reserve_qty", (("uom_value"/"qty") * "reserve_qty") as "reserve_uom_value" from (
|
|
956
|
-
select "sort_seq", "id", "pallet_id", "batch_id", "batch_id_ref", "unit", "uom", "packing_type", "packing_size", "manufacture_year", "carton_id", "uom_value", "locked_uom_value", "qty", "locked_qty", "created_at",
|
|
957
|
-
"release_qty", "release_uom_value", lock_amount,
|
|
958
|
-
case when "lock_amount" < 0 then "available_qty" else "available_qty" - "lock_amount" end as "reserve_qty"
|
|
959
|
-
from (
|
|
960
|
-
select *,
|
|
961
|
-
qty - locked_qty as available_qty,
|
|
962
|
-
sum(qty - locked_qty - release_qty) over (order by sort_seq asc rows between unbounded preceding and current row) as lock_amount
|
|
963
|
-
from (
|
|
964
|
-
SELECT 0 as sort_seq, null as id, null as pallet_id, null as batch_id, null as batch_id_ref,
|
|
965
|
-
null as unit, '${orderInventory.uom}' as uom, '${orderInventory.packingType}' as packing_type, '${orderInventory.packingSize}' as packing_size,
|
|
966
|
-
null as manufacture_year, null as carton_id, 0 as uom_value, 0 as locked_uom_value, 0 as qty, 0 as locked_qty, null as created_at,
|
|
967
|
-
'${orderInventory.releaseQty}' as release_qty, '${orderInventory.releaseUomValue}' as release_uom_value
|
|
968
|
-
UNION
|
|
969
|
-
(
|
|
970
|
-
SELECT ROW_NUMBER() OVER(PARTITION BY iv.domain_id ORDER BY ${sortQuery}) as sort_seq,
|
|
971
|
-
iv.id, iv.pallet_id, iv.batch_id, iv.batch_id_ref,
|
|
972
|
-
iv.unit, iv.uom, iv.packing_type, iv.packing_size,
|
|
973
|
-
iv.manufacture_year, iv.carton_id, iv.uom_value,
|
|
974
|
-
coalesce(iv.locked_uom_value,0) as locked_uom_value, iv.qty, coalesce(iv.locked_qty,0) as locked_qty, iv.created_at,
|
|
975
|
-
0 as release_qty, 0 as release_uom_value
|
|
976
|
-
FROM "inventories" "iv"
|
|
977
|
-
INNER JOIN "locations" "loc" ON "loc"."id"="iv"."location_id"
|
|
978
|
-
INNER JOIN "products" "p" ON "p"."id"="iv"."product_id"
|
|
979
|
-
WHERE case when coalesce("iv"."locked_qty",0) < 0 then 0 else ("iv"."qty" - coalesce("iv"."locked_qty",0)) end > 0 AND
|
|
980
|
-
"iv"."domain_id" = $2 AND "iv"."bizplace_id" = $3 AND "iv"."packing_type" = $4 AND "iv"."packing_size" = $5 AND "iv"."product_id" = $6 AND "iv"."status" = $7 AND "loc"."type" NOT IN ($8, $9)
|
|
981
|
-
AND "iv"."obsolete" = false AND case when "iv"."expiration_date" is not null and "p"."min_outbound_shelf_life" is not null then CURRENT_DATE < "iv"."expiration_date" - "p"."min_outbound_shelf_life" else true end
|
|
982
|
-
${queryStrings.query.length > 0 ? `AND ${queryStrings.join(' AND ')}` : ''}
|
|
983
|
-
ORDER BY ${sortQuery}
|
|
984
|
-
)
|
|
985
|
-
) dt1
|
|
986
|
-
) dt2 where case when "lock_amount" < 0 then "available_qty" else "available_qty" - "lock_amount" end > 0
|
|
987
|
-
) dt3 where sort_seq > 0
|
|
988
|
-
) src where src.id = tgt.id
|
|
989
|
-
returning
|
|
990
|
-
tgt."id", tgt."qty", tgt."pallet_id", tgt."carton_id", tgt."batch_id", tgt."batch_id_ref", tgt."unit",
|
|
991
|
-
tgt."uom", tgt."packing_type", tgt."packing_size", tgt."manufacture_year",
|
|
992
|
-
tgt."locked_qty", tgt."uom_value", tgt."locked_uom_value", src."reserve_qty", src."reserve_uom_value";`, [
|
|
993
|
-
(user === null || user === void 0 ? void 0 : user.id) || null,
|
|
994
|
-
warehouseDomain.id,
|
|
995
|
-
customerBizplace.id,
|
|
996
|
-
orderInventory.packingType,
|
|
997
|
-
orderInventory.packingSize,
|
|
998
|
-
orderInventory.product.id,
|
|
999
|
-
warehouse_base_1.INVENTORY_STATUS.STORED,
|
|
1000
|
-
warehouse_base_1.LOCATION_TYPE.QUARANTINE,
|
|
1001
|
-
warehouse_base_1.LOCATION_TYPE.RESERVE,
|
|
1002
|
-
...queryStrings.values
|
|
1003
|
-
]);
|
|
1004
|
-
let totalAssigned = updatedInventories[0].reduce((acc, inv) => {
|
|
1005
|
-
return acc + inv.reserve_qty;
|
|
1006
|
-
}, 0);
|
|
1007
|
-
if (orderProduct.releaseQty != totalAssigned) {
|
|
1008
|
-
throw new index_1.ValidationError({
|
|
1009
|
-
errorCode: 'INSUFFICIENT_STOCK',
|
|
1010
|
-
message: 'insufficient stock',
|
|
1011
|
-
detail: JSON.stringify({
|
|
1012
|
-
code: 'insufficient stock',
|
|
1013
|
-
sku: orderProduct.product.sku,
|
|
1014
|
-
packingType: orderProduct.packingType,
|
|
1015
|
-
packingSize: orderProduct.packingSize,
|
|
1016
|
-
uom: orderProduct.uom,
|
|
1017
|
-
qty: orderProduct.releaseQty,
|
|
1018
|
-
uom_value: orderProduct.releaseUomValue
|
|
1019
|
-
})
|
|
1020
|
-
});
|
|
1021
|
-
}
|
|
1022
|
-
updatedInventories[0].forEach(inv => {
|
|
1023
|
-
let oi = Object.assign(Object.assign({}, orderInventory), { inventory: { id: inv.id }, uom: inv.uom, packingType: inv.packing_type, batchId: inv.batch_id, releaseQty: inv.reserve_qty, releaseUomValue: inv.reserve_uom_value, pickedQty: 0, packedQty: 0, type: sales_base_1.ORDER_TYPES.RELEASE_OF_GOODS, status: sales_base_1.ORDER_INVENTORY_STATUS.PENDING_WORKSHEET, domain: { id: warehouseDomain.id }, bizplace: { id: customerBizplace.id } });
|
|
1024
|
-
assignedOrderInventories.push(oi);
|
|
1025
|
-
});
|
|
1026
|
-
orderProducts[opIdx].orderInventories = assignedOrderInventories;
|
|
1027
|
-
}
|
|
1028
|
-
return orderProducts;
|
|
1029
|
-
}
|
|
1030
|
-
async function createReleaseGood(releaseGood, orderProducts, bizplace, domain, context, tx) {
|
|
1031
|
-
try {
|
|
1032
|
-
if (orderProducts.length <= 0) {
|
|
1033
|
-
throw new index_1.ValidationError({
|
|
1034
|
-
errorCode: 'ITEM_NOT_FOUND',
|
|
1035
|
-
message: 'no order items found',
|
|
1036
|
-
detail: JSON.stringify(releaseGood)
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
let newReleaseGood = new sales_base_1.ReleaseGood();
|
|
1040
|
-
// find RO number rule setting
|
|
1041
|
-
const roNoSetting = await tx.getRepository(setting_base_1.Setting).findOne({
|
|
1042
|
-
where: {
|
|
1043
|
-
domain,
|
|
1044
|
-
name: sales_base_1.ORDER_NUMBER_SETTING_KEY.RO_NUMBER_RULE
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
newReleaseGood = {
|
|
1048
|
-
name: roNoSetting
|
|
1049
|
-
? await (0, id_rule_base_1.generateId)({ domain, type: sales_base_1.ORDER_NUMBER_RULE_TYPE.RO_NUMBER, seed: {} })
|
|
1050
|
-
: sales_base_1.OrderNoGenerator.releaseGood(),
|
|
1051
|
-
domain: domain,
|
|
1052
|
-
bizplace: bizplace,
|
|
1053
|
-
collectionOrderNo: releaseGood.collectionOrderNo,
|
|
1054
|
-
courierOption: releaseGood.courierOption,
|
|
1055
|
-
exportOption: releaseGood.exportOption,
|
|
1056
|
-
ownTransport: releaseGood.ownTransport,
|
|
1057
|
-
packingOption: releaseGood.packingOption,
|
|
1058
|
-
marketplaceOrderStatus: (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.marketplaceOrderStatus) || null,
|
|
1059
|
-
refNo: releaseGood.refNo,
|
|
1060
|
-
refNo2: releaseGood.refNo2 || null,
|
|
1061
|
-
refNo3: releaseGood.refNo3 || null,
|
|
1062
|
-
remark: (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.remark) || null,
|
|
1063
|
-
releaseDate: releaseGood.releaseDate,
|
|
1064
|
-
truckNo: releaseGood.truckNo,
|
|
1065
|
-
type: (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.type) ? releaseGood.type : 'b2b',
|
|
1066
|
-
status: sales_base_1.ORDER_STATUS.PENDING_WORKSHEET,
|
|
1067
|
-
noOfItems: orderProducts.length,
|
|
1068
|
-
source: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.source,
|
|
1069
|
-
paidAmount: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.paidAmount,
|
|
1070
|
-
discountAmount: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.discountAmount,
|
|
1071
|
-
taxAmount: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.taxAmount,
|
|
1072
|
-
shippingFee: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.shippingFee,
|
|
1073
|
-
acceptedAt: new Date()
|
|
1074
|
-
};
|
|
1075
|
-
let resultReleaseGood = await tx.getRepository(sales_base_1.ReleaseGood).save(newReleaseGood);
|
|
1076
|
-
let combinedOrderInventories = [];
|
|
1077
|
-
let savedOrderProducts = await Promise.all(orderProducts.map(async (orderProduct) => {
|
|
1078
|
-
let orderInventories = orderProduct.orderInventories;
|
|
1079
|
-
orderProduct = Object.assign(new sales_base_1.OrderProduct(), Object.assign(Object.assign({}, orderProduct), { name: (0, uuid_1.v4)(), domain: domain, bizplace: bizplace, releaseGood: resultReleaseGood, type: sales_base_1.ORDER_TYPES.RELEASE_OF_GOODS, status: sales_base_1.ORDER_PRODUCT_STATUS.ASSIGNED }));
|
|
1080
|
-
let result = await tx.getRepository(sales_base_1.OrderProduct).save(orderProduct);
|
|
1081
|
-
for (let oiIdx = 0; oiIdx < orderInventories.length; oiIdx++) {
|
|
1082
|
-
let orderInventory = Object.assign(new sales_base_1.OrderInventory(), Object.assign(Object.assign({}, orderInventories[oiIdx]), { name: (0, uuid_1.v4)(), domain: domain, bizplace: bizplace, releaseGood: resultReleaseGood, type: sales_base_1.ORDER_TYPES.RELEASE_OF_GOODS, status: sales_base_1.ORDER_INVENTORY_STATUS.PENDING_WORKSHEET, orderProduct: result }));
|
|
1083
|
-
await tx.getRepository(sales_base_1.OrderInventory).save(orderInventory);
|
|
1084
|
-
combinedOrderInventories.push({
|
|
1085
|
-
product: { name: orderInventory.product.name, sku: orderInventory.product.sku },
|
|
1086
|
-
batchId: orderInventory.batchId,
|
|
1087
|
-
packingType: orderInventory.packingType,
|
|
1088
|
-
packingSize: orderInventory.packingSize,
|
|
1089
|
-
releaseQty: orderInventory.releaseQty,
|
|
1090
|
-
releaseUomValue: orderInventory.releaseUomValue
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
return result;
|
|
1094
|
-
}));
|
|
1095
|
-
newReleaseGood.orderProducts = savedOrderProducts;
|
|
1096
|
-
newReleaseGood.orderInventories = combinedOrderInventories;
|
|
1097
|
-
return newReleaseGood;
|
|
1098
|
-
}
|
|
1099
|
-
catch (error) {
|
|
1100
|
-
throw error;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
//# sourceMappingURL=xilnex-router.js.map
|