@things-factory/operato-hub 6.0.0 → 6.0.3
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/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -46
- package/dist-server/entities/email-attachment.js +0 -77
- 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 -90
- package/dist-server/entities/email.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 -197
- package/dist-server/graphql/resolvers/email/send-emails.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +0 -200
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/index.js +0 -7
- 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/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 -13
- 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/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-marketplace-order.js +0 -197
- package/dist-server/routers/api/restful-apis/v1/company/add-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/add-products.js +0 -79
- package/dist-server/routers/api/restful-apis/v1/company/add-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/cancel-marketplace-order.js +0 -90
- package/dist-server/routers/api/restful-apis/v1/company/cancel-marketplace-order.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-marketplace-order-shipping-list.js +0 -98
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-order-shipping-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-store-list.js +0 -51
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-store-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-list.js +0 -99
- 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/index.js +0 -15
- package/dist-server/routers/api/restful-apis/v1/company/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-order-delivered.js +0 -62
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-order-delivered.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-shipping-order.js +0 -40
- package/dist-server/routers/api/restful-apis/v1/company/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 -23
- 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 -563
- 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 -66
- 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 -236
- 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 -801
- 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/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 -192
- 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/get-delivery-order-list.js +0 -138
- 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-goods-received-note-list.js +0 -97
- 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-inbound-order-details.js +0 -81
- 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 -94
- 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-product-group-list.js +0 -87
- 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-onhand-inventory-list.js +0 -87
- 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 -96
- 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 -110
- 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/index.js +0 -16
- package/dist-server/routers/api/restful-apis/v1/warehouse/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-release-order-details.js +0 -71
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-release-order-details.js.map +0 -1
- package/dist-server/routers/xilnex-router.js +0 -1104
- package/dist-server/routers/xilnex-router.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-delivery-order-list.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-delivery-order-list.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,qCAAgD;AAEhD,6CAAgE;AAChE,2DAA0D;AAE1D,oDAAyF;AACzF,gDAA4F;AAE5F,sBAAM,CAAC,GAAG,CACR,uCAAuC,EACvC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF,uCAAuC;QACvC,kCAAkC;QAClC,IAAI,MAAM,qBAAQ,OAAO,CAAC,KAAK,CAAE,CAAA;QACjC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QAClD,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;QACzC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;QAC3B,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;YAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAA;SACtB;QACD,MAAM,CAAC,WAAW,CAAC,GAAG,IAAA,iBAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAE/C,OAAO,MAAM,CAAC,UAAU,CAAC,CAAA;QACzB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAA;QACvB,OAAO,MAAM,CAAC,OAAO,CAAC,CAAA;QACtB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAA;QACvB,MAAM,CAAC,cAAc,EAAE,UAAU,CAAC,GAAoB,MAAM,IAAA,uBAAa,EAAC,0BAAa,CAAC,CAAC,YAAY,CAAC;YACpG,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,CAAC,aAAa,EAAE,8BAA8B,EAAE,U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CAAC,SAAS;oBAC9C,aAAa,EAAE,EAAE;iBAClB;gBACD,gBAAgB;aACjB,CAAA;YACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACrB;QAED,OAAO,CAAC,IAAI,GAAG;YACb,IAAI;YACJ,UAAU;YACV,KAAK;YACL,MAAM;SACP,CAAA;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,YAAY,qBAAQ;YAAE,IAAA,4BAAe,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const typeorm_1 = require("typeorm");
|
|
4
|
-
const api_1 = require("@things-factory/api");
|
|
5
|
-
const sales_base_1 = require("@things-factory/sales-base");
|
|
6
|
-
const error_util_1 = require("../utils/error-util");
|
|
7
|
-
const middlewares_1 = require("../middlewares");
|
|
8
|
-
api_1.restfulApiRouter.get('/v1/warehouse/get-goods-received-note-list', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
9
|
-
try {
|
|
10
|
-
// get contact points for that bizplace
|
|
11
|
-
// optional query parameter filter
|
|
12
|
-
let filter = Object.assign({}, context.query);
|
|
13
|
-
const { limit, offset, fromDate, toDate } = filter;
|
|
14
|
-
filter['bizplace'] = filter['bizplaceId'];
|
|
15
|
-
delete filter['bizplaceId'];
|
|
16
|
-
filter['createdAt'] = (0, typeorm_1.Between)(fromDate, toDate);
|
|
17
|
-
delete filter['fromDate'];
|
|
18
|
-
delete filter['toDate'];
|
|
19
|
-
delete filter['limit'];
|
|
20
|
-
delete filter['offset'];
|
|
21
|
-
const [goodsReceivedNotes, totalCount] = await (0, typeorm_1.getRepository)(sales_base_1.GoodsReceivalNote).findAndCount({
|
|
22
|
-
where: filter,
|
|
23
|
-
relations: [
|
|
24
|
-
'bizplace',
|
|
25
|
-
'domain',
|
|
26
|
-
'arrivalNotice',
|
|
27
|
-
'arrivalNotice.orderProducts',
|
|
28
|
-
'arrivalNotice.orderProducts.product'
|
|
29
|
-
],
|
|
30
|
-
skip: offset,
|
|
31
|
-
take: limit,
|
|
32
|
-
order: { createdAt: 'DESC' }
|
|
33
|
-
});
|
|
34
|
-
// create and format data response
|
|
35
|
-
let data = [];
|
|
36
|
-
for (const goodsReceivedNote of goodsReceivedNotes) {
|
|
37
|
-
let orderProducts = [];
|
|
38
|
-
for (const orderProduct of goodsReceivedNote.arrivalNotice.orderProducts) {
|
|
39
|
-
const orderProductsDataPoint = {
|
|
40
|
-
product: {
|
|
41
|
-
sku: orderProduct.product.sku,
|
|
42
|
-
brandSku: orderProduct.product.brandSku,
|
|
43
|
-
name: orderProduct.product.name,
|
|
44
|
-
description: orderProduct.product.description
|
|
45
|
-
},
|
|
46
|
-
type: orderProduct.type,
|
|
47
|
-
batchId: orderProduct.batchId,
|
|
48
|
-
packingType: orderProduct.packingType,
|
|
49
|
-
packingSize: orderProduct.packingSize,
|
|
50
|
-
releaseQty: orderProduct.releaseQty,
|
|
51
|
-
releaseUomValue: orderProduct.releaseUomValue,
|
|
52
|
-
status: orderProduct.status
|
|
53
|
-
};
|
|
54
|
-
orderProducts.push(orderProductsDataPoint);
|
|
55
|
-
}
|
|
56
|
-
const datapoint = {
|
|
57
|
-
id: goodsReceivedNote.id,
|
|
58
|
-
grnNo: goodsReceivedNote.grnNo,
|
|
59
|
-
refNo: goodsReceivedNote.refNo,
|
|
60
|
-
customerStatus: goodsReceivedNote.customerStatus,
|
|
61
|
-
status: goodsReceivedNote.status,
|
|
62
|
-
bizplace: {
|
|
63
|
-
id: goodsReceivedNote.bizplace.id,
|
|
64
|
-
name: goodsReceivedNote.bizplace.name,
|
|
65
|
-
description: goodsReceivedNote.bizplace.description
|
|
66
|
-
},
|
|
67
|
-
domain: {
|
|
68
|
-
id: goodsReceivedNote.domain.id,
|
|
69
|
-
name: goodsReceivedNote.domain.name
|
|
70
|
-
},
|
|
71
|
-
arrivalNotice: {
|
|
72
|
-
id: goodsReceivedNote.arrivalNotice.id,
|
|
73
|
-
ganNo: goodsReceivedNote.arrivalNotice.ganNo,
|
|
74
|
-
status: goodsReceivedNote.arrivalNotice.status,
|
|
75
|
-
refNo: goodsReceivedNote.arrivalNotice.refNo,
|
|
76
|
-
refNo2: goodsReceivedNote.arrivalNotice.refNo2,
|
|
77
|
-
refNo3: goodsReceivedNote.arrivalNotice.refNo3,
|
|
78
|
-
orderProducts
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
data.push(datapoint);
|
|
82
|
-
}
|
|
83
|
-
context.body = {
|
|
84
|
-
data,
|
|
85
|
-
totalCount,
|
|
86
|
-
limit,
|
|
87
|
-
offset
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
if (e instanceof error_util_1.ApiError)
|
|
92
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
93
|
-
else
|
|
94
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=get-goods-received-note-list.js.map
|
package/dist-server/routers/api/restful-apis/v1/warehouse/get-goods-received-note-list.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-goods-received-note-list.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-goods-received-note-list.ts"],"names":[],"mappings":";;AAAA,qCAAgD;AAEhD,6CAAgE;AAChE,2DAA8D;AAE9D,oDAAyF;AACzF,gDAA4F;AAE5F,sBAAM,CAAC,GAAG,CACR,4CAA4C,EAC5C,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF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Aa,CAAC,MAAM;oBAC9C,MAAM,EAAE,iBAAiB,CAAC,aAAa,CAAC,MAAM;oBAC9C,aAAa;iBACd;aACF,CAAA;YACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACrB;QAED,OAAO,CAAC,IAAI,GAAG;YACb,IAAI;YACJ,UAAU;YACV,KAAK;YACL,MAAM;SACP,CAAA;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,YAAY,qBAAQ;YAAE,IAAA,4BAAe,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,81 +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
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const api_1 = require("@things-factory/api");
|
|
8
|
-
const sales_base_1 = require("@things-factory/sales-base");
|
|
9
|
-
const error_util_1 = require("../utils/error-util");
|
|
10
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
11
|
-
const middlewares_1 = require("../middlewares");
|
|
12
|
-
api_1.restfulApiRouter.get('/v1/warehouse/get-inbound-order-details', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
13
|
-
var _a, _b, _c, _d;
|
|
14
|
-
try {
|
|
15
|
-
// get contact points for that bizplace
|
|
16
|
-
// optional query parameter filter
|
|
17
|
-
let filter = Object.assign({}, context.query);
|
|
18
|
-
filter['bizplace'] = filter['bizplaceId'];
|
|
19
|
-
delete filter['bizplaceId'];
|
|
20
|
-
if (lodash_1.default.has(filter, 'ganNo')) {
|
|
21
|
-
filter['name'] = filter['ganNo'];
|
|
22
|
-
delete filter['ganNo'];
|
|
23
|
-
}
|
|
24
|
-
const arrivalNotice = await (0, typeorm_1.getRepository)(sales_base_1.ArrivalNotice).findOne({
|
|
25
|
-
where: filter,
|
|
26
|
-
relations: ['orderProducts', 'orderProducts.product']
|
|
27
|
-
});
|
|
28
|
-
if (!arrivalNotice) {
|
|
29
|
-
throw new error_util_1.ApiError('E04', 'arrival notice');
|
|
30
|
-
}
|
|
31
|
-
// create and format data response
|
|
32
|
-
let orderProducts = [];
|
|
33
|
-
for (const orderProduct of arrivalNotice.orderProducts) {
|
|
34
|
-
const orderProductsDataPoint = {
|
|
35
|
-
product: {
|
|
36
|
-
sku: orderProduct.product.sku,
|
|
37
|
-
uom: orderProduct.product.uom,
|
|
38
|
-
uomValue: orderProduct.product.uomValue
|
|
39
|
-
},
|
|
40
|
-
batchId: orderProduct.batchId,
|
|
41
|
-
packingType: orderProduct.packingType,
|
|
42
|
-
packingSize: orderProduct.packingSize,
|
|
43
|
-
qty: orderProduct.packQty,
|
|
44
|
-
palletQty: orderProduct.palletQty
|
|
45
|
-
};
|
|
46
|
-
orderProducts.push(orderProductsDataPoint);
|
|
47
|
-
}
|
|
48
|
-
const data = {
|
|
49
|
-
id: arrivalNotice.id,
|
|
50
|
-
ganNo: arrivalNotice.name,
|
|
51
|
-
refNo: arrivalNotice.refNo,
|
|
52
|
-
refNo2: arrivalNotice.refNo2,
|
|
53
|
-
refNo3: arrivalNotice.refNo3,
|
|
54
|
-
etaDate: arrivalNotice.etaDate,
|
|
55
|
-
ownTransport: arrivalNotice.ownTransport,
|
|
56
|
-
importCargo: arrivalNotice.importCargo,
|
|
57
|
-
container: arrivalNotice.container,
|
|
58
|
-
truckNo: arrivalNotice.truckNo,
|
|
59
|
-
deliveryOrderNo: arrivalNotice.deliveryOrderNo,
|
|
60
|
-
containerNo: arrivalNotice.containerNo,
|
|
61
|
-
containerSize: arrivalNotice.containerSize,
|
|
62
|
-
orderProducts,
|
|
63
|
-
supplier: {
|
|
64
|
-
name: ((_a = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _a === void 0 ? void 0 : _a.name) || null,
|
|
65
|
-
companyName: ((_b = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _b === void 0 ? void 0 : _b.companyName) || null,
|
|
66
|
-
email: ((_c = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _c === void 0 ? void 0 : _c.email) || null,
|
|
67
|
-
accountNo: ((_d = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _d === void 0 ? void 0 : _d.accountNo) || null
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
context.body = {
|
|
71
|
-
data
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
if (e instanceof error_util_1.ApiError)
|
|
76
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
77
|
-
else
|
|
78
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
//# sourceMappingURL=get-inbound-order-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-inbound-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-inbound-order-details.ts"],"names":[],"mappings":";;;;;AAAA,qCAAuC;AAEvC,6CAAgE;AAChE,2DAA0D;AAE1D,oDAAyF;AACzF,oDAAsB;AACtB,gDAA4F;AAE5F,sBAAM,CAAC,GAAG,CACR,yCAAyC,EACzC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;;IACtB,IAAI;QACF,uCAAuC;QACvC,kCAAkC;QAClC,IAAI,MAAM,qBAAQ,OAAO,CAAC,KAAK,CAAE,CAAA;QACjC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,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,EAAE,aAAa,CAAC,MAAM;YAC5B,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,SAAS,EAAE,aAAa,CAAC,SAAS;YAClC,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,eAAe,EAAE,aAAa,CAAC,eAAe;YAC9C,WAAW,EAAE,aAAa,CAAC,WAAW;YACtC,aAAa,EAAE,aAAa,CAAC,aAAa;YAC1C,aAAa;YACb,QAAQ,EAAE;gBACR,IAAI,EAAE,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,IAAI,KAAI,IAAI;gBAC3C,WAAW,EAAE,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,WAAW,KAAI,IAAI;gBACzD,KAAK,EAAE,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,KAAK,KAAI,IAAI;gBAC7C,SAAS,EAAE,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,SAAS,KAAI,IAAI;aACtD;SACF,CAAA;QAED,OAAO,CAAC,IAAI,GAAG;YACb,IAAI;SACL,CAAA;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,YAAY,qBAAQ;YAAE,IAAA,4BAAe,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,94 +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
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const api_1 = require("@things-factory/api");
|
|
8
|
-
const sales_base_1 = require("@things-factory/sales-base");
|
|
9
|
-
const error_util_1 = require("../utils/error-util");
|
|
10
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
11
|
-
const middlewares_1 = require("../middlewares");
|
|
12
|
-
api_1.restfulApiRouter.get('/v1/warehouse/get-inbound-order-list', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
13
|
-
var _a, _b, _c, _d;
|
|
14
|
-
try {
|
|
15
|
-
// get contact points for that bizplace
|
|
16
|
-
// optional query parameter filter
|
|
17
|
-
let filter = Object.assign({}, context.query);
|
|
18
|
-
const { fromDate, toDate, offset, limit } = filter;
|
|
19
|
-
filter['bizplace'] = filter['bizplaceId'];
|
|
20
|
-
delete filter['bizplaceId'];
|
|
21
|
-
if (lodash_1.default.has(filter, 'ganNo')) {
|
|
22
|
-
filter['name'] = filter['ganNo'];
|
|
23
|
-
delete filter['ganNo'];
|
|
24
|
-
}
|
|
25
|
-
filter['createdAt'] = (0, typeorm_1.Between)(fromDate, toDate);
|
|
26
|
-
delete filter['fromDate'];
|
|
27
|
-
delete filter['toDate'];
|
|
28
|
-
delete filter['limit'];
|
|
29
|
-
delete filter['offset'];
|
|
30
|
-
const [arrivalNotices, totalCount] = await (0, typeorm_1.getRepository)(sales_base_1.ArrivalNotice).findAndCount({
|
|
31
|
-
where: filter,
|
|
32
|
-
relations: ['orderProducts', 'orderProducts.product'],
|
|
33
|
-
skip: offset,
|
|
34
|
-
take: limit,
|
|
35
|
-
order: { createdAt: 'DESC' }
|
|
36
|
-
});
|
|
37
|
-
// create and format data response
|
|
38
|
-
let data = [];
|
|
39
|
-
for (const arrivalNotice of arrivalNotices) {
|
|
40
|
-
let orderProducts = [];
|
|
41
|
-
for (const orderProduct of arrivalNotice.orderProducts) {
|
|
42
|
-
const orderProductsDataPoint = {
|
|
43
|
-
product: {
|
|
44
|
-
sku: orderProduct.product.sku,
|
|
45
|
-
uom: orderProduct.product.uom,
|
|
46
|
-
uomValue: orderProduct.product.uomValue
|
|
47
|
-
},
|
|
48
|
-
batchId: orderProduct.batchId,
|
|
49
|
-
packingType: orderProduct.packingType,
|
|
50
|
-
packingSize: orderProduct.packingSize,
|
|
51
|
-
qty: orderProduct.packQty,
|
|
52
|
-
palletQty: orderProduct.palletQty
|
|
53
|
-
};
|
|
54
|
-
orderProducts.push(orderProductsDataPoint);
|
|
55
|
-
}
|
|
56
|
-
const datapoint = {
|
|
57
|
-
id: arrivalNotice.id,
|
|
58
|
-
ganNo: arrivalNotice.ganNo,
|
|
59
|
-
refNo: arrivalNotice.refNo,
|
|
60
|
-
refNo2: arrivalNotice.refNo2,
|
|
61
|
-
refNo3: arrivalNotice.refNo3,
|
|
62
|
-
etaDate: arrivalNotice.etaDate,
|
|
63
|
-
ownTransport: arrivalNotice.ownTransport,
|
|
64
|
-
importCargo: arrivalNotice.importCargo,
|
|
65
|
-
container: arrivalNotice.container,
|
|
66
|
-
truckNo: arrivalNotice.truckNo,
|
|
67
|
-
deliveryOrderNo: arrivalNotice.deliveryOrderNo,
|
|
68
|
-
containerNo: arrivalNotice.containerNo,
|
|
69
|
-
containerSize: arrivalNotice.containerSize,
|
|
70
|
-
orderProducts,
|
|
71
|
-
supplier: {
|
|
72
|
-
name: ((_a = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _a === void 0 ? void 0 : _a.name) || null,
|
|
73
|
-
companyName: ((_b = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _b === void 0 ? void 0 : _b.companyName) || null,
|
|
74
|
-
email: ((_c = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _c === void 0 ? void 0 : _c.email) || null,
|
|
75
|
-
accountNo: ((_d = arrivalNotice === null || arrivalNotice === void 0 ? void 0 : arrivalNotice.supplier) === null || _d === void 0 ? void 0 : _d.accountNo) || null
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
data.push(datapoint);
|
|
79
|
-
}
|
|
80
|
-
context.body = {
|
|
81
|
-
data,
|
|
82
|
-
totalCount,
|
|
83
|
-
limit,
|
|
84
|
-
offset
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
if (e instanceof error_util_1.ApiError)
|
|
89
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
90
|
-
else
|
|
91
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
//# sourceMappingURL=get-inbound-order-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-inbound-order-list.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-inbound-order-list.ts"],"names":[],"mappings":";;;;;AAAA,qCAAgD;AAEhD,6CAAgE;AAChE,2DAA0D;AAE1D,oDAAyF;AACzF,oDAAsB;AACtB,gDAA4F;AAE5F,sBAAM,CAAC,GAAG,CACR,sCAAsC,EACtC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;;IACtB,IAAI;QACF,uCAAuC;QACvC,kCAAkC;QAClC,IAAI,MAAM,qBAAQ,OAAO,CAAC,KAAK,CAAE,CAAA;QACjC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;QAClD,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;QACzC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;QAC3B,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,C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,OAAO,EAAE,CAAC,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
|
package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const typeorm_1 = require("typeorm");
|
|
4
|
-
const api_1 = require("@things-factory/api");
|
|
5
|
-
const biz_base_1 = require("@things-factory/biz-base");
|
|
6
|
-
const product_base_1 = require("@things-factory/product-base");
|
|
7
|
-
const middlewares_1 = require("../middlewares");
|
|
8
|
-
const error_util_1 = require("../utils/error-util");
|
|
9
|
-
api_1.restfulApiRouter.get('/v1/warehouse/get-inventory-product-group-list', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
10
|
-
try {
|
|
11
|
-
// optional query parameter filter
|
|
12
|
-
let filter = Object.assign({}, context.query);
|
|
13
|
-
const { limit, offset } = filter;
|
|
14
|
-
delete filter['limit'];
|
|
15
|
-
delete filter['offset'];
|
|
16
|
-
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
17
|
-
let customerBizplaceId = filter.bizplaceId;
|
|
18
|
-
const customerCompanyBizplace = await (0, biz_base_1.getCompanyBizplace)(null, null, customerBizplaceId, tx);
|
|
19
|
-
if (filter.hasOwnProperty('sku')) {
|
|
20
|
-
let product = await tx.getRepository(product_base_1.Product).findOne({
|
|
21
|
-
where: { bizplace: customerCompanyBizplace, sku: filter['sku'] }
|
|
22
|
-
});
|
|
23
|
-
filter.productId = (product === null || product === void 0 ? void 0 : product.id) || null;
|
|
24
|
-
if (!product) {
|
|
25
|
-
let productBundle = await tx.getRepository(product_base_1.ProductBundle).findOne({
|
|
26
|
-
where: { bizplace: customerCompanyBizplace, sku: filter['sku'] }
|
|
27
|
-
});
|
|
28
|
-
filter.productBundleId = productBundle.id;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
const params = { filter, pagination: { page: offset, limit: limit } };
|
|
32
|
-
const { items, total } = await warehouseBizplaceOnhandInventory(customerBizplaceId, params, context, tx);
|
|
33
|
-
let data = items.map(item => {
|
|
34
|
-
var _a, _b, _c, _d, _e, _f;
|
|
35
|
-
return {
|
|
36
|
-
product: {
|
|
37
|
-
sku: ((_a = item === null || item === void 0 ? void 0 : item.product) === null || _a === void 0 ? void 0 : _a.sku) || ((_b = item === null || item === void 0 ? void 0 : item.productBundle) === null || _b === void 0 ? void 0 : _b.sku),
|
|
38
|
-
name: ((_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.name) || ((_d = item === null || item === void 0 ? void 0 : item.productBundle) === null || _d === void 0 ? void 0 : _d.name),
|
|
39
|
-
description: ((_e = item === null || item === void 0 ? void 0 : item.product) === null || _e === void 0 ? void 0 : _e.description) || ((_f = item === null || item === void 0 ? void 0 : item.productBundle) === null || _f === void 0 ? void 0 : _f.description),
|
|
40
|
-
type: item.groupType
|
|
41
|
-
},
|
|
42
|
-
batchId: item === null || item === void 0 ? void 0 : item.batchId,
|
|
43
|
-
packingType: item.packingType,
|
|
44
|
-
packingSize: item.packingSize,
|
|
45
|
-
qty: item.remainQty,
|
|
46
|
-
reservedQty: item.qty - item.remainQty,
|
|
47
|
-
uomValue: item.remainUomValue,
|
|
48
|
-
uom: item.uom
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
context.body = {
|
|
52
|
-
data,
|
|
53
|
-
totalCount: total,
|
|
54
|
-
limit,
|
|
55
|
-
offset
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
if (e instanceof error_util_1.ApiError)
|
|
61
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
62
|
-
else
|
|
63
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
async function warehouseBizplaceOnhandInventory(customerBizplaceId, params, context, trxMgr) {
|
|
67
|
-
let filter = params.filter;
|
|
68
|
-
const { domain } = context.state;
|
|
69
|
-
let qb = trxMgr
|
|
70
|
-
.getRepository('WarehouseBizplaceOnhandInventory')
|
|
71
|
-
.createQueryBuilder('wboi')
|
|
72
|
-
.leftJoinAndMapOne('wboi.product', product_base_1.Product, 'prd', 'prd.id = wboi."product_id"')
|
|
73
|
-
.leftJoinAndMapOne('wboi.product_bundle', product_base_1.ProductBundle, 'pb', 'pb.id = wboi."product_bundle_id"')
|
|
74
|
-
.where('wboi."bizplace_id"=:bizplaceId', { bizplaceId: customerBizplaceId })
|
|
75
|
-
.andWhere('wboi."domain_id"=:domainId', { domainId: domain.id });
|
|
76
|
-
if (filter === null || filter === void 0 ? void 0 : filter.productId) {
|
|
77
|
-
qb.andWhere('wboi."product_id"=:productId', { productId: filter.productId });
|
|
78
|
-
}
|
|
79
|
-
if (filter === null || filter === void 0 ? void 0 : filter.productBundleId) {
|
|
80
|
-
qb.andWhere('wboi."product_bundle_id"=:productBundleId', { productBundleId: filter.productBundleId });
|
|
81
|
-
}
|
|
82
|
-
qb.limit(params.pagination.limit).offset(params.pagination.page);
|
|
83
|
-
const items = await qb.getMany();
|
|
84
|
-
const { total } = await qb.select('COUNT(*)', 'total').getRawOne();
|
|
85
|
-
return { items, total: parseInt(total) };
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=get-inventory-product-group-list.js.map
|
package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-inventory-product-group-list.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.ts"],"names":[],"mappings":";;AAAA,qCAAsD;AAEtD,6CAAgE;AAChE,uDAAuE;AACvE,+DAAqE;AAGrE,gDAA4F;A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AQ,CAAC,2CAA2C,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,CAAA;KACtG;IAED,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAEhE,MAAM,KAAK,GAAU,MAAM,EAAE,CAAC,OAAO,EAAE,CAAA;IACvC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,CAAA;IAElE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAA;AAC1C,CAAC"}
|
|
@@ -1,87 +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
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const api_1 = require("@things-factory/api");
|
|
8
|
-
const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
9
|
-
const error_util_1 = require("../utils/error-util");
|
|
10
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
11
|
-
const middlewares_1 = require("../middlewares");
|
|
12
|
-
api_1.restfulApiRouter.get('/v1/warehouse/get-onhand-inventory-list', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
13
|
-
try {
|
|
14
|
-
let filter = Object.assign({}, context.query);
|
|
15
|
-
const { limit, offset, fromDate, toDate } = filter;
|
|
16
|
-
filter['bizplace'] = filter['bizplaceId'];
|
|
17
|
-
delete filter['bizplaceId'];
|
|
18
|
-
if (lodash_1.default.has(filter, 'sku')) {
|
|
19
|
-
filter.product = { sku: filter['sku'] };
|
|
20
|
-
delete filter['sku'];
|
|
21
|
-
}
|
|
22
|
-
filter['createdAt'] = (0, typeorm_1.Between)(fromDate, toDate);
|
|
23
|
-
filter['status'] = 'STORED';
|
|
24
|
-
delete filter['fromDate'];
|
|
25
|
-
delete filter['toDate'];
|
|
26
|
-
delete filter['limit'];
|
|
27
|
-
delete filter['offset'];
|
|
28
|
-
const [inventories, totalCount] = await (0, typeorm_1.getRepository)(warehouse_base_1.Inventory).findAndCount({
|
|
29
|
-
where: filter,
|
|
30
|
-
relations: ['product', 'location'],
|
|
31
|
-
skip: offset,
|
|
32
|
-
take: limit,
|
|
33
|
-
order: { createdAt: 'DESC' }
|
|
34
|
-
});
|
|
35
|
-
let data = [];
|
|
36
|
-
for (const inventory of inventories) {
|
|
37
|
-
const datapoint = {
|
|
38
|
-
id: inventory.id,
|
|
39
|
-
name: inventory.name,
|
|
40
|
-
palletId: inventory.palletId,
|
|
41
|
-
cartonId: inventory.cartonId,
|
|
42
|
-
batchId: inventory.batchId,
|
|
43
|
-
packingType: inventory.packingType,
|
|
44
|
-
packingSize: inventory.packingSize,
|
|
45
|
-
qty: inventory.qty,
|
|
46
|
-
reservedQty: inventory.lockedQty,
|
|
47
|
-
expirationDate: inventory.expirationDate,
|
|
48
|
-
weight: inventory.product.weight
|
|
49
|
-
? `${inventory.product.weight * inventory.qty} ${inventory.product.weightUnit}`
|
|
50
|
-
: null,
|
|
51
|
-
lastSeq: inventory === null || inventory === void 0 ? void 0 : inventory.lastSeq,
|
|
52
|
-
status: 'STORED',
|
|
53
|
-
product: {
|
|
54
|
-
sku: inventory.product.sku,
|
|
55
|
-
name: inventory.product.name,
|
|
56
|
-
description: inventory.product.description,
|
|
57
|
-
type: inventory.product.type,
|
|
58
|
-
weightUnit: inventory.product.weightUnit,
|
|
59
|
-
weight: inventory.product.weight,
|
|
60
|
-
lengthUnit: inventory.product.lengthUnit,
|
|
61
|
-
width: inventory.product.width,
|
|
62
|
-
depth: inventory.product.depth,
|
|
63
|
-
height: inventory.product.height
|
|
64
|
-
},
|
|
65
|
-
location: {
|
|
66
|
-
name: inventory.location.name,
|
|
67
|
-
type: inventory.location.type,
|
|
68
|
-
zone: inventory.location.zone
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
data.push(datapoint);
|
|
72
|
-
}
|
|
73
|
-
context.body = {
|
|
74
|
-
data,
|
|
75
|
-
totalCount,
|
|
76
|
-
limit,
|
|
77
|
-
offset
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
if (e instanceof error_util_1.ApiError)
|
|
82
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
83
|
-
else
|
|
84
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=get-onhand-inventory-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-onhand-inventory-list.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.ts"],"names":[],"mappings":";;;;;AAAA,qCAAgD;AAEhD,6CAAgE;AAChE,mEAA0D;AAE1D,oDAAyF;AACzF,oDAAsB;AACtB,gDAA4F;AAE5F,sBAAM,CAAC,GAAG,CACR,yCAAyC,EACzC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF,IAAI,MAAM,qBAAQ,OAAO,CAAC,KAAK,CAAE,CAAA;QACjC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QAClD,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;QACzC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;QAC3B,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EA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,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,96 +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
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const api_1 = require("@things-factory/api");
|
|
8
|
-
const sales_base_1 = require("@things-factory/sales-base");
|
|
9
|
-
const error_util_1 = require("../utils/error-util");
|
|
10
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
11
|
-
const middlewares_1 = require("../middlewares");
|
|
12
|
-
api_1.restfulApiRouter.get('/v1/warehouse/get-release-order-details', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
13
|
-
try {
|
|
14
|
-
// get contact points for that bizplace
|
|
15
|
-
// optional query parameter filter
|
|
16
|
-
let filter = Object.assign({}, context.query);
|
|
17
|
-
filter['bizplace'] = filter['bizplaceId'];
|
|
18
|
-
delete filter['bizplaceId'];
|
|
19
|
-
if (lodash_1.default.has(filter, 'roNo')) {
|
|
20
|
-
filter['name'] = filter['roNo'];
|
|
21
|
-
delete filter['roNo'];
|
|
22
|
-
}
|
|
23
|
-
const releaseGood = await (0, typeorm_1.getRepository)(sales_base_1.ReleaseGood).findOne({
|
|
24
|
-
where: filter,
|
|
25
|
-
relations: ['orderInventories', 'orderInventories.product']
|
|
26
|
-
});
|
|
27
|
-
if (!releaseGood)
|
|
28
|
-
throw new error_util_1.ApiError('E04', `release order: ${filter['name']}`);
|
|
29
|
-
// create and format data response
|
|
30
|
-
let orderInventories = [];
|
|
31
|
-
for (const orderInventory of releaseGood.orderInventories) {
|
|
32
|
-
const orderInventoriesDataPoint = {
|
|
33
|
-
product: {
|
|
34
|
-
sku: orderInventory.product.sku,
|
|
35
|
-
refCode: orderInventory.product.refCode
|
|
36
|
-
},
|
|
37
|
-
batchId: orderInventory.batchId,
|
|
38
|
-
packingType: orderInventory.packingType,
|
|
39
|
-
releaseQty: orderInventory.releaseQty,
|
|
40
|
-
packingSize: orderInventory.packingSize
|
|
41
|
-
};
|
|
42
|
-
orderInventories.push(orderInventoriesDataPoint);
|
|
43
|
-
}
|
|
44
|
-
const data = {
|
|
45
|
-
id: releaseGood.id,
|
|
46
|
-
roNo: releaseGood.roNo,
|
|
47
|
-
refNo: releaseGood.refNo,
|
|
48
|
-
refNo2: releaseGood.refNo2,
|
|
49
|
-
refNo3: releaseGood.refNo3,
|
|
50
|
-
type: releaseGood.type,
|
|
51
|
-
releaseDate: releaseGood.releaseDate,
|
|
52
|
-
collectionOrderNo: releaseGood.collectionOrderNo,
|
|
53
|
-
ownTransport: releaseGood.ownTransport,
|
|
54
|
-
exportOption: releaseGood.exportOption,
|
|
55
|
-
transporter: releaseGood.transporter,
|
|
56
|
-
trackingNo: releaseGood.trackingNo,
|
|
57
|
-
marketplaceOrderStatus: releaseGood.marketplaceOrderStatus,
|
|
58
|
-
airwayBill: releaseGood.airwayBill,
|
|
59
|
-
invoice: releaseGood.invoice,
|
|
60
|
-
storeName: releaseGood.storeName,
|
|
61
|
-
storeId: releaseGood.storeId,
|
|
62
|
-
routeId: releaseGood.routeId,
|
|
63
|
-
stopId: releaseGood.stopId,
|
|
64
|
-
billTo: {
|
|
65
|
-
billingAddress: releaseGood.billingAddress
|
|
66
|
-
},
|
|
67
|
-
deliverTo: {
|
|
68
|
-
deliveryAddress1: releaseGood.deliveryAddress1,
|
|
69
|
-
deliveryAddress2: releaseGood.deliveryAddress2,
|
|
70
|
-
deliveryAddress3: releaseGood.deliveryAddress3,
|
|
71
|
-
deliveryAddress4: releaseGood.deliveryAddress4,
|
|
72
|
-
deliveryAddress5: releaseGood.deliveryAddress5,
|
|
73
|
-
attentionTo: releaseGood.attentionTo,
|
|
74
|
-
attentionCompany: releaseGood.attentionCompany,
|
|
75
|
-
city: releaseGood.city,
|
|
76
|
-
state: releaseGood.state,
|
|
77
|
-
postalCode: releaseGood.postalCode,
|
|
78
|
-
country: releaseGood.country,
|
|
79
|
-
phone1: releaseGood.phone1,
|
|
80
|
-
phone2: releaseGood.phone2,
|
|
81
|
-
email: releaseGood.email
|
|
82
|
-
},
|
|
83
|
-
orderInventories
|
|
84
|
-
};
|
|
85
|
-
context.body = {
|
|
86
|
-
data
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
if (e instanceof error_util_1.ApiError)
|
|
91
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
92
|
-
else
|
|
93
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=get-release-order-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-release-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-release-order-details.ts"],"names":[],"mappings":";;;;;AAAA,qCAAuC;AAEvC,6CAAgE;AAChE,2DAAwD;AAExD,oDAAyF;AACzF,oDAAsB;AACtB,gDAA4F;AAE5F,sBAAM,CAAC,GAAG,CACR,yCAAyC,EACzC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF,uCAAuC;QACvC,kCAAkC;QAClC,IAAI,MAAM,qBAAQ,OAAO,CAAC,KAAK,CAAE,CAAA;QACjC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;QACzC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;QAC3B,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;YACzB,MAAM,CAAC,M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