@things-factory/operato-hub 4.3.523 → 4.3.525
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/routers/api/restful-apis/v1/warehouse/get-draft-order-details.js +15 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-draft-order-details.js.map +1 -1
- package/openapi/v1/outbound.yaml +32 -0
- package/package.json +5 -5
- package/server/routers/api/restful-apis/v1/warehouse/get-draft-order-details.ts +32 -5
|
@@ -30,7 +30,13 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-draft-order-details', middlewares_
|
|
|
30
30
|
}
|
|
31
31
|
const draftReleaseGood = await (0, typeorm_1.getRepository)(sales_base_1.DraftReleaseGood).findOne({
|
|
32
32
|
where: filter,
|
|
33
|
-
relations: [
|
|
33
|
+
relations: [
|
|
34
|
+
'orderProducts',
|
|
35
|
+
'orderProducts.productBundle',
|
|
36
|
+
'orderProducts.productBundle.productBundleSettings',
|
|
37
|
+
'orderProducts.productBundle.productBundleSettings.product',
|
|
38
|
+
'orderProducts.product'
|
|
39
|
+
]
|
|
34
40
|
});
|
|
35
41
|
if (!draftReleaseGood)
|
|
36
42
|
throw new error_util_1.ApiError('E04', `draft release order: ${filter['name']}`);
|
|
@@ -47,6 +53,14 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-draft-order-details', middlewares_
|
|
|
47
53
|
id: op.id,
|
|
48
54
|
sku: op.productBundle.sku,
|
|
49
55
|
name: op.productBundle.name,
|
|
56
|
+
products: op.productBundle.productBundleSettings.map(pbs => {
|
|
57
|
+
return {
|
|
58
|
+
id: pbs.product.id,
|
|
59
|
+
sku: pbs.product.sku,
|
|
60
|
+
name: pbs.product.name,
|
|
61
|
+
releaseQty: op.releaseQty * pbs.bundleQty
|
|
62
|
+
};
|
|
63
|
+
}),
|
|
50
64
|
type: 'BUNDLE',
|
|
51
65
|
releaseQty: op.releaseQty
|
|
52
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-draft-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-draft-order-details.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"get-draft-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-draft-order-details.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,qCAAuC;AAEvC,6CAAgE;AAChE,2DAGmC;AAEnC,gDAIuB;AACvB,oDAI4B;AAE5B,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,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,IAAI,MAAM,mCAAQ,OAAO,CAAC,KAAK,KAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAE,CAAA;QACpD,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAEhE,MAAM,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,CAAA;QAEnE,IAAI,CAAC,iBAAiB,EAAE;YACtB,MAAM,IAAI,qBAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;SAChD;QAED,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE;YAC/B,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;YACzC,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;SAC5B;QAED,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE;YACjC,MAAM,CA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AAO,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"}
|
package/openapi/v1/outbound.yaml
CHANGED
|
@@ -1630,6 +1630,38 @@ definitions:
|
|
|
1630
1630
|
name:
|
|
1631
1631
|
type: string
|
|
1632
1632
|
example: 'Bundle XX'
|
|
1633
|
+
products:
|
|
1634
|
+
type: array
|
|
1635
|
+
items:
|
|
1636
|
+
oneOf:
|
|
1637
|
+
- type: object
|
|
1638
|
+
properties:
|
|
1639
|
+
id:
|
|
1640
|
+
type: string
|
|
1641
|
+
example: 'd61cd39-f9de-4a28-8d24-981e6ea5c4r6'
|
|
1642
|
+
sku:
|
|
1643
|
+
type: string
|
|
1644
|
+
example: 'SKU Y'
|
|
1645
|
+
name:
|
|
1646
|
+
type: string
|
|
1647
|
+
example: 'SKU YY'
|
|
1648
|
+
releaseQty:
|
|
1649
|
+
type: integer
|
|
1650
|
+
example: '3'
|
|
1651
|
+
- type: object
|
|
1652
|
+
properties:
|
|
1653
|
+
id:
|
|
1654
|
+
type: string
|
|
1655
|
+
example: 'd61cd39-f9de-4a28-8d24-981e6ea5c4r6'
|
|
1656
|
+
sku:
|
|
1657
|
+
type: string
|
|
1658
|
+
example: 'SKU Z'
|
|
1659
|
+
name:
|
|
1660
|
+
type: string
|
|
1661
|
+
example: 'SKU ZZ'
|
|
1662
|
+
releaseQty:
|
|
1663
|
+
type: integer
|
|
1664
|
+
example: '2'
|
|
1633
1665
|
type:
|
|
1634
1666
|
type: string
|
|
1635
1667
|
example: 'bundle'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.525",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@things-factory/pdf": "^4.3.381",
|
|
93
93
|
"@things-factory/product-ui": "^4.3.518",
|
|
94
94
|
"@things-factory/resource-ui": "^4.3.518",
|
|
95
|
-
"@things-factory/sales-base": "^4.3.
|
|
95
|
+
"@things-factory/sales-base": "^4.3.525",
|
|
96
96
|
"@things-factory/scene-data-transform": "^4.3.381",
|
|
97
97
|
"@things-factory/scene-excel": "^4.3.381",
|
|
98
98
|
"@things-factory/scene-firebase": "^4.3.381",
|
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"@things-factory/shell": "^4.3.434",
|
|
109
109
|
"@things-factory/system-ui": "^4.3.434",
|
|
110
110
|
"@things-factory/transport-base": "^4.3.518",
|
|
111
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
112
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
111
|
+
"@things-factory/warehouse-base": "^4.3.525",
|
|
112
|
+
"@things-factory/worksheet-base": "^4.3.525",
|
|
113
113
|
"cron-parser": "^4.7.0",
|
|
114
114
|
"koa2-swagger-ui": "^5.0.2",
|
|
115
115
|
"swagger-jsdoc": "^5.0.0",
|
|
@@ -122,5 +122,5 @@
|
|
|
122
122
|
"resolutions": {
|
|
123
123
|
"core-js": "^3.16.0"
|
|
124
124
|
},
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "b16b042116f7068428089f4de5bf7c61ccc0629d"
|
|
126
126
|
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
|
-
import { getRepository
|
|
2
|
+
import { getRepository } from 'typeorm'
|
|
3
|
+
|
|
3
4
|
import { restfulApiRouter as router } from '@things-factory/api'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
DraftReleaseGood,
|
|
7
|
+
ReleaseGood
|
|
8
|
+
} from '@things-factory/sales-base'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
businessMiddleware,
|
|
12
|
+
loggingMiddleware,
|
|
13
|
+
validationMiddleware
|
|
14
|
+
} from '../middlewares'
|
|
15
|
+
import {
|
|
16
|
+
ApiError,
|
|
17
|
+
ApiErrorHandler,
|
|
18
|
+
throwInternalServerError
|
|
19
|
+
} from '../utils/error-util'
|
|
7
20
|
|
|
8
21
|
router.get(
|
|
9
22
|
'/v1/warehouse/get-draft-order-details',
|
|
@@ -36,7 +49,13 @@ router.get(
|
|
|
36
49
|
|
|
37
50
|
const draftReleaseGood: DraftReleaseGood = await getRepository(DraftReleaseGood).findOne({
|
|
38
51
|
where: filter,
|
|
39
|
-
relations: [
|
|
52
|
+
relations: [
|
|
53
|
+
'orderProducts',
|
|
54
|
+
'orderProducts.productBundle',
|
|
55
|
+
'orderProducts.productBundle.productBundleSettings',
|
|
56
|
+
'orderProducts.productBundle.productBundleSettings.product',
|
|
57
|
+
'orderProducts.product'
|
|
58
|
+
]
|
|
40
59
|
})
|
|
41
60
|
|
|
42
61
|
if (!draftReleaseGood) throw new ApiError('E04', `draft release order: ${filter['name']}`)
|
|
@@ -57,6 +76,14 @@ router.get(
|
|
|
57
76
|
id: op.id,
|
|
58
77
|
sku: op.productBundle.sku,
|
|
59
78
|
name: op.productBundle.name,
|
|
79
|
+
products: op.productBundle.productBundleSettings.map(pbs => {
|
|
80
|
+
return {
|
|
81
|
+
id: pbs.product.id,
|
|
82
|
+
sku: pbs.product.sku,
|
|
83
|
+
name: pbs.product.name,
|
|
84
|
+
releaseQty: op.releaseQty * pbs.bundleQty
|
|
85
|
+
}
|
|
86
|
+
}),
|
|
60
87
|
type: 'BUNDLE',
|
|
61
88
|
releaseQty: op.releaseQty
|
|
62
89
|
}
|