@things-factory/operato-hub 4.3.135 → 4.3.138

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.
Files changed (36) hide show
  1. package/client/pages/bizplace/register.js +2 -0
  2. package/config.development.js +21 -6
  3. package/dist-server/controllers/bizplace-initializer/dataset/codes.js +1 -1
  4. package/dist-server/controllers/bizplace-initializer/dataset/codes.js.map +1 -1
  5. package/dist-server/graphql/resolvers/synchronization/sync-products-to-sellercraft.js +6 -6
  6. package/dist-server/middlewares/store-middleware.js.map +1 -1
  7. package/dist-server/routers/api/restful-apis/unstable/add-release-order.js +8 -8
  8. package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js +2 -2
  9. package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js.map +1 -1
  10. package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-shipping-order.js.map +1 -1
  11. package/dist-server/routers/api/restful-apis/v1/middlewares/business-middleware.js +1 -1
  12. package/dist-server/routers/api/restful-apis/v1/middlewares/business-middleware.js.map +1 -1
  13. package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js +10 -6
  14. package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js.map +1 -1
  15. package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-inbound-order.js.map +1 -1
  16. package/dist-server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.js +3 -1
  17. package/dist-server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.js.map +1 -1
  18. package/dist-server/routers/xilnex-router.js +2 -0
  19. package/dist-server/routers/xilnex-router.js.map +1 -1
  20. package/openapi/v1/Inventory.yaml +269 -0
  21. package/package.json +31 -31
  22. package/server/controllers/bizplace-initializer/dataset/codes.ts +1 -1
  23. package/server/graphql/resolvers/synchronization/sync-products-to-sellercraft.ts +6 -6
  24. package/server/middlewares/store-middleware.ts +1 -0
  25. package/server/routers/api/restful-apis/unstable/add-release-order.ts +8 -8
  26. package/server/routers/api/restful-apis/v1/company/get-product-list.ts +2 -2
  27. package/server/routers/api/restful-apis/v1/company/update-marketplace-shipping-order.ts +0 -1
  28. package/server/routers/api/restful-apis/v1/middlewares/business-middleware.ts +1 -2
  29. package/server/routers/api/restful-apis/v1/warehouse/add-release-order.ts +14 -9
  30. package/server/routers/api/restful-apis/v1/warehouse/cancel-inbound-order.ts +5 -1
  31. package/server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.ts +4 -3
  32. package/server/routers/xilnex-router.ts +2 -0
  33. package/translations/en.json +2 -0
  34. package/translations/ko.json +2 -0
  35. package/translations/ms.json +2 -0
  36. package/translations/zh.json +2 -0
@@ -24,7 +24,7 @@ router.get(
24
24
  delete filter['offset']
25
25
  const [products, totalCount]: Product[] = await getRepository(Product).findAndCount({
26
26
  where: filter,
27
- relations: ['productDetails'],
27
+ relations: ['productDetails', 'productDetails.productBarcodes'],
28
28
  skip: offset,
29
29
  take: limit,
30
30
  order: { createdAt: 'DESC' }
@@ -37,7 +37,7 @@ router.get(
37
37
  for (const productDetail of product.productDetails) {
38
38
  const productDetailDataPoint = {
39
39
  isDefault: productDetail.isDefault,
40
- gtin: productDetail.gtin,
40
+ gtin: productDetail.productBarcodes.map(itm => itm.gtin),
41
41
  refCode: productDetail.refCode,
42
42
  packingType: productDetail.packingType,
43
43
  packingSize: productDetail.packingSize,
@@ -28,7 +28,6 @@ router.post(
28
28
 
29
29
  marketplaceOrderShipping.ownTrackingNo = data.trackingNo
30
30
 
31
-
32
31
  marketplaceOrderShipping = await tx.getRepository(MarketplaceOrderShippingEntity).save({
33
32
  ...marketplaceOrderShipping,
34
33
  ...data,
@@ -45,8 +45,7 @@ export async function businessMiddleware(context, next) {
45
45
  }
46
46
  }
47
47
  context.state.business = bizplace.company
48
- }
49
- else if ((domain.extType === 'company')) {
48
+ } else if (domain.extType === 'company') {
50
49
  let company = await getRepository(Company).findOne({ where: { domain }, relations: ['domain'] })
51
50
  context.state.business = company
52
51
  }
@@ -401,14 +401,18 @@ async function createReleaseGood(
401
401
  })
402
402
  }
403
403
 
404
- // standardise country
405
- let deliveryCountry: GeoCountry = releaseGood?.country ? await geoCountryRepo.findOne({
406
- where: [{ name: ILike(releaseGood?.country) }, { description: ILike(releaseGood?.country) }]
407
- }) : null
404
+ // standardise country
405
+ let deliveryCountry: GeoCountry = releaseGood?.country
406
+ ? await geoCountryRepo.findOne({
407
+ where: [{ name: ILike(releaseGood?.country) }, { description: ILike(releaseGood?.country) }]
408
+ })
409
+ : null
408
410
 
409
- let platformCountry: GeoCountry = releaseGood?.platformCountry ? await geoCountryRepo.findOne({
410
- where: [{ name: ILike(releaseGood.platformCountry) }, { description: ILike(releaseGood.platformCountry) }]
411
- }) : null
411
+ let platformCountry: GeoCountry = releaseGood?.platformCountry
412
+ ? await geoCountryRepo.findOne({
413
+ where: [{ name: ILike(releaseGood.platformCountry) }, { description: ILike(releaseGood.platformCountry) }]
414
+ })
415
+ : null
412
416
 
413
417
  newReleaseGood = {
414
418
  name: roNoSetting
@@ -899,8 +903,9 @@ async function assignToInventory(orderProducts: OrderProduct[], customerBizplace
899
903
  sum(qty - locked_qty - release_qty) over (order by sort_seq asc rows between unbounded preceding and current row) as lock_amount
900
904
  from (
901
905
  SELECT 0 as sort_seq, null as id, null as pallet_id, null as batch_id, null as batch_id_ref,
902
- null as unit, '${orderInventory.uom}' as uom, '${orderInventory.packingType}' as packing_type, '${orderInventory.packingSize
903
- }' as packing_size,
906
+ null as unit, '${orderInventory.uom}' as uom, '${orderInventory.packingType}' as packing_type, '${
907
+ orderInventory.packingSize
908
+ }' as packing_size,
904
909
  null as manufacture_year, null as carton_id, 0 as uom_value, 0 as locked_uom_value, 0 as qty, 0 as locked_qty, null as created_at,
905
910
  '${orderInventory.releaseQty}' as release_qty, '${orderInventory.releaseUomValue}' as release_uom_value
906
911
  UNION
@@ -40,7 +40,11 @@ router.post(
40
40
  where: { name: bodyReq.ganNo }
41
41
  })
42
42
  if (!validateArrivalNotice) throw new ApiError('E04', 'ganNo')
43
- if (validateArrivalNotice && validateArrivalNotice.status != ORDER_STATUS.PENDING_RECEIVE) throw new ApiError('E01', `${validateArrivalNotice.name} is in "${validateArrivalNotice.status}" and not "${ORDER_STATUS.PENDING_RECEIVE}" state`)
43
+ if (validateArrivalNotice && validateArrivalNotice.status != ORDER_STATUS.PENDING_RECEIVE)
44
+ throw new ApiError(
45
+ 'E01',
46
+ `${validateArrivalNotice.name} is in "${validateArrivalNotice.status}" and not "${ORDER_STATUS.PENDING_RECEIVE}" state`
47
+ )
44
48
 
45
49
  const arrivalNotice: ArrivalNotice = await rejectArrivalNotice(
46
50
  tx,
@@ -3,7 +3,6 @@ import { Between, getRepository } from 'typeorm'
3
3
  import { restfulApiRouter as router } from '@things-factory/api'
4
4
  import { Inventory } from '@things-factory/warehouse-base'
5
5
 
6
-
7
6
  import { ApiError, ApiErrorHandler, throwInternalServerError } from '../utils/error-util'
8
7
  import _ from 'lodash'
9
8
  import { businessMiddleware, validationMiddleware, loggingMiddleware } from '../middlewares'
@@ -20,7 +19,7 @@ router.get(
20
19
  filter['bizplace'] = filter['bizplaceId']
21
20
  delete filter['bizplaceId']
22
21
  if (_.has(filter, 'sku')) {
23
- filter.product = { sku: filter['sku']}
22
+ filter.product = { sku: filter['sku'] }
24
23
  delete filter['sku']
25
24
  }
26
25
  filter['createdAt'] = Between(fromDate, toDate)
@@ -52,7 +51,9 @@ router.get(
52
51
  qty: inventory.qty,
53
52
  reservedQty: inventory.lockedQty,
54
53
  expirationDate: inventory.expirationDate,
55
- weight: inventory.product.weight ? `${inventory.product.weight * inventory.qty} ${inventory.product.weightUnit}` : null,
54
+ weight: inventory.product.weight
55
+ ? `${inventory.product.weight * inventory.qty} ${inventory.product.weightUnit}`
56
+ : null,
56
57
  lastSeq: inventory?.lastSeq,
57
58
  status: 'STORED',
58
59
  product: {
@@ -161,6 +161,7 @@ xilnexRouter.post('/webhook-xilnex-po', async (context, next) => {
161
161
  uom: productDetail?.uom,
162
162
  uomValue: productDetail?.uomValue,
163
163
  packQty: item.confirmedQty,
164
+ palletQty: 1,
164
165
  totalUomValue: `${(productDetail.uomValue * item.confirmedQty).toFixed(2)} ${productDetail.uom}`,
165
166
  status: PURCHASE_ORDER_STATUS.DRAFT,
166
167
  unitPrice: item.unitCost || 1,
@@ -443,6 +444,7 @@ xilnexRouter.post('/webhook-xilnex-transfer-note', async (context, next) => {
443
444
  uom: productDetail?.uom,
444
445
  uomValue: productDetail?.uomValue,
445
446
  packQty: item.confirmedQty,
447
+ palletQty: 1,
446
448
  totalUomValue: `${(productDetail.uomValue * item.confirmedQty).toFixed(2)} ${productDetail.uom}`,
447
449
  status: 'PENDING',
448
450
  arrivalNotice,
@@ -37,6 +37,7 @@
37
37
  "label.warehouse": "warehouse",
38
38
 
39
39
  "text.are_you_sure_to_sync_product": "are you sure to sync product?",
40
+ "text.attachment_info_not_valid": "attachment info not valid",
40
41
  "text.nothing_to_sync": "no data available for synchronisation",
41
42
  "text.please_select_template_type": "please select template type",
42
43
  "text.please_wait": "please wait",
@@ -47,6 +48,7 @@
47
48
  "text.user_deleted_successfully": "user deleted successfully",
48
49
  "text.x_cannot_delete": "{x} cannot be deleted",
49
50
  "text.transform_to_x": "transform to {x}",
51
+ "text.contact_type_does_not_exist": "contact type does not exist",
50
52
 
51
53
  "error.company not found": "company not found",
52
54
  "error.eta date is invalid": "eta date is invalid",
@@ -17,6 +17,7 @@
17
17
  "label.state": "상태",
18
18
 
19
19
  "text.are_you_sure_to_sync_product": "상품을 동기화하시겠습니까?",
20
+ "text.attachment_info_not_valid": "첨부파일 정보 유효하지 않음",
20
21
  "text.nothing_to_sync": "[ko]no data available for synchronisation",
21
22
  "text.please_wait": "잠시만 기다려주세요.",
22
23
  "text.product_sync_to_accounting": "[ko]synchronising product to accounting platform",
@@ -55,6 +56,7 @@
55
56
  "text.transform_to_x": "{x}로 변경",
56
57
  "text.user_deleted_successfully": "성공적으로 사용자를 삭제하였습니다.",
57
58
  "text.x_cannot_delete": "{x}(은)는 삭제할 수 없습니다.",
59
+ "text.contact_type_does_not_exist": "[ko]contact type does not exist",
58
60
  "error.warehouse not found": "웨어하우스를 찾을 수 없습니다.",
59
61
  "error.warehouse not found in the company": "회사내에서 웨어하우스를 찾을 수 없습니다.",
60
62
 
@@ -32,12 +32,14 @@
32
32
  "label.warehouse": "[ms] warehouse",
33
33
 
34
34
  "text.are_you_sure_to_sync_product": "[ms] are you sure to sync product?",
35
+ "text.attachment_info_not_valid": "informasi lampiran tidak sah",
35
36
  "text.nothing_to_sync": "[ms] no data available for synchronisation",
36
37
  "text.please_select_template_type": "[ms] please select template type",
37
38
  "text.please_wait": "[ms] please wait",
38
39
  "text.product_sync_to_accounting": "[ms] synchronising product to accounting platform",
39
40
  "text.success": "[ms] success",
40
41
  "text.transform_to_x": "[ms] transform to {x}",
42
+ "text.contact_type_does_not_exist": "[ms]contact type does not exist",
41
43
 
42
44
  "error.company not found": "[ms] company not found",
43
45
  "error.eta date is invalid": "[ms] eta date is invalid",
@@ -36,12 +36,14 @@
36
36
  "label.warehouse": "仓库",
37
37
 
38
38
  "text.are_you_sure_to_sync_product": "您确定要同步产品信息吗?",
39
+ "text.attachment_info_not_valid": "attachment info not valid",
39
40
  "text.nothing_to_sync": "没有可用于同步的数据!",
40
41
  "text.please_select_template_type": "请选择模板类型!",
41
42
  "text.please_wait": "请等待",
42
43
  "text.product_sync_to_accounting": "正在将产品与会计平台同步",
43
44
  "text.success": "成功",
44
45
  "text.transform_to_x": "变更为{x}",
46
+ "text.contact_type_does_not_exist": "[zh]contact type does not exist",
45
47
 
46
48
  "error.company not found": "未找到公司信息。",
47
49
  "error.eta date is invalid": "[zh] eta date is invalid",