@things-factory/warehouse-base 8.0.0-beta.9 → 8.0.1
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/service/inventory/inventory-mutation.js +15 -4
- package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
- package/dist-server/service/inventory/inventory-query.d.ts +2 -0
- package/dist-server/service/inventory/inventory-query.js +5 -1
- package/dist-server/service/inventory/inventory-query.js.map +1 -1
- package/dist-server/service/inventory/inventory-types.d.ts +4 -0
- package/dist-server/service/inventory/inventory-types.js +16 -0
- package/dist-server/service/inventory/inventory-types.js.map +1 -1
- package/dist-server/service/inventory/inventory.d.ts +2 -0
- package/dist-server/service/inventory/inventory.js +12 -0
- package/dist-server/service/inventory/inventory.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-mutation.js +24 -0
- package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/server/constants/index.ts +5 -0
- package/server/constants/inventory.ts +67 -0
- package/server/constants/location.ts +14 -0
- package/server/constants/pallet.ts +10 -0
- package/server/constants/rule-type.ts +5 -0
- package/server/constants/tote.ts +5 -0
- package/server/controllers/ecommerce/ecommerce-controller.ts +108 -0
- package/server/controllers/ecommerce/index.ts +2 -0
- package/server/controllers/ecommerce/sellercraft-controller.ts +100 -0
- package/server/controllers/index.ts +2 -0
- package/server/controllers/warehouse-controller.ts +181 -0
- package/server/index.ts +9 -0
- package/server/middlewares/index.ts +0 -0
- package/server/migrations/index.ts +9 -0
- package/server/service/index.ts +80 -0
- package/server/service/inventory/index.ts +6 -0
- package/server/service/inventory/inventory-mutation.ts +530 -0
- package/server/service/inventory/inventory-query.ts +1263 -0
- package/server/service/inventory/inventory-types.ts +367 -0
- package/server/service/inventory/inventory.ts +408 -0
- package/server/service/inventory-change/index.ts +6 -0
- package/server/service/inventory-change/inventory-change-mutation.ts +969 -0
- package/server/service/inventory-change/inventory-change-query.ts +93 -0
- package/server/service/inventory-change/inventory-change-types.ts +36 -0
- package/server/service/inventory-change/inventory-change.ts +164 -0
- package/server/service/inventory-history/index.ts +6 -0
- package/server/service/inventory-history/inventory-history-mutation.ts +116 -0
- package/server/service/inventory-history/inventory-history-query.ts +1845 -0
- package/server/service/inventory-history/inventory-history-types.ts +444 -0
- package/server/service/inventory-history/inventory-history.ts +203 -0
- package/server/service/inventory-item/index.ts +6 -0
- package/server/service/inventory-item/inventory-item-mutation.ts +217 -0
- package/server/service/inventory-item/inventory-item-query.ts +226 -0
- package/server/service/inventory-item/inventory-item-type.ts +74 -0
- package/server/service/inventory-item/inventory-item.ts +105 -0
- package/server/service/inventory-item-change/index.ts +6 -0
- package/server/service/inventory-item-change/inventory-item-change-mutation.ts +119 -0
- package/server/service/inventory-item-change/inventory-item-change-query.ts +47 -0
- package/server/service/inventory-item-change/inventory-item-change-type.ts +68 -0
- package/server/service/inventory-item-change/inventory-item-change.ts +92 -0
- package/server/service/inventory-product/index.ts +6 -0
- package/server/service/inventory-product/inventory-product-mutation.ts +116 -0
- package/server/service/inventory-product/inventory-product-query.ts +47 -0
- package/server/service/inventory-product/inventory-product-type.ts +59 -0
- package/server/service/inventory-product/inventory-product.ts +88 -0
- package/server/service/location/index.ts +6 -0
- package/server/service/location/location-mutation.ts +134 -0
- package/server/service/location/location-query.ts +244 -0
- package/server/service/location/location-types.ts +173 -0
- package/server/service/location/location.ts +121 -0
- package/server/service/movement/index.ts +6 -0
- package/server/service/movement/movement-mutation.ts +60 -0
- package/server/service/movement/movement-query.ts +263 -0
- package/server/service/movement/movement-types.ts +74 -0
- package/server/service/movement/movement.ts +81 -0
- package/server/service/pallet/index.ts +6 -0
- package/server/service/pallet/pallet-mutation.ts +242 -0
- package/server/service/pallet/pallet-query.ts +106 -0
- package/server/service/pallet/pallet-types.ts +80 -0
- package/server/service/pallet/pallet.ts +92 -0
- package/server/service/pallet-count/index.ts +6 -0
- package/server/service/pallet-count/pallet-count-mutation.ts +151 -0
- package/server/service/pallet-count/pallet-count-query.ts +45 -0
- package/server/service/pallet-count/pallet-count-types.ts +36 -0
- package/server/service/pallet-count/pallet-count.ts +70 -0
- package/server/service/pallet-history/index.ts +6 -0
- package/server/service/pallet-history/pallet-history-mutation.ts +114 -0
- package/server/service/pallet-history/pallet-history-query.ts +48 -0
- package/server/service/pallet-history/pallet-history-types.ts +36 -0
- package/server/service/pallet-history/pallet-history.ts +89 -0
- package/server/service/reduced-inventory-history/index.ts +3 -0
- package/server/service/reduced-inventory-history/reduced-inventory-history.ts +92 -0
- package/server/service/tote/index.ts +6 -0
- package/server/service/tote/tote-mutation.ts +201 -0
- package/server/service/tote/tote-query.ts +106 -0
- package/server/service/tote/tote-types.ts +44 -0
- package/server/service/tote/tote.ts +77 -0
- package/server/service/warehouse/index.ts +6 -0
- package/server/service/warehouse/warehouse-mutation.ts +152 -0
- package/server/service/warehouse/warehouse-query.ts +58 -0
- package/server/service/warehouse/warehouse-types.ts +50 -0
- package/server/service/warehouse/warehouse.ts +95 -0
- package/server/utils/datetime-util.ts +54 -0
- package/server/utils/index.ts +3 -0
- package/server/utils/inventory-no-generator.ts +15 -0
- package/server/utils/inventory-util.ts +490 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { Field, Float, InputType, Int, ObjectType } from 'type-graphql'
|
|
2
|
+
|
|
3
|
+
import { Bizplace } from '@things-factory/biz-base'
|
|
4
|
+
import { Product } from '@things-factory/product-base'
|
|
5
|
+
import { ObjectRef } from '@things-factory/shell'
|
|
6
|
+
|
|
7
|
+
import { Location } from '../location/location'
|
|
8
|
+
import { InventoryHistory } from './inventory-history'
|
|
9
|
+
|
|
10
|
+
@ObjectType()
|
|
11
|
+
export class InventoryHistoryList {
|
|
12
|
+
@Field(type => [InventoryHistory], { nullable: true })
|
|
13
|
+
items?: InventoryHistory[]
|
|
14
|
+
|
|
15
|
+
@Field(type => Int, { nullable: true })
|
|
16
|
+
total?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@ObjectType()
|
|
20
|
+
export class InventoryHistoryPalletReportList {
|
|
21
|
+
@Field(type => [InventoryHistoryPalletReport], { nullable: true })
|
|
22
|
+
items?: InventoryHistoryPalletReport[]
|
|
23
|
+
|
|
24
|
+
@Field(type => Int, { nullable: true })
|
|
25
|
+
total?: number
|
|
26
|
+
|
|
27
|
+
@Field(type => Int, { nullable: true })
|
|
28
|
+
totalWithOpeningBalance?: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@ObjectType()
|
|
32
|
+
export class InventoryHistoryPalletReport {
|
|
33
|
+
@Field(type => Bizplace, { nullable: true })
|
|
34
|
+
bizplace?: Bizplace
|
|
35
|
+
|
|
36
|
+
@Field(type => Location, { nullable: true })
|
|
37
|
+
location?: Location
|
|
38
|
+
|
|
39
|
+
@Field({ nullable: true })
|
|
40
|
+
palletId?: string
|
|
41
|
+
|
|
42
|
+
@Field({ nullable: true })
|
|
43
|
+
cartonId?: string
|
|
44
|
+
|
|
45
|
+
@Field({ nullable: true })
|
|
46
|
+
inboundPalletId?: string
|
|
47
|
+
|
|
48
|
+
@Field(type => Int, { nullable: true })
|
|
49
|
+
inboundQty?: number
|
|
50
|
+
|
|
51
|
+
@Field(type => Int, { nullable: true })
|
|
52
|
+
totalQty?: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@InputType()
|
|
56
|
+
export class InventoryHistoryPatch {
|
|
57
|
+
@Field({ nullable: true })
|
|
58
|
+
id?: string
|
|
59
|
+
|
|
60
|
+
@Field(type => Int, { nullable: true })
|
|
61
|
+
seq?: number
|
|
62
|
+
|
|
63
|
+
@Field({ nullable: true })
|
|
64
|
+
name?: string
|
|
65
|
+
|
|
66
|
+
@Field(type => ObjectRef, { nullable: true })
|
|
67
|
+
bizplace: ObjectRef
|
|
68
|
+
|
|
69
|
+
@Field({ nullable: true })
|
|
70
|
+
orderRefNo?: string
|
|
71
|
+
|
|
72
|
+
@Field({ nullable: true })
|
|
73
|
+
orderNo?: string
|
|
74
|
+
|
|
75
|
+
@Field({ nullable: true })
|
|
76
|
+
palletId?: string
|
|
77
|
+
|
|
78
|
+
@Field({ nullable: true })
|
|
79
|
+
cartonId?: string
|
|
80
|
+
|
|
81
|
+
@Field({ nullable: true })
|
|
82
|
+
batchId?: string
|
|
83
|
+
|
|
84
|
+
@Field({ nullable: true })
|
|
85
|
+
batchIdRef?: string
|
|
86
|
+
|
|
87
|
+
@Field({ nullable: true })
|
|
88
|
+
productId?: string
|
|
89
|
+
|
|
90
|
+
@Field({ nullable: true })
|
|
91
|
+
productName?: string
|
|
92
|
+
|
|
93
|
+
@Field({ nullable: true })
|
|
94
|
+
reusablePalletId?: string
|
|
95
|
+
|
|
96
|
+
@Field({ nullable: true })
|
|
97
|
+
reusablePalletName?: string
|
|
98
|
+
|
|
99
|
+
@Field({ nullable: true })
|
|
100
|
+
locationId?: string
|
|
101
|
+
|
|
102
|
+
@Field({ nullable: true })
|
|
103
|
+
locationName?: string
|
|
104
|
+
|
|
105
|
+
@Field({ nullable: true })
|
|
106
|
+
warehouseId?: string
|
|
107
|
+
|
|
108
|
+
@Field({ nullable: true })
|
|
109
|
+
warehouseName?: string
|
|
110
|
+
|
|
111
|
+
@Field({ nullable: true })
|
|
112
|
+
otherRef?: string
|
|
113
|
+
|
|
114
|
+
@Field({ nullable: true })
|
|
115
|
+
zone?: string
|
|
116
|
+
|
|
117
|
+
@Field({ nullable: true })
|
|
118
|
+
packingType?: string
|
|
119
|
+
|
|
120
|
+
@Field(type => Float, { nullable: true })
|
|
121
|
+
packingSize?: number
|
|
122
|
+
|
|
123
|
+
@Field(type => Int, { nullable: true })
|
|
124
|
+
qty?: number
|
|
125
|
+
|
|
126
|
+
@Field({ nullable: true })
|
|
127
|
+
uom?: string
|
|
128
|
+
|
|
129
|
+
@Field(type => Float, { nullable: true })
|
|
130
|
+
uomValue?: number
|
|
131
|
+
|
|
132
|
+
@Field({ nullable: true })
|
|
133
|
+
status?: string
|
|
134
|
+
|
|
135
|
+
@Field({ nullable: true })
|
|
136
|
+
transactionType?: string
|
|
137
|
+
|
|
138
|
+
@Field({ nullable: true })
|
|
139
|
+
description?: string
|
|
140
|
+
|
|
141
|
+
@Field({ nullable: true })
|
|
142
|
+
cuFlag?: string
|
|
143
|
+
|
|
144
|
+
@Field({ nullable: true })
|
|
145
|
+
fromDate?: string
|
|
146
|
+
|
|
147
|
+
@Field({ nullable: true })
|
|
148
|
+
toDate?: string
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@ObjectType()
|
|
152
|
+
export class InventoryHistorySummary {
|
|
153
|
+
@Field({ nullable: true })
|
|
154
|
+
batchId?: string
|
|
155
|
+
|
|
156
|
+
@Field({ nullable: true })
|
|
157
|
+
packingType?: string
|
|
158
|
+
|
|
159
|
+
@Field(type => Int, { nullable: true })
|
|
160
|
+
packingSize?: number
|
|
161
|
+
|
|
162
|
+
@Field(type => Product, { nullable: true })
|
|
163
|
+
product?: Product
|
|
164
|
+
|
|
165
|
+
@Field(type => Float, { nullable: true })
|
|
166
|
+
openingQty?: number
|
|
167
|
+
|
|
168
|
+
@Field(type => Float, { nullable: true })
|
|
169
|
+
missingQty?: number
|
|
170
|
+
|
|
171
|
+
@Field(type => Float, { nullable: true })
|
|
172
|
+
adjustmentQty?: number
|
|
173
|
+
|
|
174
|
+
@Field(type => Float, { nullable: true })
|
|
175
|
+
closingQty?: number
|
|
176
|
+
|
|
177
|
+
@Field(type => Float, { nullable: true })
|
|
178
|
+
totalInQty?: number
|
|
179
|
+
|
|
180
|
+
@Field(type => Float, { nullable: true })
|
|
181
|
+
totalOutQty?: number
|
|
182
|
+
|
|
183
|
+
@Field(type => Float, { nullable: true })
|
|
184
|
+
initialQty?: number
|
|
185
|
+
|
|
186
|
+
@Field({ nullable: true })
|
|
187
|
+
initialDate?: string
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@ObjectType()
|
|
191
|
+
export class InventoryHistorySummaryList {
|
|
192
|
+
@Field(type => [InventoryHistorySummary], { nullable: true })
|
|
193
|
+
items?: InventoryHistorySummary[]
|
|
194
|
+
|
|
195
|
+
@Field(type => Int, { nullable: true })
|
|
196
|
+
total?: number
|
|
197
|
+
|
|
198
|
+
@Field(type => Int, { nullable: true })
|
|
199
|
+
totalInboundQty?: number
|
|
200
|
+
|
|
201
|
+
@Field(type => Int, { nullable: true })
|
|
202
|
+
totalOpeningBal?: number
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@InputType()
|
|
206
|
+
export class NewInventoryHistory {
|
|
207
|
+
@Field(type => Int, { nullable: true })
|
|
208
|
+
seq?: number
|
|
209
|
+
|
|
210
|
+
@Field({ nullable: true })
|
|
211
|
+
name?: string
|
|
212
|
+
|
|
213
|
+
@Field({ nullable: true })
|
|
214
|
+
palletId?: string
|
|
215
|
+
|
|
216
|
+
@Field({ nullable: true })
|
|
217
|
+
cartonId?: string
|
|
218
|
+
|
|
219
|
+
@Field({ nullable: true })
|
|
220
|
+
batchId?: string
|
|
221
|
+
|
|
222
|
+
@Field({ nullable: true })
|
|
223
|
+
batchIdRef?: string
|
|
224
|
+
|
|
225
|
+
@Field({ nullable: true })
|
|
226
|
+
productId?: string
|
|
227
|
+
|
|
228
|
+
@Field({ nullable: true })
|
|
229
|
+
reusablePalletId?: string
|
|
230
|
+
|
|
231
|
+
@Field({ nullable: true })
|
|
232
|
+
locationId?: string
|
|
233
|
+
|
|
234
|
+
@Field({ nullable: true })
|
|
235
|
+
warehouseId?: string
|
|
236
|
+
|
|
237
|
+
@Field({ nullable: true })
|
|
238
|
+
otherRef?: string
|
|
239
|
+
|
|
240
|
+
@Field({ nullable: true })
|
|
241
|
+
zone?: string
|
|
242
|
+
|
|
243
|
+
@Field({ nullable: true })
|
|
244
|
+
packingType?: string
|
|
245
|
+
|
|
246
|
+
@Field(type => Float, { nullable: true })
|
|
247
|
+
packingSize?: number
|
|
248
|
+
|
|
249
|
+
@Field(type => Float, { nullable: true })
|
|
250
|
+
uomValue?: number
|
|
251
|
+
|
|
252
|
+
@Field(type => Int, { nullable: true })
|
|
253
|
+
qty?: number
|
|
254
|
+
|
|
255
|
+
@Field({ nullable: true })
|
|
256
|
+
uom?: string
|
|
257
|
+
|
|
258
|
+
@Field({ nullable: true })
|
|
259
|
+
status?: string
|
|
260
|
+
|
|
261
|
+
@Field({ nullable: true })
|
|
262
|
+
transactionType?: string
|
|
263
|
+
|
|
264
|
+
@Field({ nullable: true })
|
|
265
|
+
description?: string
|
|
266
|
+
|
|
267
|
+
@Field({ nullable: true })
|
|
268
|
+
expirationDate?: Date
|
|
269
|
+
|
|
270
|
+
@Field(type => Float, { nullable: true })
|
|
271
|
+
unitCost?: number
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@ObjectType()
|
|
275
|
+
export class RawInventoryHistoryList {
|
|
276
|
+
@Field(type => [RawInventoryHistory], { nullable: true })
|
|
277
|
+
items?: RawInventoryHistory[]
|
|
278
|
+
|
|
279
|
+
@Field(type => Int, { nullable: true })
|
|
280
|
+
total?: number
|
|
281
|
+
}
|
|
282
|
+
@ObjectType()
|
|
283
|
+
export class RawInventoryHistory {
|
|
284
|
+
@Field({ nullable: true })
|
|
285
|
+
sku?: string
|
|
286
|
+
|
|
287
|
+
@Field({ nullable: true })
|
|
288
|
+
productName?: string
|
|
289
|
+
|
|
290
|
+
@Field({ nullable: true })
|
|
291
|
+
productDescription?: string
|
|
292
|
+
|
|
293
|
+
@Field({ nullable: true })
|
|
294
|
+
brand?: string
|
|
295
|
+
|
|
296
|
+
@Field(type => Int, { nullable: true })
|
|
297
|
+
seq?: number
|
|
298
|
+
|
|
299
|
+
@Field({ nullable: true })
|
|
300
|
+
palletId?: string
|
|
301
|
+
|
|
302
|
+
@Field({ nullable: true })
|
|
303
|
+
cartonId?: string
|
|
304
|
+
|
|
305
|
+
@Field({ nullable: true })
|
|
306
|
+
batchId?: string
|
|
307
|
+
|
|
308
|
+
@Field({ nullable: true })
|
|
309
|
+
batchIdRef?: string
|
|
310
|
+
|
|
311
|
+
@Field(type => Int, { nullable: true })
|
|
312
|
+
openingQty?: number
|
|
313
|
+
|
|
314
|
+
@Field(type => Int, { nullable: true })
|
|
315
|
+
qty?: number
|
|
316
|
+
|
|
317
|
+
@Field(type => Float, { nullable: true })
|
|
318
|
+
openingUomValue?: number
|
|
319
|
+
|
|
320
|
+
@Field(type => Float, { nullable: true })
|
|
321
|
+
uomValue?: number
|
|
322
|
+
|
|
323
|
+
@Field({ nullable: true })
|
|
324
|
+
uom?: string
|
|
325
|
+
|
|
326
|
+
@Field({ nullable: true })
|
|
327
|
+
zone?: string
|
|
328
|
+
|
|
329
|
+
@Field({ nullable: true })
|
|
330
|
+
orderNo?: string
|
|
331
|
+
|
|
332
|
+
@Field({ nullable: true })
|
|
333
|
+
refNo?: string
|
|
334
|
+
|
|
335
|
+
@Field({ nullable: true })
|
|
336
|
+
status?: string
|
|
337
|
+
|
|
338
|
+
@Field({ nullable: true })
|
|
339
|
+
transactionType?: string
|
|
340
|
+
|
|
341
|
+
@Field({ nullable: true })
|
|
342
|
+
bizplace?: string
|
|
343
|
+
|
|
344
|
+
@Field({ nullable: true })
|
|
345
|
+
warehouse?: string
|
|
346
|
+
|
|
347
|
+
@Field({ nullable: true })
|
|
348
|
+
location?: string
|
|
349
|
+
|
|
350
|
+
@Field({ nullable: true })
|
|
351
|
+
createdAt?: Date
|
|
352
|
+
|
|
353
|
+
@Field({ nullable: true })
|
|
354
|
+
updatedAt?: Date
|
|
355
|
+
|
|
356
|
+
@Field({ nullable: true })
|
|
357
|
+
updater?: string
|
|
358
|
+
}
|
|
359
|
+
@ObjectType()
|
|
360
|
+
export class InventoryHistoryVolumeSummaryReport {
|
|
361
|
+
@Field({ nullable: true })
|
|
362
|
+
date?: Date
|
|
363
|
+
|
|
364
|
+
@Field(type => Int, { nullable: true })
|
|
365
|
+
openingQty?: number
|
|
366
|
+
|
|
367
|
+
@Field(type => Float, { nullable: true })
|
|
368
|
+
openingVolume?: number
|
|
369
|
+
|
|
370
|
+
@Field(type => Int, { nullable: true })
|
|
371
|
+
inboundQty?: number
|
|
372
|
+
|
|
373
|
+
@Field(type => Float, { nullable: true })
|
|
374
|
+
inboundVolume?: number
|
|
375
|
+
|
|
376
|
+
@Field(type => Int, { nullable: true })
|
|
377
|
+
adjustedQty?: number
|
|
378
|
+
|
|
379
|
+
@Field(type => Float, { nullable: true })
|
|
380
|
+
adjustedVolume?: number
|
|
381
|
+
|
|
382
|
+
@Field(type => Int, { nullable: true })
|
|
383
|
+
missingQty?: number
|
|
384
|
+
|
|
385
|
+
@Field(type => Float, { nullable: true })
|
|
386
|
+
missingVolume?: number
|
|
387
|
+
|
|
388
|
+
@Field(type => Int, { nullable: true })
|
|
389
|
+
outboundQty?: number
|
|
390
|
+
|
|
391
|
+
@Field(type => Float, { nullable: true })
|
|
392
|
+
outboundVolume?: number
|
|
393
|
+
|
|
394
|
+
@Field(type => Int, { nullable: true })
|
|
395
|
+
closingQty?: number
|
|
396
|
+
|
|
397
|
+
@Field(type => Float, { nullable: true })
|
|
398
|
+
closingVolume?: number
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
@ObjectType()
|
|
402
|
+
export class InventoryHistoryVolumeSummaryReportList {
|
|
403
|
+
@Field(type => [InventoryHistoryVolumeSummaryReport], { nullable: true })
|
|
404
|
+
items?: InventoryHistoryVolumeSummaryReport[]
|
|
405
|
+
|
|
406
|
+
@Field(type => Int, { nullable: true })
|
|
407
|
+
total?: number
|
|
408
|
+
|
|
409
|
+
@Field(type => Int, { nullable: true })
|
|
410
|
+
totalOpeningQty?: number
|
|
411
|
+
|
|
412
|
+
@Field(type => Float, { nullable: true })
|
|
413
|
+
totalOpeningVolume?: number
|
|
414
|
+
|
|
415
|
+
@Field(type => Int, { nullable: true })
|
|
416
|
+
totalInboundQty?: number
|
|
417
|
+
|
|
418
|
+
@Field(type => Float, { nullable: true })
|
|
419
|
+
totalInboundVolume?: number
|
|
420
|
+
|
|
421
|
+
@Field(type => Int, { nullable: true })
|
|
422
|
+
totalAdjustedQty?: number
|
|
423
|
+
|
|
424
|
+
@Field(type => Float, { nullable: true })
|
|
425
|
+
totalAdjustedVolume?: number
|
|
426
|
+
|
|
427
|
+
@Field(type => Int, { nullable: true })
|
|
428
|
+
totalMissingQty?: number
|
|
429
|
+
|
|
430
|
+
@Field(type => Float, { nullable: true })
|
|
431
|
+
totalMissingVolume?: number
|
|
432
|
+
|
|
433
|
+
@Field(type => Int, { nullable: true })
|
|
434
|
+
totalOutboundQty?: number
|
|
435
|
+
|
|
436
|
+
@Field(type => Float, { nullable: true })
|
|
437
|
+
totalOutboundVolume?: number
|
|
438
|
+
|
|
439
|
+
@Field(type => Int, { nullable: true })
|
|
440
|
+
totalClosingQty?: number
|
|
441
|
+
|
|
442
|
+
@Field(type => Float, { nullable: true })
|
|
443
|
+
totalClosingVolume?: number
|
|
444
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { Field, ID, ObjectType } from 'type-graphql'
|
|
2
|
+
import {
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
Index,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
PrimaryGeneratedColumn,
|
|
9
|
+
RelationId,
|
|
10
|
+
UpdateDateColumn
|
|
11
|
+
} from 'typeorm'
|
|
12
|
+
|
|
13
|
+
import { User } from '@things-factory/auth-base'
|
|
14
|
+
import { Bizplace } from '@things-factory/biz-base'
|
|
15
|
+
import { Product, ProductDetail } from '@things-factory/product-base'
|
|
16
|
+
import { Domain, ScalarDate, roundTransformer } from '@things-factory/shell'
|
|
17
|
+
|
|
18
|
+
import { Inventory } from '../inventory/inventory'
|
|
19
|
+
import { Location } from '../location/location'
|
|
20
|
+
import { Pallet } from '../pallet/pallet'
|
|
21
|
+
import { Warehouse } from '../warehouse/warehouse'
|
|
22
|
+
|
|
23
|
+
@Entity()
|
|
24
|
+
@Index(
|
|
25
|
+
'ix_inventory-history_0',
|
|
26
|
+
(inventoryHistory: InventoryHistory) => [inventoryHistory.domain, inventoryHistory.name],
|
|
27
|
+
{ unique: true }
|
|
28
|
+
)
|
|
29
|
+
@Index('ix_inventory-history_1', (inventoryHistory: InventoryHistory) => [
|
|
30
|
+
inventoryHistory.domain,
|
|
31
|
+
inventoryHistory.palletId
|
|
32
|
+
])
|
|
33
|
+
@Index('ix_inventory-history_2', (inventoryHistory: InventoryHistory) => [
|
|
34
|
+
inventoryHistory.inventory,
|
|
35
|
+
inventoryHistory.transactionType,
|
|
36
|
+
inventoryHistory.refOrderId
|
|
37
|
+
])
|
|
38
|
+
@ObjectType()
|
|
39
|
+
export class InventoryHistory {
|
|
40
|
+
@PrimaryGeneratedColumn('uuid')
|
|
41
|
+
@Field(type => ID)
|
|
42
|
+
readonly id: string
|
|
43
|
+
|
|
44
|
+
@Column({ default: 0 })
|
|
45
|
+
@Field()
|
|
46
|
+
seq?: number
|
|
47
|
+
|
|
48
|
+
@ManyToOne(type => Domain)
|
|
49
|
+
@Field(type => Domain)
|
|
50
|
+
domain?: Domain
|
|
51
|
+
|
|
52
|
+
@RelationId((inventoryHistory: InventoryHistory) => inventoryHistory.domain)
|
|
53
|
+
domainId?: string
|
|
54
|
+
|
|
55
|
+
@ManyToOne(type => Bizplace)
|
|
56
|
+
@Field()
|
|
57
|
+
bizplace?: Bizplace
|
|
58
|
+
|
|
59
|
+
@Column({ nullable: true })
|
|
60
|
+
@Field({ nullable: true })
|
|
61
|
+
refOrderId?: string
|
|
62
|
+
|
|
63
|
+
@Column({ nullable: true })
|
|
64
|
+
@Field({ nullable: true })
|
|
65
|
+
orderNo?: string
|
|
66
|
+
|
|
67
|
+
@Column()
|
|
68
|
+
@Field()
|
|
69
|
+
name?: string
|
|
70
|
+
|
|
71
|
+
@Column()
|
|
72
|
+
@Field()
|
|
73
|
+
palletId?: string
|
|
74
|
+
|
|
75
|
+
@Column({ nullable: true })
|
|
76
|
+
@Field({ nullable: true })
|
|
77
|
+
cartonId?: string
|
|
78
|
+
|
|
79
|
+
@Column({ nullable: true })
|
|
80
|
+
@Field({ nullable: true })
|
|
81
|
+
batchId?: string
|
|
82
|
+
|
|
83
|
+
@Column({ nullable: true })
|
|
84
|
+
@Field({ nullable: true })
|
|
85
|
+
batchIdRef?: string
|
|
86
|
+
|
|
87
|
+
@ManyToOne(type => Pallet, { nullable: true })
|
|
88
|
+
@Field({ nullable: true })
|
|
89
|
+
reusablePallet?: Pallet
|
|
90
|
+
|
|
91
|
+
@ManyToOne(type => Product, { nullable: true })
|
|
92
|
+
@Field(type => Product, { nullable: true })
|
|
93
|
+
product?: Product
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* To be updated to remove nullable. once all process that links to inventory has been updated to use product detail instead of product
|
|
97
|
+
*/
|
|
98
|
+
@ManyToOne(type => ProductDetail, { nullable: true })
|
|
99
|
+
@Field(type => ProductDetail, { nullable: true })
|
|
100
|
+
productDetail?: ProductDetail
|
|
101
|
+
|
|
102
|
+
@ManyToOne(type => Warehouse, { nullable: true })
|
|
103
|
+
@Field({ nullable: true })
|
|
104
|
+
warehouse?: Warehouse
|
|
105
|
+
|
|
106
|
+
@ManyToOne(type => Location, { nullable: true })
|
|
107
|
+
@Field({ nullable: true })
|
|
108
|
+
location?: Location
|
|
109
|
+
|
|
110
|
+
@Column({ nullable: true })
|
|
111
|
+
@Field({ nullable: true })
|
|
112
|
+
zone?: string
|
|
113
|
+
|
|
114
|
+
@Column({ nullable: true })
|
|
115
|
+
@Field({ nullable: true })
|
|
116
|
+
orderRefNo?: string
|
|
117
|
+
|
|
118
|
+
@Column()
|
|
119
|
+
@Field()
|
|
120
|
+
packingType?: string
|
|
121
|
+
|
|
122
|
+
@Column('float', { nullable: true, default: 1, transformer: roundTransformer })
|
|
123
|
+
@Field({ nullable: true })
|
|
124
|
+
packingSize?: number
|
|
125
|
+
|
|
126
|
+
@Column('float', { transformer: roundTransformer })
|
|
127
|
+
@Field({ nullable: true })
|
|
128
|
+
qty?: number
|
|
129
|
+
|
|
130
|
+
@Column('float', { default: 0, nullable: true, transformer: roundTransformer })
|
|
131
|
+
@Field({ nullable: true })
|
|
132
|
+
openingQty?: number
|
|
133
|
+
|
|
134
|
+
@Column({ nullable: true })
|
|
135
|
+
@Field({ nullable: true })
|
|
136
|
+
uom?: string
|
|
137
|
+
|
|
138
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
139
|
+
@Field({ nullable: true })
|
|
140
|
+
uomValue?: number
|
|
141
|
+
|
|
142
|
+
@Column('float', { default: 0, nullable: true, transformer: roundTransformer })
|
|
143
|
+
@Field({ nullable: true })
|
|
144
|
+
openingUomValue?: number
|
|
145
|
+
|
|
146
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
147
|
+
@Field({ nullable: true })
|
|
148
|
+
unitCost?: number
|
|
149
|
+
|
|
150
|
+
@Column({ nullable: true })
|
|
151
|
+
@Field({ nullable: true })
|
|
152
|
+
description?: string
|
|
153
|
+
|
|
154
|
+
@Column()
|
|
155
|
+
@Field()
|
|
156
|
+
status?: string
|
|
157
|
+
|
|
158
|
+
@Column()
|
|
159
|
+
@Field()
|
|
160
|
+
transactionType?: string
|
|
161
|
+
|
|
162
|
+
@ManyToOne(type => Inventory, { nullable: true })
|
|
163
|
+
@Field(type => Inventory, { nullable: true })
|
|
164
|
+
inventory?: Inventory
|
|
165
|
+
|
|
166
|
+
@Column('date', { nullable: true })
|
|
167
|
+
@Field(type => ScalarDate, { nullable: true })
|
|
168
|
+
expirationDate?: Date
|
|
169
|
+
|
|
170
|
+
@Column('int', { nullable: true })
|
|
171
|
+
@Field({ nullable: true })
|
|
172
|
+
manufactureYear?: number
|
|
173
|
+
|
|
174
|
+
@Column('date', { nullable: true })
|
|
175
|
+
@Field(type => ScalarDate, { nullable: true })
|
|
176
|
+
manufactureDate?: Date
|
|
177
|
+
|
|
178
|
+
@Column({ nullable: true })
|
|
179
|
+
@Field({ nullable: true })
|
|
180
|
+
auxInfo3?: string
|
|
181
|
+
|
|
182
|
+
@ManyToOne(type => User, { nullable: true })
|
|
183
|
+
@Field(type => User, { nullable: true })
|
|
184
|
+
creator?: User
|
|
185
|
+
|
|
186
|
+
@RelationId((inventoryHistory: InventoryHistory) => inventoryHistory.creator)
|
|
187
|
+
creatorId?: string
|
|
188
|
+
|
|
189
|
+
@ManyToOne(type => User, { nullable: true })
|
|
190
|
+
@Field(type => User, { nullable: true })
|
|
191
|
+
updater?: User
|
|
192
|
+
|
|
193
|
+
@RelationId((inventoryHistory: InventoryHistory) => inventoryHistory.updater)
|
|
194
|
+
updaterId?: string
|
|
195
|
+
|
|
196
|
+
@CreateDateColumn()
|
|
197
|
+
@Field({ nullable: true })
|
|
198
|
+
createdAt?: Date
|
|
199
|
+
|
|
200
|
+
@UpdateDateColumn()
|
|
201
|
+
@Field({ nullable: true })
|
|
202
|
+
updatedAt?: Date
|
|
203
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InventoryItem } from './inventory-item'
|
|
2
|
+
import { InventoryItemMutation } from './inventory-item-mutation'
|
|
3
|
+
import { InventoryItemQuery } from './inventory-item-query'
|
|
4
|
+
|
|
5
|
+
export const entities = [InventoryItem]
|
|
6
|
+
export const resolvers = [InventoryItemQuery, InventoryItemMutation]
|