@things-factory/worksheet-base 4.3.30 → 4.3.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/worksheet-base",
3
- "version": "4.3.30",
3
+ "version": "4.3.31",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -31,14 +31,14 @@
31
31
  "@things-factory/integration-lmd": "^4.3.27",
32
32
  "@things-factory/integration-marketplace": "^4.3.29",
33
33
  "@things-factory/integration-sellercraft": "^4.3.29",
34
- "@things-factory/integration-sftp": "^4.3.30",
35
- "@things-factory/marketplace-base": "^4.3.30",
34
+ "@things-factory/integration-sftp": "^4.3.31",
35
+ "@things-factory/marketplace-base": "^4.3.31",
36
36
  "@things-factory/notification": "^4.3.27",
37
- "@things-factory/sales-base": "^4.3.30",
37
+ "@things-factory/sales-base": "^4.3.31",
38
38
  "@things-factory/setting-base": "^4.3.27",
39
39
  "@things-factory/shell": "^4.3.27",
40
40
  "@things-factory/transport-base": "^4.3.27",
41
- "@things-factory/warehouse-base": "^4.3.30"
41
+ "@things-factory/warehouse-base": "^4.3.31"
42
42
  },
43
- "gitHead": "087f169ad0ea9e85186350b5870d8ae25725392d"
43
+ "gitHead": "fe90b785970aafd08592c0692df9879fb48b6b84"
44
44
  }
@@ -0,0 +1,27 @@
1
+ import { EntityManager } from 'typeorm'
2
+
3
+ import { User } from '@things-factory/auth-base'
4
+ import {
5
+ ORDER_STATUS,
6
+ DraftReleaseGood
7
+ } from '@things-factory/sales-base'
8
+ import { Domain } from '@things-factory/shell'
9
+
10
+ export const cancelDraftReleaseOrder = {
11
+ async cancelDraftReleaseOrder(_: any, { name }, context: any) {
12
+ const { tx, domain, user }: { tx: EntityManager; domain: Domain; user: User } = context.state
13
+
14
+ const foundDRO: DraftReleaseGood = await tx.getRepository(DraftReleaseGood).findOne({
15
+ where: { domain, name }
16
+ })
17
+
18
+ if (foundDRO) {
19
+ await tx.getRepository(DraftReleaseGood).save({
20
+ ...foundDRO,
21
+ status: ORDER_STATUS.CANCELLED,
22
+ updater: user
23
+ })
24
+ }
25
+ return
26
+ }
27
+ }
@@ -22,6 +22,7 @@ import { Mutations as PackingMutations } from './packing'
22
22
  import { packingWorksheetResolver } from './packing-worksheet'
23
23
  import { palletizingPallets } from './palletizing-pallets'
24
24
  import { pendingCancellationReleaseOrder } from './pending-cancellation-release-order'
25
+ import { cancelDraftReleaseOrder } from './cancel-draft-release-order'
25
26
  import { Mutations as PickingMutations } from './picking'
26
27
  import { pickingWorksheetResolver } from './picking-worksheet'
27
28
  import { myPickingAssignmentStatusResolver } from './picking/my-picking-assignment-status'
@@ -132,5 +133,6 @@ export const Mutation = {
132
133
  ...crossDockPickingResolver,
133
134
  ...unpackingResolver,
134
135
  ...palletizingPallets,
135
- ...fetchSellercraftAirwayBillResolver
136
+ ...fetchSellercraftAirwayBillResolver,
137
+ ...cancelDraftReleaseOrder
136
138
  }
@@ -561,6 +561,10 @@ export const Mutation = /* GraphQL */ `
561
561
  refOrderNo: String!
562
562
  patches: [OrderVasPatch]
563
563
  ): Boolean @privilege(category: "worksheet_execute", privilege: "mutation") @transaction
564
+
565
+ cancelDraftReleaseOrder (
566
+ name: String!
567
+ ): Boolean @transaction
564
568
  `
565
569
 
566
570
  export const Query = /* GraphQL */ `