@things-factory/operato-hub 4.0.25 → 4.0.29
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/client/bootstrap.js +1 -1
- package/dist-server/routers/api/restful-apis/unstable/add-product.js +85 -0
- package/dist-server/routers/api/restful-apis/unstable/add-product.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/add-replenishment-order.js +98 -0
- package/dist-server/routers/api/restful-apis/unstable/add-replenishment-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/add-transfer-order.js +77 -0
- package/dist-server/routers/api/restful-apis/unstable/add-transfer-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/application.js +28 -0
- package/dist-server/routers/api/restful-apis/unstable/application.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/cancel-replenishment-order.js +67 -0
- package/dist-server/routers/api/restful-apis/unstable/cancel-replenishment-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/cancel-transfer-order.js +70 -0
- package/dist-server/routers/api/restful-apis/unstable/cancel-transfer-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/confirm-inbound-order.js +98 -0
- package/dist-server/routers/api/restful-apis/unstable/confirm-inbound-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/delete-inbound-order.js +37 -0
- package/dist-server/routers/api/restful-apis/unstable/delete-inbound-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/generate-inbound-order.js +206 -0
- package/dist-server/routers/api/restful-apis/unstable/generate-inbound-order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/get-product-detail.js +78 -0
- package/dist-server/routers/api/restful-apis/unstable/get-product-detail.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/get-product-list.js +114 -0
- package/dist-server/routers/api/restful-apis/unstable/get-product-list.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-detail.js +58 -0
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-detail.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-list.js +124 -0
- package/dist-server/routers/api/restful-apis/unstable/get-transfer-order-list.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-product.js +76 -0
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-product.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-status.js +73 -0
- package/dist-server/routers/api/restful-apis/unstable/update-replenishment-order-status.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/update-transfer-order-status.js +76 -0
- package/dist-server/routers/api/restful-apis/unstable/update-transfer-order-status.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/utils/api-error-message.js +13 -0
- package/dist-server/routers/api/restful-apis/unstable/utils/api-error-message.js.map +1 -0
- package/dist-server/routers/api/restful-apis/unstable/utils/index.js +14 -0
- package/dist-server/routers/api/restful-apis/unstable/utils/index.js.map +1 -0
- package/dist-server/routers/api/restful-apis/v1/application.js +28 -0
- package/dist-server/routers/api/restful-apis/v1/application.js.map +1 -0
- package/dist-server/routers/api/restful-apis/v1/order.js +28 -0
- package/dist-server/routers/api/restful-apis/v1/order.js.map +1 -0
- package/dist-server/routers/api/restful-apis/v2/application.js +28 -0
- package/dist-server/routers/api/restful-apis/v2/application.js.map +1 -0
- package/dist-server/routers/api/restful-apis/v2/order.js +28 -0
- package/dist-server/routers/api/restful-apis/v2/order.js.map +1 -0
- package/package.json +68 -68
package/client/bootstrap.js
CHANGED
|
@@ -5,7 +5,7 @@ import './menu'
|
|
|
5
5
|
|
|
6
6
|
import { html } from 'lit-element'
|
|
7
7
|
|
|
8
|
-
import { registerDefaultGroups } from '@operato/board/
|
|
8
|
+
import { registerDefaultGroups } from '@operato/board/register-default-groups.js'
|
|
9
9
|
import { APPEND_APP_TOOL } from '@things-factory/apptool-base'
|
|
10
10
|
import { auth } from '@things-factory/auth-base'
|
|
11
11
|
import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@things-factory/layout-base'
|
|
@@ -0,0 +1,85 @@
|
|
|
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.checkMandatoryKey = void 0;
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const api_1 = require("@things-factory/api");
|
|
9
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
10
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
11
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
12
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:add-product');
|
|
13
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/add-product', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
14
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
15
|
+
const { warehouseId } = context.params;
|
|
16
|
+
let bodyReq = context.request.body;
|
|
17
|
+
if (!warehouseId)
|
|
18
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('warehouseId'));
|
|
19
|
+
if (typeof bodyReq === undefined || Object.keys(bodyReq).length === 0) {
|
|
20
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('bodyReq'));
|
|
21
|
+
}
|
|
22
|
+
await checkMandatoryKey(bodyReq);
|
|
23
|
+
debug('post:/add-product request.body', context.request.body);
|
|
24
|
+
const patches = bodyReq.map(patch => {
|
|
25
|
+
return Object.assign(Object.assign({}, patch), { cuFlag: '+' });
|
|
26
|
+
});
|
|
27
|
+
context.body = {
|
|
28
|
+
result: (await client.query({
|
|
29
|
+
query: graphql_tag_1.default `
|
|
30
|
+
mutation($patches: [ProductPatch]!) {
|
|
31
|
+
updateMultipleProduct(patches: $patches) {
|
|
32
|
+
sku
|
|
33
|
+
name
|
|
34
|
+
description
|
|
35
|
+
productRef {
|
|
36
|
+
name
|
|
37
|
+
description
|
|
38
|
+
}
|
|
39
|
+
childProducts {
|
|
40
|
+
name
|
|
41
|
+
description
|
|
42
|
+
}
|
|
43
|
+
bundleQty
|
|
44
|
+
packingType
|
|
45
|
+
type
|
|
46
|
+
expirationPeriod
|
|
47
|
+
weightUnit
|
|
48
|
+
weight
|
|
49
|
+
density
|
|
50
|
+
lengthUnit
|
|
51
|
+
width
|
|
52
|
+
depth
|
|
53
|
+
height
|
|
54
|
+
auxUnit1
|
|
55
|
+
auxValue1
|
|
56
|
+
auxUnit2
|
|
57
|
+
auxValue2
|
|
58
|
+
auxUnit3
|
|
59
|
+
auxValue3
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
variables: { patches },
|
|
64
|
+
context: Object.assign(Object.assign({}, context), { state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
65
|
+
domain }) })
|
|
66
|
+
})).data
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
async function checkMandatoryKey(params) {
|
|
70
|
+
params.forEach((param, key) => {
|
|
71
|
+
let noparams = [];
|
|
72
|
+
if (!param.sku)
|
|
73
|
+
noparams.push('sku');
|
|
74
|
+
if (!param.name)
|
|
75
|
+
noparams.push('name');
|
|
76
|
+
if (!param.packingType)
|
|
77
|
+
noparams.push('packingType');
|
|
78
|
+
if (!param.type)
|
|
79
|
+
noparams.push('type');
|
|
80
|
+
if (noparams.length > 0)
|
|
81
|
+
throw new Error(`required parameters ${noparams.join(', ')} at element ${key} is missing`);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.checkMandatoryKey = checkMandatoryKey;
|
|
85
|
+
//# sourceMappingURL=add-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-product.js","sourceRoot":"","sources":["../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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAiCT;YACD,SAAS,EAAE,EAAE,OAAO,EAAE;YACtB,OAAO,kCACF,OAAO,KACV,KAAK,kCACA,OAAO,CAAC,KAAK,KAChB,QAAQ;oBACR,MAAM,MAET;SACK,CAAC,CACV,CAAC,IAAI;KACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEK,KAAK,UAAU,iBAAiB,CAAC,MAAM;IAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC5B,IAAI,QAAQ,GAAG,EAAE,CAAA;QAEjB,IAAI,CAAC,KAAK,CAAC,GAAG;YAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEpC,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEtC,IAAI,CAAC,KAAK,CAAC,WAAW;YAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAEpD,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEtC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,CAAA;IACrH,CAAC,CAAC,CAAA;AACJ,CAAC;AAdD,8CAcC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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.checkMandatoryKey = void 0;
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const typeorm_1 = require("typeorm");
|
|
9
|
+
const utils_2 = require("@things-factory/utils");
|
|
10
|
+
const product_base_1 = require("@things-factory/product-base");
|
|
11
|
+
const api_1 = require("@things-factory/api");
|
|
12
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
13
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
14
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
15
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:add-replenishment-order');
|
|
16
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/add-replenishment-order', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
17
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
18
|
+
const { warehouseId } = context.params;
|
|
19
|
+
const attachments = undefined;
|
|
20
|
+
let bodyReq = context.request.body;
|
|
21
|
+
if (!warehouseId)
|
|
22
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('warehouseId'));
|
|
23
|
+
if (typeof bodyReq === undefined || Object.keys(bodyReq).length === 0) {
|
|
24
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('bodyReq'));
|
|
25
|
+
}
|
|
26
|
+
await checkMandatoryKey(bodyReq);
|
|
27
|
+
debug('post:/add-replenishment-order request.body', context.request.body);
|
|
28
|
+
//#1 to get all product list
|
|
29
|
+
const products = await typeorm_1.getRepository(product_base_1.Product).find({
|
|
30
|
+
where: {
|
|
31
|
+
bizplace: warehouseId,
|
|
32
|
+
sku: typeorm_1.In(bodyReq.orderProducts.map(orderProduct => orderProduct.product.sku))
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#2 assign product id found to order product
|
|
36
|
+
bodyReq.orderProducts = bodyReq.orderProducts.map(orderProduct => {
|
|
37
|
+
products.forEach(product => {
|
|
38
|
+
if (orderProduct.product.sku === product.sku) {
|
|
39
|
+
orderProduct.product.id = product.id;
|
|
40
|
+
orderProduct.packingType = product.packingType;
|
|
41
|
+
orderProduct.uom = product.primaryUnit;
|
|
42
|
+
orderProduct.uomValue = product.primaryValue;
|
|
43
|
+
orderProduct.totalUomValue = `${(orderProduct.uomValue * orderProduct.packQty).toFixed(2)} ${orderProduct.uom}`;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return orderProduct;
|
|
47
|
+
});
|
|
48
|
+
//#3 check if product is not found
|
|
49
|
+
bodyReq.orderProducts.forEach(orderProduct => {
|
|
50
|
+
if (!orderProduct.product.id)
|
|
51
|
+
throw new Error(`SKU '${orderProduct.product.sku}' is not exist`);
|
|
52
|
+
});
|
|
53
|
+
const args = {
|
|
54
|
+
retailReplenishmentOrder: Object.assign(Object.assign({}, bodyReq), { warehouseId })
|
|
55
|
+
};
|
|
56
|
+
context.body = {
|
|
57
|
+
result: (await client.query({
|
|
58
|
+
query: graphql_tag_1.default `
|
|
59
|
+
mutation {
|
|
60
|
+
createRetailReplenishmentOrder(${utils_2.gqlBuilder.buildArgs(args)}) {
|
|
61
|
+
name
|
|
62
|
+
bizplace {
|
|
63
|
+
name
|
|
64
|
+
}
|
|
65
|
+
issuedDate
|
|
66
|
+
refNo
|
|
67
|
+
remark
|
|
68
|
+
orderProducts {
|
|
69
|
+
product {
|
|
70
|
+
sku
|
|
71
|
+
name
|
|
72
|
+
}
|
|
73
|
+
batchId
|
|
74
|
+
packQty
|
|
75
|
+
status
|
|
76
|
+
}
|
|
77
|
+
status
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`,
|
|
81
|
+
variables: {},
|
|
82
|
+
context: Object.assign(Object.assign({}, context), { state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
83
|
+
domain }) })
|
|
84
|
+
})).data
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
async function checkMandatoryKey(params) {
|
|
88
|
+
var noparams = ['issuedDate', 'refNo', 'orderProducts'].filter(param => !(param in params));
|
|
89
|
+
if ('orderProducts' in params) {
|
|
90
|
+
if (params.orderProducts.filter(record => !record.product || !record.packQty).length)
|
|
91
|
+
noparams.push('orderProducts');
|
|
92
|
+
}
|
|
93
|
+
if (noparams.length > 0) {
|
|
94
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.REQUIRED_PARAMS(noparams.join(', ')));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.checkMandatoryKey = checkMandatoryKey;
|
|
98
|
+
//# sourceMappingURL=add-replenishment-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-replenishment-order.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/add-replenishment-order.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAmC;AACnC,qCAA2C;AAC3C,iDAAkD;AAClD,+DAAsD;AACtD,6CAAgE;AAChE,uFAAkF;AAClF,qFAAgF;AAChF,8DAA6B;AAE7B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,yEAAyE,CAAC,CAAA;AAEzG,sBAAM,CAAC,IAAI,CAAC,0DAA0D,EAAE,wCAAkB,EAAE,0CAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACvI,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;IACtC,MAAM,WAAW,GAAG,SAAS,CAAA;IAC7B,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;IAElC,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAS,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;IAE/E,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACrE,MAAM,IAAI,KAAK,CAA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E;AACH,CAAC;AAVD,8CAUC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
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.checkMandatoryKey = void 0;
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const utils_2 = require("@things-factory/utils");
|
|
9
|
+
const api_1 = require("@things-factory/api");
|
|
10
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
11
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
12
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
13
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:add-transfer-order');
|
|
14
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/add-transfer-order', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
15
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
16
|
+
const { warehouseId } = context.params;
|
|
17
|
+
const attachments = undefined;
|
|
18
|
+
let bodyReq = context.request.body;
|
|
19
|
+
if (!warehouseId)
|
|
20
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('warehouseId'));
|
|
21
|
+
if (typeof bodyReq === undefined || Object.keys(bodyReq).length === 0) {
|
|
22
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('bodyReq'));
|
|
23
|
+
}
|
|
24
|
+
await checkMandatoryKey(bodyReq);
|
|
25
|
+
debug('post:/add-transfer-order request.body', context.request.body);
|
|
26
|
+
const args = {
|
|
27
|
+
transferOrder: Object.assign(Object.assign({}, bodyReq), { warehouseId })
|
|
28
|
+
};
|
|
29
|
+
context.body = {
|
|
30
|
+
result: (await client.query({
|
|
31
|
+
query: graphql_tag_1.default `
|
|
32
|
+
mutation {
|
|
33
|
+
createTransferOrder(${utils_2.gqlBuilder.buildArgs(args)}) {
|
|
34
|
+
name
|
|
35
|
+
bizplace {
|
|
36
|
+
name
|
|
37
|
+
}
|
|
38
|
+
issuedDate
|
|
39
|
+
refNo
|
|
40
|
+
remark
|
|
41
|
+
orderInventories {
|
|
42
|
+
inventory {
|
|
43
|
+
palletId
|
|
44
|
+
name
|
|
45
|
+
}
|
|
46
|
+
product {
|
|
47
|
+
sku
|
|
48
|
+
name
|
|
49
|
+
description
|
|
50
|
+
}
|
|
51
|
+
batchId
|
|
52
|
+
releaseQty
|
|
53
|
+
remark
|
|
54
|
+
status
|
|
55
|
+
}
|
|
56
|
+
status
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
variables: {},
|
|
61
|
+
context: Object.assign(Object.assign({}, context), { state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
62
|
+
domain }) })
|
|
63
|
+
})).data
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
function checkMandatoryKey(params) {
|
|
67
|
+
var noparams = ['issuedDate', 'refNo', 'orderInventories', 'type', 'ownTransport'].filter(param => !(param in params));
|
|
68
|
+
if ('orderInventories' in params) {
|
|
69
|
+
if (params.orderInventories.filter(record => !record.batchId || !record.batchExp || !record.releaseQty || !record.remark).length)
|
|
70
|
+
noparams.push('orderInventories');
|
|
71
|
+
}
|
|
72
|
+
if (noparams.length > 0) {
|
|
73
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.REQUIRED_PARAMS(noparams.join(', ')));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.checkMandatoryKey = checkMandatoryKey;
|
|
77
|
+
//# sourceMappingURL=add-transfer-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-transfer-order.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/add-transfer-order.ts"],"names":[],"mappings":";;;;;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;;;;;;;;;;SA0BnD;YACD,SAAS,EAAE,EAAE;YACb,OAAO,kCACF,OAAO,KACV,KAAK,kCACA,OAAO,CAAC,KAAK,KAChB,QAAQ;oBACR,MAAM,MAET;SACK,CAAC,CACV,CAAC,IAAI;KACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,SAAgB,iBAAiB,CAAC,MAAM;IACtC,IAAI,QAAQ,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAA;IAEtH,IAAI,kBAAkB,IAAI,MAAM,EAAE;QAChC,IACE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAC5B,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,MAAM,CACtF,CAAC,MAAM;YAER,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;KACpC;IAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAS,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;AACH,CAAC;AAfD,8CAeC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
7
|
+
const api_1 = require("@things-factory/api");
|
|
8
|
+
api_1.restfulApiRouter.get('/unstable/appBindings', async (context, next) => {
|
|
9
|
+
const { client } = context.state;
|
|
10
|
+
context.body = {
|
|
11
|
+
result: (await client.query({
|
|
12
|
+
query: graphql_tag_1.default `
|
|
13
|
+
query {
|
|
14
|
+
appBindings {
|
|
15
|
+
items {
|
|
16
|
+
name
|
|
17
|
+
status
|
|
18
|
+
}
|
|
19
|
+
total
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`,
|
|
23
|
+
variables: {},
|
|
24
|
+
context
|
|
25
|
+
})).data
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/application.ts"],"names":[],"mappings":";;;;;AAAA,8DAA6B;AAC7B,6CAAgE;AAEhE,sBAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAEhC,OAAO,CAAC,IAAI,GAAG;QACb,MAAM,EAAE,CACN,MAAM,MAAM,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,qBAAG,CAAA;;;;;;;;;;SAUT;YACD,SAAS,EAAE,EAAE;YACb,OAAO;SACD,CAAC,CACV,CAAC,IAAI;KACP,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.checkMandatoryKey = void 0;
|
|
7
|
+
const utils_1 = require("@things-factory/utils");
|
|
8
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
9
|
+
const api_1 = require("@things-factory/api");
|
|
10
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
11
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
12
|
+
const sales_base_1 = require("@things-factory/sales-base");
|
|
13
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:cancel-replenishment-order');
|
|
14
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/cancel-replenishment-order', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
15
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
16
|
+
const { warehouseId } = context.params;
|
|
17
|
+
const bodyReq = context.request.body;
|
|
18
|
+
if (typeof bodyReq === undefined || bodyReq.body === '') {
|
|
19
|
+
context.throw(400, context.t('text.no body'));
|
|
20
|
+
}
|
|
21
|
+
const convertedBodyReq = JSON.parse(bodyReq.body);
|
|
22
|
+
checkMandatoryKey(context, convertedBodyReq);
|
|
23
|
+
debug('post:/cancel-replenishment-order request.body', context.request.body);
|
|
24
|
+
const args = {
|
|
25
|
+
patch: Object.assign(Object.assign({}, convertedBodyReq), { warehouseId, status: sales_base_1.ORDER_STATUS.PENDING_CANCEL })
|
|
26
|
+
};
|
|
27
|
+
context.body = {
|
|
28
|
+
result: (await client.query({
|
|
29
|
+
query: graphql_tag_1.default `
|
|
30
|
+
mutation {
|
|
31
|
+
cancelRetailReplenishmentOrder(${utils_1.gqlBuilder.buildArgs(args)}) {
|
|
32
|
+
name
|
|
33
|
+
bizplace {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
}
|
|
37
|
+
issuedDate
|
|
38
|
+
refNo
|
|
39
|
+
remark
|
|
40
|
+
orderProducts {
|
|
41
|
+
product {
|
|
42
|
+
sku
|
|
43
|
+
name
|
|
44
|
+
}
|
|
45
|
+
batchId
|
|
46
|
+
releaseQty
|
|
47
|
+
remark
|
|
48
|
+
status
|
|
49
|
+
}
|
|
50
|
+
status
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,
|
|
54
|
+
variables: {},
|
|
55
|
+
context: Object.assign(Object.assign({}, context), { state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
56
|
+
domain }) })
|
|
57
|
+
})).data
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
function checkMandatoryKey(context, params) {
|
|
61
|
+
var noparams = ['name', 'remark'].filter(param => !(param in params));
|
|
62
|
+
if (noparams.length > 0) {
|
|
63
|
+
context.throw(400, context.t('text.required parameters not found', { parameters: noparams.join(',') }));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.checkMandatoryKey = checkMandatoryKey;
|
|
67
|
+
//# sourceMappingURL=cancel-replenishment-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-replenishment-order.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/cancel-replenishment-order.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAkD;AAClD,8DAA6B;AAC7B,6CAAgE;AAChE,uFAAkF;AAClF,qFAAgF;AAChF,2DAAyD;AAEzD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,4EAA4E,CAAC,CAAA;AAE5G,sBAAM,CAAC,IAAI,CACT,6DAA6D,EAC7D,wCAAkB,EAClB,0CAAmB,EACnB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;IAEtC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;IACpC,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,EAAE,EAAE;QACvD,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,C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efault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.checkMandatoryKey = void 0;
|
|
7
|
+
const utils_1 = require("@things-factory/utils");
|
|
8
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
9
|
+
const api_1 = require("@things-factory/api");
|
|
10
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
11
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
12
|
+
const sales_base_1 = require("@things-factory/sales-base");
|
|
13
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:cancel-transfer-order');
|
|
14
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/cancel-transfer-order', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
15
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
16
|
+
const { warehouseId } = context.params;
|
|
17
|
+
const bodyReq = context.request.body;
|
|
18
|
+
if (typeof bodyReq === undefined || bodyReq.body === '') {
|
|
19
|
+
context.throw(400, context.t('text.no body'));
|
|
20
|
+
}
|
|
21
|
+
const convertedBodyReq = JSON.parse(bodyReq.body);
|
|
22
|
+
await checkMandatoryKey(context, convertedBodyReq);
|
|
23
|
+
debug('post:/cancel-transfer-order request.body', context.request.body);
|
|
24
|
+
const args = {
|
|
25
|
+
patch: Object.assign(Object.assign({}, convertedBodyReq), { warehouseId, status: sales_base_1.ORDER_STATUS.PENDING_CANCEL })
|
|
26
|
+
};
|
|
27
|
+
context.body = {
|
|
28
|
+
result: (await client.query({
|
|
29
|
+
query: graphql_tag_1.default `
|
|
30
|
+
mutation {
|
|
31
|
+
cancelTransferOrder(${utils_1.gqlBuilder.buildArgs(args)}) {
|
|
32
|
+
name
|
|
33
|
+
bizplace {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
}
|
|
37
|
+
issuedDate
|
|
38
|
+
refNo
|
|
39
|
+
remark
|
|
40
|
+
orderInventories {
|
|
41
|
+
inventory {
|
|
42
|
+
palletId
|
|
43
|
+
}
|
|
44
|
+
product {
|
|
45
|
+
sku
|
|
46
|
+
name
|
|
47
|
+
}
|
|
48
|
+
batchId
|
|
49
|
+
releaseQty
|
|
50
|
+
remark
|
|
51
|
+
status
|
|
52
|
+
}
|
|
53
|
+
status
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`,
|
|
57
|
+
variables: {},
|
|
58
|
+
context: Object.assign(Object.assign({}, context), { state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
59
|
+
domain }) })
|
|
60
|
+
})).data
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
function checkMandatoryKey(context, params) {
|
|
64
|
+
var noparams = ['name', 'remark'].filter(param => !(param in params));
|
|
65
|
+
if (noparams.length > 0) {
|
|
66
|
+
context.throw(400, context.t('text.required parameters not found', { parameters: noparams.join(',') }));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.checkMandatoryKey = checkMandatoryKey;
|
|
70
|
+
//# sourceMappingURL=cancel-transfer-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-transfer-order.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/cancel-transfer-order.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAkD;AAClD,8DAA6B;AAC7B,6CAAgE;AAChE,uFAAkF;AAClF,qFAAgF;AAChF,2DAAyD;AAGzD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,uEAAuE,CAAC,CAAA;AAEvG,sBAAM,CAAC,IAAI,CAAC,wDAAwD,EAAE,wCAAkB,EAAE,0CAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACrI,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,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AAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,oCAAoC,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;KACxG;AACH,CAAC;AAND,8CAMC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 utils_1 = require("./utils");
|
|
7
|
+
const api_1 = require("@things-factory/api");
|
|
8
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
9
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
10
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
11
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:confirm-inbound-order');
|
|
12
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/confirm-inbound-order', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
13
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
14
|
+
const { warehouseId } = context.params;
|
|
15
|
+
const { ganNo } = context.query;
|
|
16
|
+
debug('query-params', context.query);
|
|
17
|
+
debug('params', context.params);
|
|
18
|
+
if (!warehouseId)
|
|
19
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('warehouseId'));
|
|
20
|
+
if (!ganNo)
|
|
21
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('ganNo'));
|
|
22
|
+
context.body = {
|
|
23
|
+
result: (await client.query({
|
|
24
|
+
query: graphql_tag_1.default `
|
|
25
|
+
mutation($ganNo: String!) {
|
|
26
|
+
confirmArrivalNotice(name: $ganNo) {
|
|
27
|
+
name
|
|
28
|
+
refNo
|
|
29
|
+
etaDate
|
|
30
|
+
containerNo
|
|
31
|
+
ownTransport
|
|
32
|
+
crossDocking
|
|
33
|
+
releaseGood {
|
|
34
|
+
name
|
|
35
|
+
}
|
|
36
|
+
etaDate
|
|
37
|
+
looseItem
|
|
38
|
+
deliveryOrderNo
|
|
39
|
+
status
|
|
40
|
+
truckNo
|
|
41
|
+
refNo
|
|
42
|
+
importCargo
|
|
43
|
+
orderProducts {
|
|
44
|
+
batchId
|
|
45
|
+
product {
|
|
46
|
+
sku
|
|
47
|
+
name
|
|
48
|
+
description
|
|
49
|
+
packingType
|
|
50
|
+
type
|
|
51
|
+
}
|
|
52
|
+
packingType
|
|
53
|
+
uom
|
|
54
|
+
uomValue
|
|
55
|
+
packQty
|
|
56
|
+
totalUomValue
|
|
57
|
+
palletQty
|
|
58
|
+
}
|
|
59
|
+
orderVass {
|
|
60
|
+
vas {
|
|
61
|
+
name
|
|
62
|
+
operationGuide
|
|
63
|
+
operationGuideType
|
|
64
|
+
}
|
|
65
|
+
set
|
|
66
|
+
targetType
|
|
67
|
+
targetBatchId
|
|
68
|
+
targetProduct {
|
|
69
|
+
name
|
|
70
|
+
description
|
|
71
|
+
}
|
|
72
|
+
packingType
|
|
73
|
+
qty
|
|
74
|
+
uomValue
|
|
75
|
+
otherTarget
|
|
76
|
+
description
|
|
77
|
+
remark
|
|
78
|
+
operationGuide
|
|
79
|
+
}
|
|
80
|
+
supplier {
|
|
81
|
+
companyName
|
|
82
|
+
name
|
|
83
|
+
phone
|
|
84
|
+
email
|
|
85
|
+
address
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`,
|
|
90
|
+
variables: {
|
|
91
|
+
ganNo
|
|
92
|
+
},
|
|
93
|
+
context: Object.assign(Object.assign({}, context), { hasUpload: true, state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
94
|
+
domain, type: 'api' }) })
|
|
95
|
+
})).data
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=confirm-inbound-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-inbound-order.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/confirm-inbound-order.ts"],"names":[],"mappings":";;;;;AAAA,mCAAmC;AACnC,6CAAgE;AAChE,uFAAkF;AAClF,qFAAgF;AAChF,8DAA6B;AAE7B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,uEAAuE,CAAC,CAAA;AAEvG,sBAAM,CAAC,IAAI,CAAC,wDAAwD,EAAE,wCAAkB,EAAE,0CAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACrI,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;IACtC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE/B,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACpC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/B,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAS,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;IAC/E,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAS,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IAEnE,OAAO,CAAC,IAAI,GAAG;QACb,MAAM,EAAE,CACN,MAAM,MAAM,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,qBAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAiET;YACD,SAAS,EAAE;gBACT,KAAK;aACN;YACD,OAAO,kCACF,OAAO,KACV,SAAS,EAAE,IAAI,EACf,KAAK,kCACA,OAAO,CAAC,KAAK,KAChB,QAAQ;oBACR,MAAM,EACN,IAAI,EAAE,KAAK,MAEd;SACK,CAAC,CACV,CAAC,IAAI;KACP,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 utils_1 = require("./utils");
|
|
7
|
+
const api_1 = require("@things-factory/api");
|
|
8
|
+
const warehouse_middleware_1 = require("../../../../middlewares/warehouse-middleware");
|
|
9
|
+
const business_middleware_1 = require("../../../../middlewares/business-middleware");
|
|
10
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
11
|
+
const debug = require('debug')('things-factory:operato-hub:restful-api:unstable:delete-inbound-order');
|
|
12
|
+
api_1.restfulApiRouter.post('/unstable/warehouse/:warehouseId/delete-inbound-order', business_middleware_1.businessMiddleware, warehouse_middleware_1.warehouseMiddleware, async (context, next) => {
|
|
13
|
+
const { client, warehouse: bizplace, domain } = context.state;
|
|
14
|
+
const { warehouseId } = context.params;
|
|
15
|
+
const { ganNo } = context.query;
|
|
16
|
+
debug('query-params', context.query);
|
|
17
|
+
debug('params', context.params);
|
|
18
|
+
if (!warehouseId)
|
|
19
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('warehouseId'));
|
|
20
|
+
if (!ganNo)
|
|
21
|
+
throw new Error(utils_1.ERROR_MSG.REQUEST.BAD_REQUEST('ganNo'));
|
|
22
|
+
context.body = {
|
|
23
|
+
result: (await client.query({
|
|
24
|
+
query: graphql_tag_1.default `
|
|
25
|
+
mutation($ganNo: String!) {
|
|
26
|
+
deleteArrivalNotice(name: $ganNo)
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
variables: {
|
|
30
|
+
ganNo
|
|
31
|
+
},
|
|
32
|
+
context: Object.assign(Object.assign({}, context), { state: Object.assign(Object.assign({}, context.state), { bizplace,
|
|
33
|
+
domain, type: 'api' }) })
|
|
34
|
+
})).data
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=delete-inbound-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-inbound-order.js","sourceRoot":"","sources":["../../../../../server/routers/api/restful-apis/unstable/delete-inbound-order.ts"],"names":[],"mappings":";;;;;AAAA,mCAAmC;AACnC,6CAAgE;AAChE,uFAAkF;AAClF,qFAAgF;AAChF,8DAA6B;AAE7B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,sEAAsE,CAAC,CAAA;AAEtG,sBAAM,CAAC,IAAI,CAAC,uDAAuD,EAAE,wCAAkB,EAAE,0CAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACpI,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;IACtC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAE/B,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACpC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/B,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAS,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;IAC/E,IAAI,CAAC,KAAK;QAAE,MAAM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