@things-factory/sales-base 8.0.0-beta.8 → 8.0.0

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 (178) hide show
  1. package/dist-server/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +13 -13
  3. package/server/constants/attachment-type.ts +9 -0
  4. package/server/constants/index.ts +7 -0
  5. package/server/constants/load-type.ts +4 -0
  6. package/server/constants/order.ts +203 -0
  7. package/server/constants/product-group-type.ts +4 -0
  8. package/server/constants/release-good.ts +9 -0
  9. package/server/constants/transfer-order-type.ts +6 -0
  10. package/server/constants/validation-error-code.ts +3 -0
  11. package/server/constants/vas-target-type.ts +25 -0
  12. package/server/controllers/ecommerce/ecommerce-controller.ts +122 -0
  13. package/server/controllers/ecommerce/index.ts +2 -0
  14. package/server/controllers/ecommerce/sellercraft-controller.ts +182 -0
  15. package/server/controllers/index.ts +2 -0
  16. package/server/controllers/order-controller.ts +296 -0
  17. package/server/errors/index.ts +1 -0
  18. package/server/errors/validation-error.ts +25 -0
  19. package/server/index.ts +5 -0
  20. package/server/migrations/index.ts +9 -0
  21. package/server/service/arrival-notice/arrival-notice-mutation.ts +1152 -0
  22. package/server/service/arrival-notice/arrival-notice-query.ts +549 -0
  23. package/server/service/arrival-notice/arrival-notice-types.ts +310 -0
  24. package/server/service/arrival-notice/arrival-notice.ts +202 -0
  25. package/server/service/arrival-notice/index.ts +9 -0
  26. package/server/service/claim/claim-mutation.ts +308 -0
  27. package/server/service/claim/claim-query.ts +122 -0
  28. package/server/service/claim/claim-types.ts +130 -0
  29. package/server/service/claim/claim.ts +140 -0
  30. package/server/service/claim/index.ts +9 -0
  31. package/server/service/claim-detail/claim-detail-mutation.ts +102 -0
  32. package/server/service/claim-detail/claim-detail-query.ts +55 -0
  33. package/server/service/claim-detail/claim-detail-types.ts +47 -0
  34. package/server/service/claim-detail/claim-detail.ts +69 -0
  35. package/server/service/claim-detail/index.ts +9 -0
  36. package/server/service/claim-order/claim-order-mutation.ts +101 -0
  37. package/server/service/claim-order/claim-order-query.ts +47 -0
  38. package/server/service/claim-order/claim-order-types.ts +35 -0
  39. package/server/service/claim-order/claim-order.ts +81 -0
  40. package/server/service/claim-order/index.ts +9 -0
  41. package/server/service/collection-order/collection-order-mutation.ts +245 -0
  42. package/server/service/collection-order/collection-order-query.ts +97 -0
  43. package/server/service/collection-order/collection-order-types.ts +165 -0
  44. package/server/service/collection-order/collection-order.ts +135 -0
  45. package/server/service/collection-order/index.ts +9 -0
  46. package/server/service/delivery-order/delivery-order-mutation.ts +967 -0
  47. package/server/service/delivery-order/delivery-order-query.ts +631 -0
  48. package/server/service/delivery-order/delivery-order-types.ts +268 -0
  49. package/server/service/delivery-order/delivery-order.ts +258 -0
  50. package/server/service/delivery-order/index.ts +9 -0
  51. package/server/service/draft-release-good/draft-release-good-mutation.ts +765 -0
  52. package/server/service/draft-release-good/draft-release-good-query.ts +354 -0
  53. package/server/service/draft-release-good/draft-release-good-type.ts +261 -0
  54. package/server/service/draft-release-good/draft-release-good.ts +284 -0
  55. package/server/service/draft-release-good/index.ts +9 -0
  56. package/server/service/goods-receival-note/goods-receival-note-mutation.ts +129 -0
  57. package/server/service/goods-receival-note/goods-receival-note-query.ts +280 -0
  58. package/server/service/goods-receival-note/goods-receival-note-types.ts +105 -0
  59. package/server/service/goods-receival-note/goods-receival-note.ts +127 -0
  60. package/server/service/goods-receival-note/index.ts +9 -0
  61. package/server/service/index.ts +238 -0
  62. package/server/service/inventory-check/index.ts +9 -0
  63. package/server/service/inventory-check/inventory-check-mutation.ts +149 -0
  64. package/server/service/inventory-check/inventory-check-query.ts +48 -0
  65. package/server/service/inventory-check/inventory-check-types.ts +48 -0
  66. package/server/service/inventory-check/inventory-check.ts +90 -0
  67. package/server/service/invoice/index.ts +9 -0
  68. package/server/service/invoice/invoice-mutation.ts +95 -0
  69. package/server/service/invoice/invoice-query.ts +53 -0
  70. package/server/service/invoice/invoice-types.ts +279 -0
  71. package/server/service/invoice/invoice.ts +230 -0
  72. package/server/service/invoice-product/index.ts +9 -0
  73. package/server/service/invoice-product/invoice-product-mutation.ts +54 -0
  74. package/server/service/invoice-product/invoice-product-query.ts +54 -0
  75. package/server/service/invoice-product/invoice-product-types.ts +84 -0
  76. package/server/service/invoice-product/invoice-product.ts +92 -0
  77. package/server/service/job-sheet/index.ts +9 -0
  78. package/server/service/job-sheet/job-sheet-mutation.ts +92 -0
  79. package/server/service/job-sheet/job-sheet-query.ts +112 -0
  80. package/server/service/job-sheet/job-sheet-types.ts +78 -0
  81. package/server/service/job-sheet/job-sheet.ts +102 -0
  82. package/server/service/manifest/index.ts +6 -0
  83. package/server/service/manifest/manifest-mutation.ts +190 -0
  84. package/server/service/manifest/manifest-query.ts +149 -0
  85. package/server/service/manifest/manifest-type.ts +84 -0
  86. package/server/service/manifest/manifest.ts +114 -0
  87. package/server/service/order-inventory/index.ts +9 -0
  88. package/server/service/order-inventory/order-inventory-mutation.ts +54 -0
  89. package/server/service/order-inventory/order-inventory-query.ts +722 -0
  90. package/server/service/order-inventory/order-inventory-types.ts +238 -0
  91. package/server/service/order-inventory/order-inventory.ts +401 -0
  92. package/server/service/order-product/index.ts +9 -0
  93. package/server/service/order-product/order-product-mutation.ts +48 -0
  94. package/server/service/order-product/order-product-query.ts +89 -0
  95. package/server/service/order-product/order-product-types.ts +335 -0
  96. package/server/service/order-product/order-product.ts +362 -0
  97. package/server/service/order-tote/index.ts +9 -0
  98. package/server/service/order-tote/order-tote-mutation.ts +31 -0
  99. package/server/service/order-tote/order-tote-query.ts +112 -0
  100. package/server/service/order-tote/order-tote-types.ts +47 -0
  101. package/server/service/order-tote/order-tote.ts +73 -0
  102. package/server/service/order-tote-item/index.ts +9 -0
  103. package/server/service/order-tote-item/order-tote-item-mutation.ts +31 -0
  104. package/server/service/order-tote-item/order-tote-item-query.ts +82 -0
  105. package/server/service/order-tote-item/order-tote-item-types.ts +56 -0
  106. package/server/service/order-tote-item/order-tote-item.ts +72 -0
  107. package/server/service/order-tote-seal/index.ts +9 -0
  108. package/server/service/order-tote-seal/order-tote-seal-mutation.ts +31 -0
  109. package/server/service/order-tote-seal/order-tote-seal-query.ts +59 -0
  110. package/server/service/order-tote-seal/order-tote-seal-types.ts +41 -0
  111. package/server/service/order-tote-seal/order-tote-seal.ts +46 -0
  112. package/server/service/order-vas/index.ts +9 -0
  113. package/server/service/order-vas/order-vas-mutation.ts +20 -0
  114. package/server/service/order-vas/order-vas-query.ts +72 -0
  115. package/server/service/order-vas/order-vas-types.ts +159 -0
  116. package/server/service/order-vas/order-vas.ts +207 -0
  117. package/server/service/others/index.ts +5 -0
  118. package/server/service/others/other-query.ts +563 -0
  119. package/server/service/others/other-types.ts +115 -0
  120. package/server/service/purchase-order/index.ts +9 -0
  121. package/server/service/purchase-order/purchase-order-mutation.ts +458 -0
  122. package/server/service/purchase-order/purchase-order-query.ts +90 -0
  123. package/server/service/purchase-order/purchase-order-types.ts +154 -0
  124. package/server/service/purchase-order/purchase-order.ts +172 -0
  125. package/server/service/purchase-order-other-charge/index.ts +9 -0
  126. package/server/service/purchase-order-other-charge/purchase-order-other-charge-mutation.ts +31 -0
  127. package/server/service/purchase-order-other-charge/purchase-order-other-charge-query.ts +52 -0
  128. package/server/service/purchase-order-other-charge/purchase-order-other-charge-types.ts +44 -0
  129. package/server/service/purchase-order-other-charge/purchase-order-other-charge.ts +68 -0
  130. package/server/service/release-good/index.ts +9 -0
  131. package/server/service/release-good/release-good-mutation.ts +1686 -0
  132. package/server/service/release-good/release-good-query.ts +980 -0
  133. package/server/service/release-good/release-good-types.ts +662 -0
  134. package/server/service/release-good/release-good.ts +490 -0
  135. package/server/service/retail-replenishment-order/index.ts +9 -0
  136. package/server/service/retail-replenishment-order/retail-replenishment-order-mutation.ts +382 -0
  137. package/server/service/retail-replenishment-order/retail-replenishment-order-query.ts +54 -0
  138. package/server/service/retail-replenishment-order/retail-replenishment-order-types.ts +101 -0
  139. package/server/service/retail-replenishment-order/retail-replenishment-order.ts +115 -0
  140. package/server/service/return-order/index.ts +9 -0
  141. package/server/service/return-order/return-order-mutation.ts +516 -0
  142. package/server/service/return-order/return-order-query.ts +226 -0
  143. package/server/service/return-order/return-order-types.ts +196 -0
  144. package/server/service/return-order/return-order.ts +127 -0
  145. package/server/service/reverse-kitting-order/index.ts +9 -0
  146. package/server/service/reverse-kitting-order/reverse-kitting-order-mutation.ts +500 -0
  147. package/server/service/reverse-kitting-order/reverse-kitting-order-query.ts +197 -0
  148. package/server/service/reverse-kitting-order/reverse-kitting-order-type.ts +173 -0
  149. package/server/service/reverse-kitting-order/reverse-kitting-order.ts +121 -0
  150. package/server/service/reverse-kitting-order-inventory/index.ts +9 -0
  151. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory-mutation.ts +129 -0
  152. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory-query.ts +52 -0
  153. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory-type.ts +95 -0
  154. package/server/service/reverse-kitting-order-inventory/reverse-kitting-order-inventory.ts +143 -0
  155. package/server/service/shipping-order/index.ts +9 -0
  156. package/server/service/shipping-order/shipping-order-mutation.ts +61 -0
  157. package/server/service/shipping-order/shipping-order-query.ts +61 -0
  158. package/server/service/shipping-order/shipping-order-types.ts +89 -0
  159. package/server/service/shipping-order/shipping-order.ts +129 -0
  160. package/server/service/transfer-order/index.ts +9 -0
  161. package/server/service/transfer-order/transfer-order-mutation.ts +309 -0
  162. package/server/service/transfer-order/transfer-order-query.ts +66 -0
  163. package/server/service/transfer-order/transfer-order-types.ts +97 -0
  164. package/server/service/transfer-order/transfer-order.ts +117 -0
  165. package/server/service/vas/index.ts +9 -0
  166. package/server/service/vas/vas-mutation.ts +106 -0
  167. package/server/service/vas/vas-query.ts +60 -0
  168. package/server/service/vas/vas-types.ts +71 -0
  169. package/server/service/vas/vas.ts +77 -0
  170. package/server/service/vas-order/index.ts +9 -0
  171. package/server/service/vas-order/vas-order-mutation.ts +259 -0
  172. package/server/service/vas-order/vas-order-query.ts +119 -0
  173. package/server/service/vas-order/vas-order-types.ts +49 -0
  174. package/server/service/vas-order/vas-order.ts +81 -0
  175. package/server/utils/datetime-util.ts +54 -0
  176. package/server/utils/index.ts +3 -0
  177. package/server/utils/inventory-util.ts +1155 -0
  178. package/server/utils/order-no-generator.ts +146 -0
@@ -0,0 +1,238 @@
1
+ import { Field, Float, InputType, Int, ObjectType } from 'type-graphql'
2
+
3
+ import { NewProduct } from '@things-factory/product-base'
4
+ import { ObjectRef } from '@things-factory/shell'
5
+ import { InventoryPatch } from '@things-factory/warehouse-base'
6
+
7
+ import { OrderInventory } from './order-inventory'
8
+
9
+ @ObjectType()
10
+ export class OrderInventoryList {
11
+ @Field(type => [OrderInventory], { nullable: true })
12
+ items: OrderInventory[]
13
+
14
+ @Field(type => Int, { nullable: true })
15
+ total: number
16
+ }
17
+
18
+ @InputType()
19
+ export class NewOrderInventory {
20
+ @Field({ nullable: true })
21
+ name: string
22
+
23
+ @Field({ nullable: true })
24
+ description: string
25
+
26
+ @Field({ nullable: true })
27
+ type: string
28
+
29
+ @Field(type => ObjectRef, { nullable: true })
30
+ arrivalNotice: ObjectRef
31
+
32
+ @Field(type => ObjectRef, { nullable: true })
33
+ deliveryOrder: ObjectRef
34
+
35
+ @Field(type => ObjectRef, { nullable: true })
36
+ transferOrder: ObjectRef
37
+
38
+ @Field(type => InventoryPatch, { nullable: true })
39
+ inventory: InventoryPatch
40
+
41
+ @Field(type => NewProduct, { nullable: true })
42
+ product: NewProduct
43
+
44
+ @Field({ nullable: true })
45
+ productSKU: string
46
+
47
+ @Field({ nullable: true })
48
+ batchId: string
49
+
50
+ @Field({ nullable: true })
51
+ batchIdRef: string
52
+
53
+ @Field({ nullable: true })
54
+ productName: string
55
+
56
+ @Field({ nullable: true })
57
+ batchExp: string
58
+
59
+ @Field({ nullable: true })
60
+ packingType: string
61
+
62
+ @Field(type => Float, { nullable: true })
63
+ packingSize: number
64
+
65
+ @Field(type => Float, { nullable: true })
66
+ releaseQty: number
67
+
68
+ @Field(type => Float, { nullable: true })
69
+ pickedQty: number
70
+
71
+ @Field(type => Float, { nullable: true })
72
+ sortedQty: number
73
+
74
+ @Field(type => Float, { nullable: true })
75
+ packedQty: number
76
+
77
+ @Field(type => Float, { nullable: true })
78
+ releaseUomValue: number
79
+
80
+ @Field({ nullable: true })
81
+ uom: string
82
+
83
+ @Field(type => Float, { nullable: true })
84
+ palletQty: number
85
+
86
+ @Field({ nullable: true })
87
+ remark: string
88
+
89
+ @Field({ nullable: true })
90
+ issue: string
91
+
92
+ @Field({ nullable: true })
93
+ crossDocking: boolean
94
+
95
+ @Field({ nullable: true })
96
+ status: string
97
+
98
+ @Field({ nullable: true })
99
+ existingRow: boolean
100
+
101
+ @Field(type => Float, { nullable: true })
102
+ returnQty: number
103
+
104
+ @Field(type => Float, { nullable: true })
105
+ returnUomValue: number
106
+
107
+ @Field(type => Float, { nullable: true })
108
+ returnToLocationQty: number
109
+
110
+ @Field(type => Float, { nullable: true })
111
+ returnToLocationUomValue: number
112
+ }
113
+
114
+ @InputType()
115
+ export class OrderInventoryPatch {
116
+ @Field({ nullable: true })
117
+ id: string
118
+
119
+ @Field({ nullable: true })
120
+ name: string
121
+
122
+ @Field({ nullable: true })
123
+ description: string
124
+
125
+ @Field({ nullable: true })
126
+ type: string
127
+
128
+ @Field(type => ObjectRef, { nullable: true })
129
+ arrivalNotice: ObjectRef
130
+
131
+ @Field(type => ObjectRef, { nullable: true })
132
+ deliveryOrder: ObjectRef
133
+
134
+ @Field(type => ObjectRef, { nullable: true })
135
+ transferOrder: ObjectRef
136
+
137
+ @Field(type => ObjectRef, { nullable: true })
138
+ returnOrder: ObjectRef
139
+
140
+ @Field(type => ObjectRef, { nullable: true })
141
+ inventory: ObjectRef
142
+
143
+ @Field(type => Int, { nullable: true })
144
+ inspectedQty: number
145
+
146
+ @Field(type => Float, { nullable: true })
147
+ inspectedUomValue: number
148
+
149
+ @Field(type => ObjectRef, { nullable: true })
150
+ inspectedLocation: ObjectRef
151
+
152
+ @Field(type => ObjectRef, { nullable: true })
153
+ binLocation: ObjectRef
154
+
155
+ @Field({ nullable: true })
156
+ inspectedBatchNo: string
157
+
158
+ @Field(type => ObjectRef, { nullable: true })
159
+ product: ObjectRef
160
+
161
+ @Field(type => ObjectRef, { nullable: true })
162
+ orderProduct: ObjectRef
163
+
164
+ @Field({ nullable: true })
165
+ batchId: string
166
+
167
+ @Field({ nullable: true })
168
+ batchIdRef: string
169
+
170
+ @Field({ nullable: true })
171
+ packingType: string
172
+
173
+ @Field(type => Float, { nullable: true })
174
+ packingSize: number
175
+
176
+ @Field({ nullable: true })
177
+ productName: string
178
+
179
+ @Field({ nullable: true })
180
+ pallet: string
181
+
182
+ @Field({ nullable: true })
183
+ extraJsonData: string
184
+
185
+ @Field(type => Float, { nullable: true })
186
+ releaseQty: number
187
+
188
+ @Field({ nullable: true })
189
+ serialNumber: string
190
+
191
+ @Field(type => Int, { nullable: true })
192
+ sortedQty: number
193
+
194
+ @Field(type => Int, { nullable: true })
195
+ pickedQty: number
196
+
197
+ @Field(type => Int, { nullable: true })
198
+ packedQty: number
199
+
200
+ @Field({ nullable: true })
201
+ productId: string
202
+
203
+ @Field({ nullable: true })
204
+ orderProductId: string
205
+
206
+ @Field({ nullable: true })
207
+ uom: string
208
+
209
+ @Field(type => Float, { nullable: true })
210
+ releaseUomValue: number
211
+
212
+ @Field(type => Float, { nullable: true })
213
+ returnUomValue: number
214
+
215
+ @Field(type => Float, { nullable: true })
216
+ actualPackQty: number
217
+
218
+ @Field(type => Int, { nullable: true })
219
+ actualPalletQty: number
220
+
221
+ @Field({ nullable: true })
222
+ remark: string
223
+
224
+ @Field({ nullable: true })
225
+ issue: string
226
+
227
+ @Field({ nullable: true })
228
+ crossDocking: Boolean
229
+
230
+ @Field({ nullable: true })
231
+ status: string
232
+
233
+ @Field({ nullable: true })
234
+ pickingStrategy: string
235
+
236
+ @Field({ nullable: true })
237
+ cuFlag?: string
238
+ }
@@ -0,0 +1,401 @@
1
+ import { Field, Float, ID, ObjectType } from 'type-graphql'
2
+ import { Column, CreateDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
3
+
4
+ import { User } from '@things-factory/auth-base'
5
+ import { Bizplace } from '@things-factory/biz-base'
6
+ import { Product } from '@things-factory/product-base'
7
+ import { Domain, roundTransformer } from '@things-factory/shell'
8
+ import { Inventory, Location } from '@things-factory/warehouse-base'
9
+
10
+ import { ArrivalNotice } from '../arrival-notice/arrival-notice'
11
+ import { DeliveryOrder } from '../delivery-order/delivery-order'
12
+ import { InventoryCheck } from '../inventory-check/inventory-check'
13
+ import { OrderProduct } from '../order-product/order-product'
14
+ import { OrderToteItem } from '../order-tote-item/order-tote-item'
15
+ import { ReleaseGood } from '../release-good/release-good'
16
+ import { ReturnOrder } from '../return-order/return-order'
17
+ import { TransferOrder } from '../transfer-order/transfer-order'
18
+
19
+ @Entity()
20
+ @Index('ix_order-inventory_0', (orderInventory: OrderInventory) => [orderInventory.domain, orderInventory.name], {
21
+ unique: true
22
+ })
23
+ @Index('ix_order-inventory_1', (orderInventory: OrderInventory) => [orderInventory.bizplace, orderInventory.inventoryCheck, orderInventory.inventory], { unique: true })
24
+ @Index('ix_order-inventory_2', (orderInventory: OrderInventory) => [orderInventory.bizplace, orderInventory.deliveryOrder, orderInventory.inventory])
25
+ @Index(
26
+ 'ix_order-inventory_3',
27
+ (orderInventory: OrderInventory) => [orderInventory.bizplace, orderInventory.transferOrder, orderInventory.deliveryOrder, orderInventory.inventory],
28
+ { unique: true }
29
+ )
30
+ @Index('ix_order-inventory_4', (orderInventory: OrderInventory) => [
31
+ orderInventory.status,
32
+ orderInventory.batchId,
33
+ orderInventory.product,
34
+ orderInventory.packingType,
35
+ orderInventory.packingSize,
36
+ orderInventory.inventory,
37
+ orderInventory.releaseQty,
38
+ orderInventory.uom
39
+ ])
40
+ @Index('ix_order-inventory_5', (orderInventory: OrderInventory) => [orderInventory.releaseGood])
41
+ @ObjectType()
42
+ export class OrderInventory {
43
+ @PrimaryGeneratedColumn('uuid')
44
+ @Field(type => ID, { nullable: true })
45
+ readonly id: string
46
+
47
+ @ManyToOne(type => Domain)
48
+ @Field(type => Domain, { nullable: true })
49
+ domain: Domain
50
+
51
+ @RelationId((orderInventory: OrderInventory) => orderInventory.domain)
52
+ domainId: string
53
+
54
+ @ManyToOne(type => Bizplace)
55
+ @Field(type => Bizplace, { nullable: true })
56
+ bizplace: Bizplace
57
+
58
+ @RelationId((orderInventory: OrderInventory) => orderInventory.bizplace)
59
+ bizplaceId: string
60
+
61
+ @Column()
62
+ @Field({ nullable: true })
63
+ name: string
64
+
65
+ @Column({ nullable: true })
66
+ @Field({ nullable: true })
67
+ type: string
68
+
69
+ @Column({ nullable: true })
70
+ @Field({ nullable: true })
71
+ remark: string
72
+
73
+ @Column({ nullable: true })
74
+ @Field({ nullable: true })
75
+ issue: string
76
+
77
+ @Column({ nullable: true })
78
+ @Field({ nullable: true })
79
+ description: string
80
+
81
+ @ManyToOne(type => Inventory, { nullable: true })
82
+ @Field(type => Inventory, { nullable: true })
83
+ inventory: Inventory
84
+
85
+ @RelationId((orderInventory: OrderInventory) => orderInventory.inventory)
86
+ inventoryId: string
87
+
88
+ @ManyToOne(type => Product, { nullable: true })
89
+ @Field(type => Product, { nullable: true })
90
+ product: Product
91
+
92
+ @RelationId((orderInventory: OrderInventory) => orderInventory.product)
93
+ @Field({ nullable: true })
94
+ productId: string
95
+
96
+ @Column({ nullable: true })
97
+ @Field({ nullable: true })
98
+ batchId: string
99
+
100
+ @Column({ nullable: true })
101
+ @Field({ nullable: true })
102
+ batchIdRef: string
103
+
104
+ @Column({ nullable: true })
105
+ @Field({ nullable: true })
106
+ packingType: string
107
+
108
+ @Column('float', { default: 1, transformer: roundTransformer })
109
+ @Field({ nullable: true })
110
+ packingSize?: number
111
+
112
+ @ManyToOne(type => ArrivalNotice)
113
+ @Field(type => ArrivalNotice, { nullable: true })
114
+ arrivalNotice: ArrivalNotice
115
+
116
+ @RelationId((orderInventory: OrderInventory) => orderInventory.arrivalNotice)
117
+ arrivalNoticeId: string
118
+
119
+ @ManyToOne(type => ReleaseGood)
120
+ @Field(type => ReleaseGood, { nullable: true })
121
+ releaseGood: ReleaseGood
122
+
123
+ @RelationId((orderInventory: OrderInventory) => orderInventory.releaseGood)
124
+ releaseGoodId: string
125
+
126
+ @ManyToOne(type => InventoryCheck)
127
+ @Field(type => InventoryCheck, { nullable: true })
128
+ inventoryCheck: InventoryCheck
129
+
130
+ @RelationId((orderInventory: OrderInventory) => orderInventory.inventoryCheck)
131
+ inventoryCheckId: string
132
+
133
+ @ManyToOne(type => DeliveryOrder)
134
+ @Field(type => DeliveryOrder, { nullable: true })
135
+ deliveryOrder: DeliveryOrder
136
+
137
+ @RelationId((orderInventory: OrderInventory) => orderInventory.deliveryOrder)
138
+ deliveryOrderId: string
139
+
140
+ @ManyToOne(type => TransferOrder)
141
+ @Field(type => TransferOrder, { nullable: true })
142
+ transferOrder: TransferOrder
143
+
144
+ @RelationId((orderInventory: OrderInventory) => orderInventory.transferOrder)
145
+ transferOrderId: string
146
+
147
+ @ManyToOne(type => ReturnOrder)
148
+ @Field(type => ReturnOrder, { nullable: true })
149
+ returnOrder: ReturnOrder
150
+
151
+ @RelationId((orderInventory: OrderInventory) => orderInventory.returnOrder)
152
+ returnOrderId: string
153
+
154
+ @ManyToOne(type => OrderProduct)
155
+ @Field(type => OrderProduct, { nullable: true })
156
+ orderProduct: OrderProduct
157
+
158
+ @RelationId((orderInventory: OrderInventory) => orderInventory.orderProduct)
159
+ orderProductId: string
160
+
161
+ @OneToMany(type => OrderToteItem, orderToteItem => orderToteItem.orderInventory, { nullable: true })
162
+ @Field(type => [OrderToteItem], { nullable: true })
163
+ orderToteItems: OrderToteItem[]
164
+
165
+ @Column({ type: 'uuid', nullable: true })
166
+ @Field({ nullable: true })
167
+ refWorksheetId: string
168
+
169
+ @Column({ nullable: true })
170
+ @Field({ nullable: true })
171
+ originQty: number
172
+
173
+ @Column({ nullable: true })
174
+ @Field({ nullable: true })
175
+ inspectedQty: number
176
+
177
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
178
+ @Field({ nullable: true })
179
+ originUomValue: number
180
+
181
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
182
+ @Field({ nullable: true })
183
+ inspectedUomValue: number
184
+
185
+ @Column({ nullable: true })
186
+ @Field({ nullable: true })
187
+ originBatchNo: string
188
+
189
+ @Column({ nullable: true })
190
+ @Field({ nullable: true })
191
+ inspectedBatchNo: string
192
+
193
+ @ManyToOne(type => Location, { nullable: true })
194
+ @Field(type => Location, { nullable: true })
195
+ originLocation: Location
196
+
197
+ @RelationId((orderInventory: OrderInventory) => orderInventory.originLocation)
198
+ originLocationId: string
199
+
200
+ @ManyToOne(type => Location, { nullable: true })
201
+ @Field(type => Location, { nullable: true })
202
+ inspectedLocation: Location
203
+
204
+ @RelationId((orderInventory: OrderInventory) => orderInventory.inspectedLocation)
205
+ inspectedLocationId: string
206
+
207
+ @ManyToOne(type => Location, { nullable: true })
208
+ @Field(type => Location, { nullable: true })
209
+ binLocation: Location
210
+
211
+ @RelationId((orderInventory: OrderInventory) => orderInventory.binLocation)
212
+ binLocationId: string
213
+
214
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
215
+ @Field({ nullable: true })
216
+ releaseQty: number
217
+
218
+ @Column({ nullable: true, type: 'float', default: 0, transformer: roundTransformer })
219
+ @Field({ nullable: true })
220
+ pickedQty: number
221
+
222
+ @Column({ nullable: true, type: 'float', default: 0, transformer: roundTransformer })
223
+ @Field({ nullable: true })
224
+ packedQty: number
225
+
226
+ @Column({ nullable: true, type: 'float', default: 0, transformer: roundTransformer })
227
+ @Field({ nullable: true })
228
+ sortedQty: number
229
+
230
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
231
+ @Field({ nullable: true })
232
+ releaseUomValue: number
233
+
234
+ @Column({ nullable: true })
235
+ @Field({ nullable: true })
236
+ uom: string
237
+
238
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
239
+ @Field({ nullable: true })
240
+ returnQty: number
241
+
242
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
243
+ @Field({ nullable: true })
244
+ returnUomValue: number
245
+
246
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
247
+ @Field({ nullable: true })
248
+ returnToLocationQty: number
249
+
250
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
251
+ @Field({ nullable: true })
252
+ returnToLocationUomValue: number
253
+
254
+ @Column({ nullable: true, type: 'float', transformer: roundTransformer })
255
+ @Field({ nullable: true })
256
+ actualPackQty: number
257
+
258
+ @Column('float', { nullable: true, transformer: roundTransformer })
259
+ @Field({ nullable: true })
260
+ palletQty: number
261
+
262
+ @Column({ nullable: true })
263
+ @Field({ nullable: true })
264
+ actualPalletQty: number
265
+
266
+ @Field({ nullable: true })
267
+ systemRemark: string
268
+
269
+ @Column({ nullable: true })
270
+ @Field({ nullable: true })
271
+ crossDocking: boolean
272
+
273
+ @Column({ nullable: true })
274
+ @Field({ nullable: true })
275
+ serialNumber: string
276
+
277
+ @Column()
278
+ @Field({ nullable: true })
279
+ status: string
280
+
281
+ @ManyToOne(type => User)
282
+ @Field(type => User, { nullable: true })
283
+ pickedByUser: User
284
+
285
+ @Column({ nullable: true })
286
+ @Field({ nullable: true })
287
+ pickedBy: string
288
+
289
+ @Column({ nullable: true })
290
+ @Field({ nullable: true })
291
+ pickedAt: Date
292
+
293
+ @ManyToOne(type => User)
294
+ @Field(type => User, { nullable: true })
295
+ packedByUser: User
296
+
297
+ @Column({ nullable: true })
298
+ @Field({ nullable: true })
299
+ packedBy: string
300
+
301
+ @Column({ nullable: true })
302
+ @Field({ nullable: true })
303
+ packedAt: Date
304
+
305
+ @ManyToOne(type => User)
306
+ @Field(type => User, { nullable: true })
307
+ loadedByUser: User
308
+
309
+ @Column({ nullable: true })
310
+ @Field({ nullable: true })
311
+ loadedBy: string
312
+
313
+ @Column({ nullable: true })
314
+ @Field({ nullable: true })
315
+ loadedAt: Date
316
+
317
+ @Field({ nullable: true })
318
+ dispatchedAt: Date
319
+
320
+ @CreateDateColumn()
321
+ @Field()
322
+ createdAt: Date
323
+
324
+ @UpdateDateColumn()
325
+ @Field()
326
+ updatedAt: Date
327
+
328
+ @ManyToOne(type => User)
329
+ @Field(type => User, { nullable: true })
330
+ creator: User
331
+
332
+ @RelationId((orderInventory: OrderInventory) => orderInventory.creator)
333
+ creatorId: string
334
+
335
+ @ManyToOne(type => User)
336
+ @Field(type => User, { nullable: true })
337
+ updater: User
338
+
339
+ @RelationId((orderInventory: OrderInventory) => orderInventory.updater)
340
+ updaterId: string
341
+
342
+ @Field(type => Float, { nullable: true })
343
+ remainQty: number
344
+
345
+ @Field({ nullable: true })
346
+ remainUomValue: string
347
+
348
+ @Field({ nullable: true })
349
+ remainUomValueWithUom: string
350
+
351
+ @Field({ nullable: true })
352
+ isError: boolean
353
+
354
+ @Field({ nullable: true })
355
+ groupType: string
356
+
357
+ @Field({ nullable: true })
358
+ releaseUomValueWithUom: string
359
+
360
+ @Field({ nullable: true })
361
+ releaseGoodName: string
362
+
363
+ @Field({ nullable: true })
364
+ productName: string
365
+
366
+ @Field({ nullable: true })
367
+ productSKU: string
368
+
369
+ @Field({ nullable: true })
370
+ productBrand: string
371
+
372
+ @Field({ nullable: true })
373
+ pallet: string
374
+
375
+ @Field({ nullable: true })
376
+ palletId: string
377
+
378
+ @Field({ nullable: true })
379
+ pickedUomValue: number
380
+
381
+ @Field({ nullable: true })
382
+ extraJsonData: string
383
+
384
+ @Field({ nullable: true })
385
+ binNumber: string
386
+
387
+ @Field({ nullable: true })
388
+ toteNumber: string
389
+
390
+ @Field({ nullable: true })
391
+ routeId: string
392
+
393
+ @Field({ nullable: true })
394
+ storeId: string
395
+
396
+ @Field({ nullable: true })
397
+ storeName: string
398
+
399
+ @Field({ nullable: true })
400
+ stopId: string
401
+ }
@@ -0,0 +1,9 @@
1
+ import { OrderProduct } from './order-product'
2
+ import { OrderProductMutation } from './order-product-mutation'
3
+ import { OrderProductQuery } from './order-product-query'
4
+
5
+ export const entities = [OrderProduct]
6
+ export const resolvers = [OrderProductQuery, OrderProductMutation]
7
+
8
+ export * from './order-product-mutation'
9
+ export * from './order-product-query'
@@ -0,0 +1,48 @@
1
+ import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
+ import { In } from 'typeorm'
3
+
4
+ import { OrderProduct } from './order-product'
5
+ import { OrderProductPatch } from './order-product-types'
6
+
7
+ @Resolver(OrderProduct)
8
+ export class OrderProductMutation {
9
+ @Directive('@transaction')
10
+ @Mutation(returns => OrderProduct)
11
+ async updateOrderProduct(
12
+ @Ctx() context: ResolverContext,
13
+ @Arg('name') name: string,
14
+ @Arg('patch', type => OrderProductPatch) patch: OrderProductPatch
15
+ ): Promise<OrderProduct> {
16
+ const { tx, domain, user } = context.state
17
+
18
+ let foundOP: OrderProduct = await tx.getRepository(OrderProduct).findOne({
19
+ where: { domain: { id: domain.id }, name }
20
+ })
21
+
22
+ return await tx.getRepository(OrderProduct).save({ ...foundOP, ...patch, updater: user })
23
+ }
24
+
25
+ @Directive('@transaction')
26
+ @Mutation(returns => Boolean)
27
+ async deleteOrderProduct(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<boolean> {
28
+ const { tx, domain } = context.state
29
+
30
+ await tx.getRepository(OrderProduct).delete({ domain: { id: domain.id }, name })
31
+ return true
32
+ }
33
+
34
+ @Directive('@transaction')
35
+ @Mutation(returns => Boolean)
36
+ async deleteOrderProducts(
37
+ @Arg('names', type => [String]) names: string[],
38
+ @Ctx() context: ResolverContext
39
+ ): Promise<boolean> {
40
+ const { tx, domain } = context.state
41
+
42
+ await tx.getRepository(OrderProduct).delete({
43
+ domain: { id: domain.id },
44
+ name: In(names)
45
+ })
46
+ return true
47
+ }
48
+ }