@things-factory/warehouse-base 8.0.0-beta.0 → 8.0.0-beta.2

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 (87) hide show
  1. package/package.json +8 -8
  2. package/server/constants/index.ts +0 -5
  3. package/server/constants/inventory.ts +0 -67
  4. package/server/constants/location.ts +0 -14
  5. package/server/constants/pallet.ts +0 -10
  6. package/server/constants/rule-type.ts +0 -5
  7. package/server/constants/tote.ts +0 -5
  8. package/server/controllers/ecommerce/ecommerce-controller.ts +0 -108
  9. package/server/controllers/ecommerce/index.ts +0 -2
  10. package/server/controllers/ecommerce/sellercraft-controller.ts +0 -100
  11. package/server/controllers/index.ts +0 -2
  12. package/server/controllers/warehouse-controller.ts +0 -181
  13. package/server/index.ts +0 -9
  14. package/server/middlewares/index.ts +0 -0
  15. package/server/migrations/index.ts +0 -9
  16. package/server/service/index.ts +0 -80
  17. package/server/service/inventory/index.ts +0 -6
  18. package/server/service/inventory/inventory-mutation.ts +0 -486
  19. package/server/service/inventory/inventory-query.ts +0 -1259
  20. package/server/service/inventory/inventory-types.ts +0 -355
  21. package/server/service/inventory/inventory.ts +0 -398
  22. package/server/service/inventory-change/index.ts +0 -6
  23. package/server/service/inventory-change/inventory-change-mutation.ts +0 -969
  24. package/server/service/inventory-change/inventory-change-query.ts +0 -93
  25. package/server/service/inventory-change/inventory-change-types.ts +0 -36
  26. package/server/service/inventory-change/inventory-change.ts +0 -164
  27. package/server/service/inventory-history/index.ts +0 -6
  28. package/server/service/inventory-history/inventory-history-mutation.ts +0 -116
  29. package/server/service/inventory-history/inventory-history-query.ts +0 -1845
  30. package/server/service/inventory-history/inventory-history-types.ts +0 -444
  31. package/server/service/inventory-history/inventory-history.ts +0 -203
  32. package/server/service/inventory-item/index.ts +0 -6
  33. package/server/service/inventory-item/inventory-item-mutation.ts +0 -217
  34. package/server/service/inventory-item/inventory-item-query.ts +0 -226
  35. package/server/service/inventory-item/inventory-item-type.ts +0 -74
  36. package/server/service/inventory-item/inventory-item.ts +0 -105
  37. package/server/service/inventory-item-change/index.ts +0 -6
  38. package/server/service/inventory-item-change/inventory-item-change-mutation.ts +0 -119
  39. package/server/service/inventory-item-change/inventory-item-change-query.ts +0 -47
  40. package/server/service/inventory-item-change/inventory-item-change-type.ts +0 -68
  41. package/server/service/inventory-item-change/inventory-item-change.ts +0 -92
  42. package/server/service/inventory-product/index.ts +0 -6
  43. package/server/service/inventory-product/inventory-product-mutation.ts +0 -116
  44. package/server/service/inventory-product/inventory-product-query.ts +0 -47
  45. package/server/service/inventory-product/inventory-product-type.ts +0 -59
  46. package/server/service/inventory-product/inventory-product.ts +0 -88
  47. package/server/service/location/index.ts +0 -6
  48. package/server/service/location/location-mutation.ts +0 -134
  49. package/server/service/location/location-query.ts +0 -244
  50. package/server/service/location/location-types.ts +0 -173
  51. package/server/service/location/location.ts +0 -121
  52. package/server/service/movement/index.ts +0 -6
  53. package/server/service/movement/movement-mutation.ts +0 -60
  54. package/server/service/movement/movement-query.ts +0 -263
  55. package/server/service/movement/movement-types.ts +0 -74
  56. package/server/service/movement/movement.ts +0 -81
  57. package/server/service/pallet/index.ts +0 -6
  58. package/server/service/pallet/pallet-mutation.ts +0 -242
  59. package/server/service/pallet/pallet-query.ts +0 -106
  60. package/server/service/pallet/pallet-types.ts +0 -80
  61. package/server/service/pallet/pallet.ts +0 -92
  62. package/server/service/pallet-count/index.ts +0 -6
  63. package/server/service/pallet-count/pallet-count-mutation.ts +0 -151
  64. package/server/service/pallet-count/pallet-count-query.ts +0 -45
  65. package/server/service/pallet-count/pallet-count-types.ts +0 -36
  66. package/server/service/pallet-count/pallet-count.ts +0 -70
  67. package/server/service/pallet-history/index.ts +0 -6
  68. package/server/service/pallet-history/pallet-history-mutation.ts +0 -114
  69. package/server/service/pallet-history/pallet-history-query.ts +0 -48
  70. package/server/service/pallet-history/pallet-history-types.ts +0 -36
  71. package/server/service/pallet-history/pallet-history.ts +0 -89
  72. package/server/service/reduced-inventory-history/index.ts +0 -3
  73. package/server/service/reduced-inventory-history/reduced-inventory-history.ts +0 -92
  74. package/server/service/tote/index.ts +0 -6
  75. package/server/service/tote/tote-mutation.ts +0 -201
  76. package/server/service/tote/tote-query.ts +0 -106
  77. package/server/service/tote/tote-types.ts +0 -44
  78. package/server/service/tote/tote.ts +0 -77
  79. package/server/service/warehouse/index.ts +0 -6
  80. package/server/service/warehouse/warehouse-mutation.ts +0 -117
  81. package/server/service/warehouse/warehouse-query.ts +0 -58
  82. package/server/service/warehouse/warehouse-types.ts +0 -50
  83. package/server/service/warehouse/warehouse.ts +0 -95
  84. package/server/utils/datetime-util.ts +0 -54
  85. package/server/utils/index.ts +0 -3
  86. package/server/utils/inventory-no-generator.ts +0 -15
  87. package/server/utils/inventory-util.ts +0 -490
@@ -1,398 +0,0 @@
1
- import { Field, Float, ID, Int, ObjectType } from 'type-graphql'
2
- import {
3
- Column,
4
- CreateDateColumn,
5
- Entity,
6
- Index,
7
- ManyToOne,
8
- OneToMany,
9
- PrimaryGeneratedColumn,
10
- RelationId,
11
- UpdateDateColumn
12
- } from 'typeorm'
13
-
14
- import { User } from '@things-factory/auth-base'
15
- import { Bizplace } from '@things-factory/biz-base'
16
- import { Product, ProductDetail } from '@things-factory/product-base'
17
- import { Domain, ScalarDate, roundTransformer } from '@things-factory/shell'
18
-
19
- import { InventoryChange } from '../inventory-change/inventory-change'
20
- import { InventoryItem } from '../inventory-item/inventory-item'
21
- import { Location } from '../location/location'
22
- import { Pallet } from '../pallet/pallet'
23
- import { Warehouse } from '../warehouse/warehouse'
24
-
25
- @Entity()
26
- @Index('ix_inventory_0', (inventory: Inventory) => [inventory.domain, inventory.palletId], { unique: true })
27
- @Index('inventories_product_id_and_status', (inventory: Inventory) => [inventory.product, inventory.status])
28
- @ObjectType()
29
- export class Inventory {
30
- @PrimaryGeneratedColumn('uuid')
31
- @Field(type => ID)
32
- readonly id: string
33
-
34
- @ManyToOne(type => Domain)
35
- @Field(type => Domain)
36
- domain: Domain
37
-
38
- @RelationId((inventory: Inventory) => inventory.domain)
39
- domainId: string
40
-
41
- @ManyToOne(type => Bizplace, { nullable: true })
42
- @Field(type => Bizplace, { nullable: true })
43
- bizplace: Bizplace
44
-
45
- @ManyToOne(type => Inventory)
46
- @Field(type => Inventory)
47
- refInventory: Inventory
48
-
49
- @Column()
50
- @Field()
51
- name: string
52
-
53
- @Column({ nullable: true })
54
- @Field({ nullable: true })
55
- palletId: string
56
-
57
- @Column({ nullable: true })
58
- @Field({ nullable: true })
59
- cartonId: string
60
-
61
- @Column({ nullable: true })
62
- @Field({ nullable: true })
63
- batchId: string
64
-
65
- @Column({ nullable: true })
66
- @Field({ nullable: true })
67
- batchIdRef: string
68
-
69
- @Column({ nullable: true })
70
- @Field({ nullable: true })
71
- refOrderId: string
72
-
73
- /**
74
- * Expected: Putting ManyToOne relation with OrderProduct to find out unloaded inventories within unloading process
75
- * Because if there's inventory which has same batch id with others but different product id
76
- * then can't find out exact same inventory by batch id as a condition to find
77
- *
78
- * Problem: Because of circular dependency problem.
79
- * OrderProduct entity comes from sales-base module and the module is looking for warehouse-base module
80
- *
81
- * Solution: Putting plain orderProductId field instead of ManyToOne relation for this release (2.2.0-beta)
82
- */
83
- @Column({ nullable: true })
84
- @Field({ nullable: true })
85
- orderProductId: string
86
-
87
- @Column({ nullable: true })
88
- @Field({ nullable: true })
89
- orderInventoryId: string
90
-
91
- @Column({ nullable: true })
92
- @Field({ nullable: true })
93
- orderVasId: string
94
-
95
- @ManyToOne(type => Pallet, { nullable: true })
96
- @Field(type => Pallet, { nullable: true })
97
- reusablePallet: Pallet
98
-
99
- @ManyToOne(type => Product, { nullable: true })
100
- @Field({ nullable: true })
101
- product: Product
102
-
103
- /**
104
- * To be updated to remove nullable. once all process that links to inventory has been updated to use product detail instead of product
105
- */
106
- @ManyToOne(type => ProductDetail, { nullable: true })
107
- @Field({ nullable: true })
108
- productDetail: ProductDetail
109
-
110
- @ManyToOne(type => Warehouse, { nullable: true })
111
- @Field(type => Warehouse, { nullable: true })
112
- warehouse: Warehouse
113
-
114
- @ManyToOne(type => Location)
115
- @Field(type => Location, { nullable: true })
116
- location: Location
117
-
118
- @Column({ nullable: true })
119
- @Field({ nullable: true })
120
- zone: string
121
-
122
- @Column('int', { nullable: true })
123
- @Field({ nullable: true })
124
- manufactureYear: number
125
-
126
- @Column('date', { nullable: true })
127
- @Field(type => ScalarDate, { nullable: true })
128
- manufactureDate: Date
129
-
130
- @Column('float', { nullable: true, transformer: roundTransformer })
131
- @Field({ nullable: true })
132
- costPrice: number
133
-
134
- @Column('float', { nullable: true, transformer: roundTransformer })
135
- @Field({ nullable: true })
136
- sellPrice: number
137
-
138
- @Column({ nullable: true })
139
- @Field({ nullable: true })
140
- packingType: string
141
-
142
- @Column('float', { nullable: true, default: 1, transformer: roundTransformer })
143
- @Field({ nullable: true })
144
- packingSize: number
145
-
146
- @Column({ nullable: true })
147
- @Field({ nullable: true })
148
- unit: string
149
-
150
- @Column({ nullable: true })
151
- @Field({ nullable: true })
152
- uom: string
153
-
154
- @Column('float', { nullable: true, transformer: roundTransformer })
155
- @Field({ nullable: true })
156
- uomValue: number
157
-
158
- @Column('float', { nullable: true, transformer: roundTransformer })
159
- @Field({ nullable: true })
160
- lockedUomValue: number
161
-
162
- @Column('float', { transformer: roundTransformer })
163
- @Field({ nullable: true })
164
- qty: number
165
-
166
- @Column('float', { nullable: true, transformer: roundTransformer })
167
- @Field({ nullable: true })
168
- lockedQty: number
169
-
170
- @Column('float', { nullable: true, transformer: roundTransformer })
171
- @Field({ nullable: true })
172
- unitCost: number
173
-
174
- @Column({ default: 0 })
175
- @Field()
176
- lastSeq: number
177
-
178
- @Column({ nullable: true })
179
- @Field({ nullable: true })
180
- description: string
181
-
182
- @Column({ nullable: true })
183
- @Field({ nullable: true })
184
- status: string
185
-
186
- @Column({ nullable: true })
187
- @Field({ nullable: true })
188
- otherRef: string
189
-
190
- @Column({ nullable: true })
191
- @Field({ nullable: true })
192
- remark: string
193
-
194
- @OneToMany(type => InventoryChange, inventoryChanges => inventoryChanges.inventory)
195
- @Field(type => [InventoryChange], { nullable: true })
196
- inventoryChanges: InventoryChange[]
197
-
198
- @OneToMany(type => InventoryItem, inventoryItems => inventoryItems.inventory)
199
- @Field(type => [InventoryItem], { nullable: true })
200
- inventoryItems: InventoryItem[]
201
-
202
- @Field({ nullable: true })
203
- serialNumbers?: string
204
-
205
- @Column('date', { nullable: true })
206
- @Field(type => ScalarDate, { nullable: true })
207
- expirationDate: Date
208
-
209
- @Field({ nullable: true })
210
- productId: string
211
-
212
- @Field({ nullable: true })
213
- productName: string
214
-
215
- @Field({ nullable: true })
216
- productSKU: string
217
-
218
- @Field({ nullable: true })
219
- productType: string
220
-
221
- @Field({ nullable: true })
222
- primaryValue: string
223
-
224
- @Field({ nullable: true })
225
- primaryUnit: string
226
-
227
- @Field({ nullable: true })
228
- auxUnit1: string
229
-
230
- @Field({ nullable: true })
231
- productBrand: string
232
-
233
- @Column({ nullable: true, default: '' })
234
- @Field({ nullable: true })
235
- productColor?: string
236
-
237
- @Column({ nullable: true, default: '' })
238
- @Field({ nullable: true })
239
- productQuality?: string
240
-
241
- // 작업 구분
242
- @Column({ nullable: true, default: '' })
243
- @Field({ nullable: true })
244
- workCategory?: string
245
-
246
- // 제품 상태 (불량/반품)
247
- @Column({ nullable: true, default: '' })
248
- @Field({ nullable: true })
249
- productStatus?: string
250
-
251
- @Column({ nullable: true })
252
- @Field({ nullable: true })
253
- auxInfo1?: string
254
-
255
- // 자호
256
- @Column({ nullable: true })
257
- @Field({ nullable: true })
258
- auxInfo2?: string
259
-
260
- @Column({ nullable: true })
261
- @Field({ nullable: true })
262
- auxInfo3?: string
263
-
264
- @Field(type => Float, { nullable: true })
265
- averageUnitCost: number
266
-
267
- @Field(type => Float, { nullable: true })
268
- remainQty: number
269
-
270
- @Field(type => Int, { nullable: true })
271
- nonLoadedQty: number
272
-
273
- @Field(type => Float, { nullable: true })
274
- nonLoadedUomValue: number
275
-
276
- @Field({ nullable: true })
277
- initialInboundAt: string
278
-
279
- @ManyToOne(type => User, {
280
- nullable: true
281
- })
282
- @Field({ nullable: true })
283
- creator: User
284
-
285
- @RelationId((inventory: Inventory) => inventory.creator)
286
- creatorId: string
287
-
288
- @ManyToOne(type => User, {
289
- nullable: true
290
- })
291
- @Field({ nullable: true })
292
- updater: User
293
-
294
- @RelationId((inventory: Inventory) => inventory.updater)
295
- updaterId: string
296
-
297
- @CreateDateColumn()
298
- @Field({ nullable: true })
299
- createdAt: Date
300
-
301
- @UpdateDateColumn()
302
- @Field({ nullable: true })
303
- updatedAt: Date
304
-
305
- @Field({ nullable: true })
306
- remainUomValueWithUom?: string
307
-
308
- @Field({ nullable: true })
309
- remainUomValue?: number
310
-
311
- @Field({ nullable: true })
312
- changeCount?: number
313
-
314
- @Field({ nullable: true })
315
- binLocation?: string
316
-
317
- @Field({ nullable: true })
318
- orderNo?: string
319
-
320
- @Field({ nullable: true })
321
- inventoryItemCount: number
322
-
323
- @Field({ nullable: true })
324
- availableQty: number
325
-
326
- @Field({ nullable: true })
327
- releaseQty: number
328
-
329
- @Field({ nullable: true })
330
- quarantineQty: number
331
-
332
- @Field({ nullable: true })
333
- reserveQty: number
334
-
335
- @Field({ nullable: true })
336
- warehouseQty: number
337
-
338
- @Column({ nullable: true })
339
- @Field({ nullable: true })
340
- lot?: string
341
-
342
- @ManyToOne(type => Inventory, { nullable: true })
343
- @Field(type => Inventory, { nullable: true })
344
- originInventory?: Inventory
345
-
346
- @RelationId((inventory: Inventory) => inventory.originInventory)
347
- originInventoryId?: string
348
-
349
- constructor(obj?) {
350
- if (obj) {
351
- this.id = obj.inventory_id
352
- this.bizplace = {
353
- id: obj.bizplace_id,
354
- name: obj.bizplace_name,
355
- description: obj.bizplace_description
356
- } as any
357
- this.product = new Product(obj)
358
- this.location = new Location(obj)
359
- this.warehouse = new Warehouse(obj)
360
- this.name = obj.inventory_name
361
- this.palletId = obj.inventory_pallet_id
362
- this.batchId = obj.inventory_batch_id
363
- this.refOrderId = obj.inventory_ref_order_id
364
- this.orderProductId = obj.inventory_order_product_id
365
- this.zone = obj.inventory_zone
366
- this.costPrice = obj.inventory_cost_price
367
- this.sellPrice = obj.inventory_sell_price
368
- this.packingType = obj.inventory_packing_type
369
- this.unit = obj.inventory_unit
370
- this.uom = obj.inventory_uom
371
- this.uomValue = obj.inventory_uom_value
372
- this.lockedUomValue = obj.inventory_locked_uom_value
373
- this.qty = obj.inventory_qty
374
- this.lockedQty = obj.inventory_locked_qty
375
- this.lastSeq = obj.inventory_last_seq
376
- this.description = obj.inventory_description
377
- this.status = obj.inventory_status
378
- this.otherRef = obj.inventory_other_ref
379
- this.remark = obj.inventory_remark
380
- this.createdAt = obj.inventory_created_at
381
- this.updatedAt = obj.inventory_updated_at
382
- this.expirationDate = obj.inventory_expiration_date
383
- this.unitCost = obj.inventory_unit_cost
384
- this.manufactureYear = obj.inventory_manufacture_year
385
- this.manufactureDate = obj.inventory_manufacture_date
386
- this.batchIdRef = obj.inventory_batch_id_ref
387
- this.cartonId = obj.inventory_carton_id
388
- this.packingSize = obj.inventory_packing_size
389
- this.productColor = obj.inventory_product_color
390
- this.productQuality = obj.inventory_product_quality
391
- this.workCategory = obj.inventory_work_category
392
- this.productStatus = obj.inventory_product_status
393
- this.creatorId = obj.inventory_creator_id
394
- this.updaterId = obj.inventory_updater_id
395
- this.lot = obj.inventory_lot
396
- }
397
- }
398
- }
@@ -1,6 +0,0 @@
1
- import { InventoryChange } from './inventory-change'
2
- import { InventoryChangeMutation } from './inventory-change-mutation'
3
- import { InventoryChangeQuery } from './inventory-change-query'
4
-
5
- export const entities = [InventoryChange]
6
- export const resolvers = [InventoryChangeQuery, InventoryChangeMutation]