@things-factory/sales-base 4.3.544 → 4.3.546
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/constants/order.js +2 -1
- package/dist-server/constants/order.js.map +1 -1
- package/dist-server/service/arrival-notice/arrival-notice-mutation.js +3 -3
- package/dist-server/service/arrival-notice/arrival-notice-mutation.js.map +1 -1
- package/dist-server/service/draft-release-good/draft-release-good-create.js +2 -2
- package/dist-server/service/draft-release-good/draft-release-good-create.js.map +1 -1
- package/dist-server/service/draft-release-good/draft-release-good-mutation.js +1 -1
- package/dist-server/service/draft-release-good/draft-release-good-mutation.js.map +1 -1
- package/dist-server/service/manifest/manifest-mutation.js +1 -1
- package/dist-server/service/manifest/manifest-mutation.js.map +1 -1
- package/dist-server/service/release-good/release-good-mutation.js +3 -3
- package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
- package/dist-server/service/vas/vas-mutation.js +19 -6
- package/dist-server/service/vas/vas-mutation.js.map +1 -1
- package/package.json +2 -2
- package/server/constants/order.ts +2 -1
- package/server/service/arrival-notice/arrival-notice-mutation.ts +4 -4
- package/server/service/draft-release-good/draft-release-good-create.ts +3 -3
- package/server/service/draft-release-good/draft-release-good-mutation.ts +2 -2
- package/server/service/manifest/manifest-mutation.ts +2 -2
- package/server/service/release-good/release-good-mutation.ts +4 -4
- package/server/service/vas/vas-mutation.ts +48 -10
|
@@ -1,12 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Arg,
|
|
3
|
+
Ctx,
|
|
4
|
+
Directive,
|
|
5
|
+
Mutation,
|
|
6
|
+
Resolver
|
|
7
|
+
} from 'type-graphql'
|
|
8
|
+
import { EntityManager } from 'typeorm'
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid'
|
|
10
|
+
|
|
1
11
|
import { User } from '@things-factory/auth-base'
|
|
12
|
+
import {
|
|
13
|
+
Product,
|
|
14
|
+
ProductDetail
|
|
15
|
+
} from '@things-factory/product-base'
|
|
2
16
|
import { Domain } from '@things-factory/shell'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
NewVas,
|
|
20
|
+
OrderVas,
|
|
21
|
+
OrderVasItem,
|
|
22
|
+
OrderVasItemPatch,
|
|
23
|
+
OrderVasPatch,
|
|
24
|
+
ReleaseGood,
|
|
25
|
+
VasPatch
|
|
26
|
+
} from '../'
|
|
27
|
+
import {
|
|
28
|
+
ORDER_STATUS,
|
|
29
|
+
ORDER_VAS_STATUS
|
|
30
|
+
} from '../../constants'
|
|
7
31
|
import { Vas } from './vas'
|
|
8
|
-
import { v4 as uuidv4 } from 'uuid'
|
|
9
|
-
import { ORDER_STATUS, ORDER_VAS_STATUS } from '../../constants'
|
|
10
32
|
|
|
11
33
|
@Resolver(Vas)
|
|
12
34
|
export class VasMutation {
|
|
@@ -424,6 +446,22 @@ async function _handleApprovedVas(tx, domain, user, releaseGood, approvedVas) {
|
|
|
424
446
|
relations: ['product', 'productDetail', 'newProduct', 'newProductDetail', 'releaseGood', 'orderVasItems']
|
|
425
447
|
})
|
|
426
448
|
|
|
449
|
+
const adjustedProduct: Product = await tx.getRepository(Product).findOne({
|
|
450
|
+
where: { id: orderVas.adjustedProductId }
|
|
451
|
+
})
|
|
452
|
+
|
|
453
|
+
const adjustedProductDetail: ProductDetail = await tx.getRepository(ProductDetail).findOne({
|
|
454
|
+
where: { id: orderVas.adjustedProductDetailId }
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
const adjustedNewProduct: Product = await tx.getRepository(Product).findOne({
|
|
458
|
+
where: { id: orderVas.adjustedNewProductId }
|
|
459
|
+
})
|
|
460
|
+
|
|
461
|
+
const adjustedNewProductDetail: ProductDetail = await tx.getRepository(ProductDetail).findOne({
|
|
462
|
+
where: { id: orderVas.adjustedNewProductDetailId }
|
|
463
|
+
})
|
|
464
|
+
|
|
427
465
|
switch (ov.editType) {
|
|
428
466
|
case ORDER_VAS_STATUS.NEW:
|
|
429
467
|
await tx.getRepository(OrderVas).update(
|
|
@@ -453,15 +491,15 @@ async function _handleApprovedVas(tx, domain, user, releaseGood, approvedVas) {
|
|
|
453
491
|
{ id: ov.id },
|
|
454
492
|
{
|
|
455
493
|
batchId: orderVas.adjustedBatchId ? orderVas.adjustedBatchId : orderVas.batchId,
|
|
456
|
-
product:
|
|
457
|
-
productDetail:
|
|
494
|
+
product: adjustedProduct ? adjustedProduct : orderVas.product,
|
|
495
|
+
productDetail: adjustedProductDetail ? adjustedProductDetail : orderVas.productDetail,
|
|
458
496
|
uom: orderVas.adjustedUom ? orderVas.adjustedUom : orderVas.uom,
|
|
459
497
|
uomValue: orderVas.adjustedNewUom ? orderVas.adjustedUomValue : orderVas.uomValue,
|
|
460
498
|
packingType: orderVas.adjustedPackingType ? orderVas.adjustedPackingType : orderVas.packingType,
|
|
461
499
|
qty: orderVas.adjustedQty ? orderVas.adjustedQty : orderVas.qty,
|
|
462
500
|
outputQty: orderVas.adjustedOutputQty ? orderVas.adjustedOutputQty : orderVas.outputQty,
|
|
463
|
-
newProduct:
|
|
464
|
-
newProductDetail:
|
|
501
|
+
newProduct: adjustedNewProduct ? adjustedNewProduct : orderVas.newProduct,
|
|
502
|
+
newProductDetail: adjustedNewProductDetail ? adjustedNewProductDetail : orderVas.newProductDetail,
|
|
465
503
|
newBatchId: orderVas.adjustedNewBatchId ? orderVas.adjustedNewBatchId : orderVas.newBatchId,
|
|
466
504
|
newPackingType: orderVas.adjustedNewPackingType ? orderVas.adjustedNewPackingType : orderVas.newPackingType,
|
|
467
505
|
newUom: orderVas.adjustedNewUom ? orderVas.adjustedNewUom : orderVas.newUom,
|