@things-factory/operato-hub 4.3.318 → 4.3.321
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 +11 -11
- package/dist-server/routers/api/restful-apis/v1/utils/params.js +1 -0
- package/dist-server/routers/api/restful-apis/v1/utils/params.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/dispatch-delivery-order.js +22 -19
- package/dist-server/routers/api/restful-apis/v1/warehouse/dispatch-delivery-order.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js +4 -4
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js.map +1 -1
- package/openapi/v1/contact-point.yaml +5 -4
- package/openapi/v1/inbound.yaml +12 -12
- package/openapi/v1/marketplace.yaml +34 -34
- package/openapi/v1/outbound.yaml +63 -64
- package/openapi/v1/product.yaml +9 -9
- package/package.json +5 -5
- package/server/routers/api/restful-apis/v1/utils/params.ts +1 -0
- package/server/routers/api/restful-apis/v1/warehouse/dispatch-delivery-order.ts +29 -25
- package/server/routers/api/restful-apis/v1/warehouse/get-release-order-details.ts +12 -12
package/openapi/v1/product.yaml
CHANGED
|
@@ -372,21 +372,21 @@ paths:
|
|
|
372
372
|
sku:
|
|
373
373
|
type: 'string'
|
|
374
374
|
required: true
|
|
375
|
-
example: 'LB-18'
|
|
375
|
+
example: 'LB-18''(MANDATORY)'
|
|
376
376
|
brandSku:
|
|
377
377
|
type: 'string'
|
|
378
378
|
example: 'string'
|
|
379
379
|
name:
|
|
380
380
|
type: 'string'
|
|
381
381
|
required: true
|
|
382
|
-
example: '50PCS PLASTIC LUNCH BOX'
|
|
382
|
+
example: '50PCS PLASTIC LUNCH BOX''(MANDATORY)'
|
|
383
383
|
description:
|
|
384
384
|
type: 'string'
|
|
385
385
|
example: 'Lid 5 Compartments HIRO Sekat Disposable Paper Recyclable biodegradable Microwavable'
|
|
386
386
|
type:
|
|
387
387
|
type: 'string'
|
|
388
388
|
required: true
|
|
389
|
-
example: 'PLASTIC'
|
|
389
|
+
example: 'PLASTIC''(MANDATORY)'
|
|
390
390
|
brand:
|
|
391
391
|
type: 'string'
|
|
392
392
|
example: 'COLGATE-PALMOLIVE'
|
|
@@ -426,31 +426,31 @@ paths:
|
|
|
426
426
|
isDefault:
|
|
427
427
|
type: 'boolean'
|
|
428
428
|
required: true
|
|
429
|
-
example: true
|
|
429
|
+
example: true '(MANDATORY)'
|
|
430
430
|
gtin:
|
|
431
431
|
type: 'string'
|
|
432
432
|
required: true
|
|
433
|
-
example: 'string'
|
|
433
|
+
example: 'string''(MANDATORY)'
|
|
434
434
|
refCode:
|
|
435
435
|
type: 'string'
|
|
436
436
|
example: 'string'
|
|
437
437
|
packingType:
|
|
438
438
|
type: 'string'
|
|
439
439
|
required: true
|
|
440
|
-
example: CARTON
|
|
440
|
+
example: CARTON'(MANDATORY)'
|
|
441
441
|
packingSize:
|
|
442
442
|
type: 'integer'
|
|
443
443
|
required: true
|
|
444
|
-
example: 24
|
|
444
|
+
example: 24'(MANDATORY)'
|
|
445
445
|
uom:
|
|
446
446
|
type: 'string'
|
|
447
447
|
required: true
|
|
448
|
-
example: UNIT
|
|
448
|
+
example: UNIT'(MANDATORY)'
|
|
449
449
|
uomValue:
|
|
450
450
|
type: 'integer'
|
|
451
451
|
format: 'double'
|
|
452
452
|
required: true
|
|
453
|
-
example: 24
|
|
453
|
+
example: 24 '(MANDATORY)'
|
|
454
454
|
costPrice:
|
|
455
455
|
type: 'integer'
|
|
456
456
|
format: 'double'
|
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.321",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@things-factory/integration-pos": "^4.3.310",
|
|
85
85
|
"@things-factory/integration-powrup": "^4.3.310",
|
|
86
86
|
"@things-factory/integration-sellercraft": "^4.3.310",
|
|
87
|
-
"@things-factory/integration-sftp": "^4.3.
|
|
87
|
+
"@things-factory/integration-sftp": "^4.3.319",
|
|
88
88
|
"@things-factory/lite-menu": "^4.3.281",
|
|
89
89
|
"@things-factory/marketplace-base": "^4.3.318",
|
|
90
90
|
"@things-factory/more-ui": "^4.3.281",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@things-factory/pdf": "^4.3.281",
|
|
93
93
|
"@things-factory/product-ui": "^4.3.318",
|
|
94
94
|
"@things-factory/resource-ui": "^4.3.281",
|
|
95
|
-
"@things-factory/sales-base": "^4.3.
|
|
95
|
+
"@things-factory/sales-base": "^4.3.321",
|
|
96
96
|
"@things-factory/scene-data-transform": "^4.3.281",
|
|
97
97
|
"@things-factory/scene-excel": "^4.3.281",
|
|
98
98
|
"@things-factory/scene-firebase": "^4.3.281",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@things-factory/shell": "^4.3.281",
|
|
109
109
|
"@things-factory/system-ui": "^4.3.281",
|
|
110
110
|
"@things-factory/warehouse-base": "^4.3.318",
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.321",
|
|
112
112
|
"cron-parser": "^4.7.0",
|
|
113
113
|
"koa2-swagger-ui": "^5.0.2",
|
|
114
114
|
"swagger-jsdoc": "^5.0.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"resolutions": {
|
|
121
121
|
"core-js": "^3.16.0"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "58660eeeb3fb4edcd3992c67b1e20e26d7a5dde2"
|
|
124
124
|
}
|
|
@@ -427,6 +427,7 @@ export const params = {
|
|
|
427
427
|
// Required Params
|
|
428
428
|
export const reqParams = {
|
|
429
429
|
'get-contact-point-list': ['bizplaceId'],
|
|
430
|
+
'get-partner-list': ['bizplaceId'],
|
|
430
431
|
'get-product-list': ['bizplaceId'],
|
|
431
432
|
'get-marketplace-order-shipping-list': ['storeId'],
|
|
432
433
|
'get-inbound-order-list': ['bizplaceId'],
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EntityManager, getConnection } from 'typeorm'
|
|
2
2
|
|
|
3
3
|
import { restfulApiRouter as router } from '@things-factory/api'
|
|
4
|
-
import { DeliveryOrder,
|
|
4
|
+
import { DeliveryOrder, OrderInventory, OrderNoGenerator, ReleaseGood, ShippingOrder } from '@things-factory/sales-base'
|
|
5
5
|
import { TransportDriver, TransportVehicle } from '@things-factory/transport-base'
|
|
6
|
-
import { ContactPoint } from '@things-factory/biz-base'
|
|
7
6
|
|
|
8
|
-
import { ApiError, ApiErrorHandler, throwInternalServerError } from '../utils/error-util'
|
|
9
7
|
import { businessMiddleware, loggingMiddleware, validationMiddleware } from '../middlewares'
|
|
8
|
+
import { ApiError, ApiErrorHandler, throwInternalServerError } from '../utils/error-util'
|
|
10
9
|
|
|
11
10
|
router.post(
|
|
12
11
|
'/v1/warehouse/dispatch-delivery-order',
|
|
@@ -177,29 +176,34 @@ router.post(
|
|
|
177
176
|
)
|
|
178
177
|
|
|
179
178
|
// update OrderInventories remark
|
|
179
|
+
if (data?.orderInventories && data?.orderInventories?.length) {
|
|
180
|
+
for (let i = 0; i < data.orderInventories.length; i++) {
|
|
181
|
+
const oi: OrderInventory = data.orderInventories[i]
|
|
182
|
+
if (!oi?.id) {
|
|
183
|
+
throw new ApiError('E03', 'id is missing in orderInventories')
|
|
184
|
+
}
|
|
180
185
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
})
|
|
188
|
-
if (foundOIs.length > 0) {
|
|
189
|
-
await Promise.all(
|
|
190
|
-
foundOIs.map(async orderInventory => {
|
|
191
|
-
await tx.getRepository(OrderInventory).update(
|
|
192
|
-
{ id: orderInventory.id },
|
|
193
|
-
{
|
|
194
|
-
remark: data.orderInventories.find(dOi => dOi.id === orderInventory.id)?.remark,
|
|
195
|
-
updater: user,
|
|
196
|
-
updatedAt: new Date()
|
|
197
|
-
}
|
|
198
|
-
)
|
|
186
|
+
const foundOI: OrderInventory = await tx.getRepository(OrderInventory).findOne({
|
|
187
|
+
where: {
|
|
188
|
+
id: oi.id,
|
|
189
|
+
domain: domain,
|
|
190
|
+
releaseGood: foundDeliveryOrder.releaseGood.id
|
|
191
|
+
}
|
|
199
192
|
})
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
193
|
+
|
|
194
|
+
if (!foundOI) {
|
|
195
|
+
throw new ApiError('E04', `Unable to find orderInventory with id: ${oi.id}`)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
await tx.getRepository(OrderInventory).update(
|
|
199
|
+
{ id: oi.id },
|
|
200
|
+
{
|
|
201
|
+
remark: oi?.remark,
|
|
202
|
+
updater: user,
|
|
203
|
+
updatedAt: new Date()
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
}
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
// update release Good
|
|
@@ -2,8 +2,8 @@ import _ from 'lodash'
|
|
|
2
2
|
import { getRepository } from 'typeorm'
|
|
3
3
|
|
|
4
4
|
import { restfulApiRouter as router } from '@things-factory/api'
|
|
5
|
-
import { ReleaseGood, DeliveryOrder } from '@things-factory/sales-base'
|
|
6
5
|
import { Attachment } from '@things-factory/attachment-base'
|
|
6
|
+
import { DeliveryOrder, ReleaseGood } from '@things-factory/sales-base'
|
|
7
7
|
|
|
8
8
|
import { businessMiddleware, loggingMiddleware, validationMiddleware } from '../middlewares'
|
|
9
9
|
import { ApiError, ApiErrorHandler, throwInternalServerError } from '../utils/error-util'
|
|
@@ -110,8 +110,9 @@ router.get(
|
|
|
110
110
|
transportVehicle: deliveryOrder.transportVehicle
|
|
111
111
|
? { id: deliveryOrder.transportVehicle.id, name: deliveryOrder.transportVehicle.name }
|
|
112
112
|
: null,
|
|
113
|
-
orderInventories: deliveryOrder.orderInventories.map(oi=>{
|
|
114
|
-
return{
|
|
113
|
+
orderInventories: deliveryOrder.orderInventories.map(oi => {
|
|
114
|
+
return {
|
|
115
|
+
id: oi.id,
|
|
115
116
|
releaseQty: oi.releaseQty,
|
|
116
117
|
releaseUomValue: oi.releaseUomValue,
|
|
117
118
|
packingType: oi.packingType,
|
|
@@ -121,12 +122,12 @@ router.get(
|
|
|
121
122
|
id: oi.product.id,
|
|
122
123
|
name: oi.product.name,
|
|
123
124
|
description: oi.product.description,
|
|
124
|
-
sku: oi.product.sku
|
|
125
|
+
sku: oi.product.sku
|
|
125
126
|
},
|
|
126
|
-
productDetail: { refCode: oi.productDetail.refCode ? oi.productDetail.refCode : null
|
|
127
|
+
productDetail: { refCode: oi.productDetail.refCode ? oi.productDetail.refCode : null }
|
|
127
128
|
}
|
|
128
|
-
}
|
|
129
|
-
|
|
129
|
+
})
|
|
130
|
+
|
|
130
131
|
// {
|
|
131
132
|
// product: deliveryOrder.orderInventories.map(oi => {
|
|
132
133
|
// return {
|
|
@@ -147,12 +148,11 @@ router.get(
|
|
|
147
148
|
where: { refBy: releaseGood.id }
|
|
148
149
|
})
|
|
149
150
|
|
|
150
|
-
if(attachments.length >0){
|
|
151
|
+
if (attachments.length > 0) {
|
|
151
152
|
attachments = attachments.map(attachment => {
|
|
152
|
-
|
|
153
|
-
return{
|
|
153
|
+
return {
|
|
154
154
|
name: attachment.name,
|
|
155
|
-
fullpath:
|
|
155
|
+
fullpath: `${context.origin}/attachment/${attachment.path}`
|
|
156
156
|
}
|
|
157
157
|
})
|
|
158
158
|
}
|
|
@@ -206,7 +206,7 @@ router.get(
|
|
|
206
206
|
email: releaseGood.email
|
|
207
207
|
},
|
|
208
208
|
orderInventories,
|
|
209
|
-
orderPackages: orderPackages.length > 0 ? orderPackages: null,
|
|
209
|
+
orderPackages: orderPackages.length > 0 ? orderPackages : null,
|
|
210
210
|
deliveryOrders: deliveryOrders.length > 0 ? deliveryOrders : null,
|
|
211
211
|
attachment: attachments.length > 0 ? attachments : null
|
|
212
212
|
}
|