@things-factory/product-base 8.0.37 → 9.0.0-9.0.0-beta.59.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 (63) hide show
  1. package/dist-server/service/product/product-mutation.js +1 -1
  2. package/dist-server/service/product/product-mutation.js.map +1 -1
  3. package/dist-server/service/product/product-query.d.ts +1 -1
  4. package/dist-server/service/product/product-query.js +5 -7
  5. package/dist-server/service/product/product-query.js.map +1 -1
  6. package/dist-server/service/product/product-types.d.ts +2 -12
  7. package/dist-server/service/product/product-types.js +2 -42
  8. package/dist-server/service/product/product-types.js.map +1 -1
  9. package/dist-server/service/product/product.d.ts +2 -9
  10. package/dist-server/service/product/product.js +1 -36
  11. package/dist-server/service/product/product.js.map +1 -1
  12. package/dist-server/tsconfig.tsbuildinfo +1 -1
  13. package/package.json +5 -5
  14. package/server/constants/index.ts +0 -1
  15. package/server/constants/product.ts +0 -24
  16. package/server/controllers/index.ts +0 -0
  17. package/server/index.ts +0 -2
  18. package/server/middlewares/index.ts +0 -0
  19. package/server/migrations/index.ts +0 -9
  20. package/server/service/index.ts +0 -61
  21. package/server/service/product/index.ts +0 -6
  22. package/server/service/product/product-mutation.ts +0 -407
  23. package/server/service/product/product-query.ts +0 -338
  24. package/server/service/product/product-types.ts +0 -482
  25. package/server/service/product/product.ts +0 -574
  26. package/server/service/product/validate-product.ts +0 -42
  27. package/server/service/product-bundle/index.ts +0 -6
  28. package/server/service/product-bundle/product-bundle-mutation.ts +0 -140
  29. package/server/service/product-bundle/product-bundle-query.ts +0 -104
  30. package/server/service/product-bundle/product-bundle-types.ts +0 -51
  31. package/server/service/product-bundle/product-bundle.ts +0 -102
  32. package/server/service/product-bundle-setting/index.ts +0 -6
  33. package/server/service/product-bundle-setting/product-bundle-setting-mutation.ts +0 -168
  34. package/server/service/product-bundle-setting/product-bundle-setting-query.ts +0 -139
  35. package/server/service/product-bundle-setting/product-bundle-setting-types.ts +0 -41
  36. package/server/service/product-bundle-setting/product-bundle-setting.ts +0 -45
  37. package/server/service/product-combination/index.ts +0 -6
  38. package/server/service/product-combination/product-combination-mutation.ts +0 -148
  39. package/server/service/product-combination/product-combination-query.ts +0 -48
  40. package/server/service/product-combination/product-combination-type.ts +0 -50
  41. package/server/service/product-combination/product-combination.ts +0 -116
  42. package/server/service/product-combination-setting/index.ts +0 -6
  43. package/server/service/product-combination-setting/product-combination-setting-mutation.ts +0 -248
  44. package/server/service/product-combination-setting/product-combination-setting-query.ts +0 -176
  45. package/server/service/product-combination-setting/product-combination-setting-type.ts +0 -44
  46. package/server/service/product-combination-setting/product-combination-setting.ts +0 -77
  47. package/server/service/product-detail/index.ts +0 -6
  48. package/server/service/product-detail/product-detail-mutation.ts +0 -238
  49. package/server/service/product-detail/product-detail-query.ts +0 -213
  50. package/server/service/product-detail/product-detail-types.ts +0 -280
  51. package/server/service/product-detail/product-detail.ts +0 -388
  52. package/server/service/product-detail-bizplace-setting/index.ts +0 -6
  53. package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.ts +0 -118
  54. package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.ts +0 -90
  55. package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.ts +0 -62
  56. package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts +0 -104
  57. package/server/service/product-set/index.ts +0 -6
  58. package/server/service/product-set/product-set-mutation.ts +0 -149
  59. package/server/service/product-set/product-set-query.ts +0 -114
  60. package/server/service/product-set/product-set-types.ts +0 -45
  61. package/server/service/product-set/product-set.ts +0 -95
  62. package/server/utils/index.ts +0 -1
  63. package/server/utils/product-util.ts +0 -11
@@ -1,574 +0,0 @@
1
- import { Field, Float, ID, 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, ContactPoint } from '@things-factory/biz-base'
16
- import { config } from '@things-factory/env'
17
- import { Routing } from '@things-factory/routing-base'
18
- import { Domain, roundTransformer } from '@things-factory/shell'
19
-
20
- import { ProductDetail } from '../product-detail/product-detail'
21
- import { ProductSet } from '../product-set/product-set'
22
-
23
- const ORMCONFIG = config.get('ormconfig', {})
24
- const DATABASE_TYPE = ORMCONFIG.type
25
-
26
- export enum pickStrategy {
27
- FIFO = 'FIFO',
28
- FEFO = 'FEFO',
29
- FMFO = 'FMFO',
30
- LIFO = 'LIFO',
31
- LOCATION = 'LOCATION'
32
- }
33
-
34
- @Entity()
35
- @Index(
36
- 'ix_product_0',
37
- (product: Product) => [product.domain, product.bizplace, product.name, product.description, product.weight],
38
- { unique: true }
39
- )
40
- @Index('ix_product_1', (product: Product) => [product.bizplace])
41
- @ObjectType()
42
- export class Product {
43
- @PrimaryGeneratedColumn('uuid')
44
- @Field(type => ID, { nullable: true })
45
- id: string
46
-
47
- @ManyToOne(type => Domain)
48
- @Field(type => Domain)
49
- domain: Domain
50
-
51
- @RelationId((product: Product) => product.domain)
52
- domainId: string
53
-
54
- @RelationId((product: Product) => product.bizplace)
55
- bizplaceId: string
56
-
57
- @RelationId((product: Product) => product.productRef)
58
- productRefId: string
59
-
60
- @RelationId((product: Product) => product.parentProductRef)
61
- parentProductRefId: string
62
-
63
- @ManyToOne(type => Bizplace)
64
- @Field()
65
- bizplace: Bizplace
66
-
67
- @Column({ default: false })
68
- @Field()
69
- isCompany: boolean
70
-
71
- @Column()
72
- @Field({ nullable: true })
73
- sku: string
74
-
75
- @Column({ nullable: true })
76
- @Field({ nullable: true })
77
- brandSku: string
78
-
79
- @Column({ nullable: true })
80
- @Field({ nullable: true })
81
- brand: string
82
-
83
- @Column({ nullable: true })
84
- @Field({ nullable: true })
85
- subBrand: string
86
-
87
- // 입고 단위
88
- @Column({ nullable: true })
89
- @Field({ nullable: true })
90
- inboundUnit?: string
91
-
92
- // 변환 kg
93
- @Column('float', { nullable: true, default: 1, transformer: roundTransformer })
94
- @Field({ nullable: true })
95
- convertWeight?: number
96
-
97
- // 박스입수
98
- @Column('float', { nullable: true, default: 0, transformer: roundTransformer })
99
- @Field({ nullable: true })
100
- boxInQty?: number
101
-
102
- // 제품군
103
- @Column({ nullable: true })
104
- @Field({ nullable: true })
105
- category?: string
106
-
107
- // 경매입고
108
- @Column({ nullable: true, default: false })
109
- @Field({ nullable: true })
110
- isAuction?: boolean
111
-
112
- // 판매 통화
113
- @Column({ nullable: true, default: 'USD' })
114
- @Field({ nullable: true })
115
- sellCurrency?: string
116
-
117
- // 원가 통화
118
- @Column({ nullable: true, default: 'KRW' })
119
- @Field({ nullable: true })
120
- costCurrency?: string
121
-
122
- // 바코드
123
- @Column({ nullable: true })
124
- @Field({ nullable: true })
125
- barcode?: string
126
-
127
- //// To be removed ////
128
- @Column({ nullable: true })
129
- @Field({ nullable: true })
130
- gtin: string
131
-
132
- //// To be removed ////
133
- @Column({ nullable: true })
134
- @Field({ nullable: true })
135
- caseGtin: string
136
-
137
- @Column({ nullable: true })
138
- @Field({ nullable: true })
139
- name: string
140
-
141
- @Column()
142
- @Field()
143
- type: string
144
-
145
- //// To be removed ////
146
- @Column({ nullable: true })
147
- @Field({ nullable: true })
148
- packingType: string
149
-
150
- @Column({ nullable: true })
151
- @Field({ nullable: true })
152
- description: string
153
-
154
- @OneToMany(type => ProductDetail, productDetails => productDetails.product, { nullable: true })
155
- @Field(type => [ProductDetail], { nullable: true })
156
- productDetails: ProductDetail[]
157
-
158
- @ManyToOne(type => Product, { nullable: true })
159
- @Field({ nullable: true })
160
- productRef: Product
161
-
162
- //// To be removed ////
163
- @ManyToOne(type => Product, { nullable: true })
164
- @Field({ nullable: true })
165
- parentProductRef: Product
166
-
167
- //// To be removed ////
168
- @OneToMany(type => Product, product => product.parentProductRef, { nullable: true })
169
- @Field(type => [Product], { nullable: true })
170
- childProducts: Product[]
171
-
172
- @ManyToOne(type => ContactPoint, { nullable: true })
173
- @Field({ nullable: true })
174
- deliverTo: ContactPoint
175
-
176
- @RelationId((product: Product) => product.deliverTo)
177
- deliverToId: string
178
-
179
- @ManyToOne(type => ContactPoint, { nullable: true })
180
- @Field({ nullable: true })
181
- manufacturedBy: ContactPoint
182
-
183
- @RelationId((product: Product) => product.manufacturedBy)
184
- manufacturedById: string
185
-
186
- //// To be removed ////
187
- @Column('float', { nullable: true, transformer: roundTransformer })
188
- @Field({ nullable: true })
189
- bundleQty: number
190
-
191
- //// To be removed ////
192
- @Column({ nullable: true })
193
- @Field({ nullable: true })
194
- expirationPeriod: number
195
-
196
- //// To be removed ////
197
- @Column({ nullable: true })
198
- @Field({ nullable: true })
199
- weightUnit: string
200
-
201
- //// To be removed ////
202
- @Column('float', { nullable: true, transformer: roundTransformer })
203
- @Field({ nullable: true })
204
- weight: number
205
-
206
- //// To be removed ////
207
- @Column('float', { nullable: true, transformer: roundTransformer })
208
- @Field({ nullable: true })
209
- grossWeight: number
210
-
211
- //// To be removed ////
212
- @Column('float', { nullable: true, transformer: roundTransformer })
213
- @Field({ nullable: true })
214
- caseWeight: number
215
-
216
- //// To be removed ////
217
- @Column('float', { nullable: true, transformer: roundTransformer })
218
- @Field({ nullable: true })
219
- caseGrossWeight: number
220
-
221
- //// To be removed ////
222
- @Column('float', { nullable: true, transformer: roundTransformer })
223
- @Field({ nullable: true })
224
- density: number
225
-
226
- //// To be removed ////
227
- @Column({ nullable: true })
228
- @Field({ nullable: true })
229
- lengthUnit: string
230
-
231
- //// To be removed ////
232
- @Column('float', { nullable: true, transformer: roundTransformer })
233
- @Field({ nullable: true })
234
- costPrice: number
235
-
236
- //// To be removed ////
237
- @Column('float', { nullable: true, transformer: roundTransformer })
238
- @Field({ nullable: true })
239
- mrpPrice: number
240
-
241
- //// To be removed ////
242
- @Column('float', { nullable: true, transformer: roundTransformer })
243
- @Field({ nullable: true })
244
- sellPrice: number
245
-
246
- //// To be removed ////
247
- @Column('float', { nullable: true, transformer: roundTransformer })
248
- @Field({ nullable: true })
249
- afterTaxCostPrice: number
250
-
251
- //// To be removed ////
252
- @Column('float', { nullable: true, transformer: roundTransformer })
253
- @Field({ nullable: true })
254
- afterTaxSalesPrice: number
255
-
256
- //// To be removed ////
257
- @Column('float', { nullable: true, transformer: roundTransformer })
258
- @Field({ nullable: true })
259
- width: number
260
-
261
- //// To be removed ////
262
- @Column('float', { nullable: true, transformer: roundTransformer })
263
- @Field({ nullable: true })
264
- depth: number
265
-
266
- //// To be removed ////
267
- @Column('float', { nullable: true, transformer: roundTransformer })
268
- @Field({ nullable: true })
269
- height: number
270
-
271
- //// To be removed ////
272
- @Column('float', { nullable: true, transformer: roundTransformer })
273
- @Field({ nullable: true })
274
- volume: number
275
-
276
- //// To be removed ////
277
- @Column('float', { nullable: true, transformer: roundTransformer })
278
- @Field({ nullable: true })
279
- caseWidth: number
280
-
281
- //// To be removed ////
282
- @Column('float', { nullable: true, transformer: roundTransformer })
283
- @Field({ nullable: true })
284
- caseDepth: number
285
-
286
- //// To be removed ////
287
- @Column('float', { nullable: true, transformer: roundTransformer })
288
- @Field({ nullable: true })
289
- caseHeight: number
290
-
291
- //// To be removed ////
292
- @Column('float', { nullable: true, transformer: roundTransformer })
293
- @Field({ nullable: true })
294
- caseVolume: number
295
-
296
- //// To be removed ////
297
- @Column({ nullable: true })
298
- @Field({ nullable: true })
299
- volumeSize: string
300
-
301
- //// To be removed ////
302
- @Column({ nullable: true })
303
- @Field({ nullable: true })
304
- primaryUnit: string
305
-
306
- //// To be removed ////
307
- @Column('float', { nullable: true, transformer: roundTransformer })
308
- @Field({ nullable: true })
309
- primaryValue: number
310
-
311
- //// To be removed ////
312
- @Column({ nullable: true })
313
- @Field({ nullable: true })
314
- auxUnit1: string
315
-
316
- //// To be removed ////
317
- @Column({ nullable: true })
318
- @Field({ nullable: true })
319
- auxValue1: string
320
-
321
- //// To be removed ////
322
- @Column({ nullable: true })
323
- @Field({ nullable: true })
324
- auxUnit2: string
325
-
326
- //// To be removed ////
327
- @Column({ nullable: true })
328
- @Field({ nullable: true })
329
- auxValue2: string
330
-
331
- //// To be removed ////
332
- @Column({ nullable: true })
333
- @Field({ nullable: true })
334
- auxUnit3: string
335
-
336
- //// To be removed ////
337
- @Column({ nullable: true })
338
- @Field({ nullable: true })
339
- auxValue3: string
340
-
341
- //// To be removed ////
342
- @Column({ nullable: true })
343
- @Field({ nullable: true })
344
- inventoryAccountCode: string
345
-
346
- //// To be removed ////
347
- @Column({ nullable: true })
348
- @Field({ nullable: true })
349
- cogsAccountCode: string
350
-
351
- //// To be removed ////
352
- @ManyToOne(type => ProductSet, productSet => productSet.product, { nullable: true })
353
- @Field({ nullable: true })
354
- productSet: ProductSet
355
-
356
- //// To be removed ////
357
- @Column({ nullable: true })
358
- @Field({ nullable: true })
359
- movement: string
360
-
361
- //// To be removed ////
362
- @Column({ nullable: true })
363
- @Field({ nullable: true })
364
- bufferQty: number
365
-
366
- //// To be removed ////
367
- @Column('float', { nullable: true, transformer: roundTransformer })
368
- @Field({ nullable: true })
369
- minQty: number
370
-
371
- //// To be removed ////
372
- @Column('float', { nullable: true, transformer: roundTransformer })
373
- @Field({ nullable: true })
374
- maxQty: number
375
-
376
- //// To be removed ////
377
- @Column({ nullable: true })
378
- @Field({ nullable: true })
379
- discountId: number
380
-
381
- //// To be removed ////
382
- @Column({ nullable: true })
383
- @Field({ nullable: true })
384
- status: string
385
-
386
- //// To be removed ////
387
- @Column({ nullable: true })
388
- @Field({ nullable: true })
389
- isTrackedAsInventory: boolean
390
-
391
- @Column({ default: false })
392
- @Field({ nullable: true })
393
- isRequiredCheckExpiry: boolean
394
-
395
- @Column({ default: false })
396
- @Field({ nullable: true })
397
- isRequireSerialNumberScanning: boolean
398
-
399
- @Column({ default: false })
400
- @Field({ nullable: true })
401
- isRequireSerialNumberScanningInbound: boolean
402
-
403
- @Column({ default: false })
404
- @Field({ nullable: true })
405
- isRequireSerialNumberScanningOutbound: boolean
406
-
407
- @Column({ nullable: true })
408
- @Field({ nullable: true })
409
- deletedAt: Date
410
-
411
- @Column({
412
- nullable: false,
413
- type:
414
- DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
415
- ? 'enum'
416
- : DATABASE_TYPE == 'oracle'
417
- ? 'varchar2'
418
- : DATABASE_TYPE == 'mssql'
419
- ? 'nvarchar'
420
- : 'varchar',
421
- enum:
422
- DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? pickStrategy : undefined,
423
- length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32,
424
- default: pickStrategy.FIFO
425
- })
426
- @Field()
427
- pickingStrategy: pickStrategy
428
-
429
- @Column({ nullable: true })
430
- @Field({ nullable: true })
431
- releaseType?: string
432
-
433
- @Field({ nullable: true })
434
- refCode: string
435
-
436
- @Field(type => Float, { nullable: true })
437
- nettWeight: number
438
-
439
- @Field({ nullable: true })
440
- uom: string
441
-
442
- @Field(type => Float, { nullable: true })
443
- uomValue: number
444
-
445
- @Field({ nullable: true })
446
- auxUnit4: string
447
-
448
- @Field({ nullable: true })
449
- auxValue4: string
450
-
451
- @Field({ nullable: true })
452
- auxUnit5: string
453
-
454
- @Field({ nullable: true })
455
- auxValue5: string
456
-
457
- @ManyToOne(type => User, { nullable: true })
458
- @Field({ nullable: true })
459
- creator: User
460
-
461
- @RelationId((product: Product) => product.creator)
462
- creatorId: string
463
-
464
- @ManyToOne(type => User, { nullable: true })
465
- @Field({ nullable: true })
466
- updater: User
467
-
468
- @RelationId((product: Product) => product.updater)
469
- updaterId: string
470
-
471
- @CreateDateColumn()
472
- @Field({ nullable: true })
473
- createdAt: Date
474
-
475
- @UpdateDateColumn()
476
- @Field({ nullable: true })
477
- updatedAt: Date
478
-
479
- @ManyToOne(type => Routing, { nullable: true })
480
- @Field({ nullable: true })
481
- routing?: Routing
482
-
483
- @RelationId((product: Product) => product.routing)
484
- routingId?: string
485
-
486
- @Column({ nullable: true })
487
- @Field(type => String, { nullable: true })
488
- warehouseId?: string
489
-
490
- @Field(type => String, { nullable: true })
491
- thumbnail?: string
492
-
493
- @Field({ nullable: true })
494
- productInformation: string
495
-
496
- @Field({ nullable: true })
497
- batchNo?: string
498
-
499
- @Field({ nullable: true })
500
- loadedQty: number
501
-
502
- constructor(obj?) {
503
- if (obj) {
504
- this.id = obj.product_id
505
- this.sku = obj.product_sku
506
- this.name = obj.product_name
507
- this.description = obj.product_description
508
- this.bundleQty = obj.product_bundle_qty
509
- this.type = obj.product_type
510
- this.packingType = obj.product_packing_type
511
- this.expirationPeriod = obj.product_expiration_period
512
- this.weightUnit = obj.product_weight_unit
513
- this.weight = obj.product_weight
514
- this.density = obj.product_density
515
- this.lengthUnit = obj.product_length_unit
516
- this.costPrice = obj.product_cost_price
517
- this.sellPrice = obj.product_sell_price
518
- this.width = obj.product_width
519
- this.depth = obj.product_depth
520
- this.height = obj.product_height
521
- this.primaryUnit = obj.product_primary_unit
522
- this.primaryValue = obj.product_primary_value
523
- this.auxUnit1 = obj.product_aux_unit_1
524
- this.auxValue1 = obj.product_aux_value_1
525
- this.auxUnit2 = obj.product_aux_unit_2
526
- this.auxValue2 = obj.product_aux_value_2
527
- this.auxUnit3 = obj.product_aux_unit_3
528
- this.auxValue3 = obj.product_aux_value_3
529
- this.createdAt = obj.product_created_at
530
- this.updatedAt = obj.product_updated_at
531
- this.movement = obj.product_movement
532
- this.inventoryAccountCode = obj.product_inventory_account_code
533
- this.cogsAccountCode = obj.product_cogs_account_code
534
- this.isTrackedAsInventory = obj.product_is_tracked_as_inventory
535
- this.mrpPrice = obj.product_mrp_price
536
- this.afterTaxCostPrice = obj.product_after_tax_cost_price
537
- this.afterTaxSalesPrice = obj.product_after_tax_sales_price
538
- this.bufferQty = obj.product_buffer_qty
539
- this.discountId = obj.product_discount_id
540
- this.status = obj.product_status
541
- this.brandSku = obj.product_brand_sku
542
- this.brand = obj.product_brand
543
- this.subBrand = obj.product_sub_brand
544
- this.gtin = obj.product_gtin
545
- this.caseGtin = obj.product_case_gtin
546
- this.grossWeight = obj.product_gross_weight
547
- this.caseWeight = obj.product_case_weight
548
- this.caseGrossWeight = obj.product_case_gross_weight
549
- this.volume = obj.product_volume
550
- this.caseWidth = obj.product_case_width
551
- this.caseDepth = obj.product_case_depth
552
- this.caseHeight = obj.product_case_height
553
- this.caseVolume = obj.product_case_volume
554
- this.volumeSize = obj.product_volume_size
555
- this.minQty = obj.product_min_qty
556
- this.maxQty = obj.product_max_qty
557
- this.isCompany = obj.product_is_company
558
- this.deletedAt = obj.product_deleted_at
559
- this.isRequiredCheckExpiry = obj.product_is_required_check_expiry
560
- this.isRequireSerialNumberScanning = obj.product_is_require_serial_number_scanning
561
- this.isRequireSerialNumberScanningInbound = obj.product_is_require_serial_number_scanning_inbound
562
- this.isRequireSerialNumberScanningOutbound = obj.product_is_require_serial_number_scanning_outbound
563
- this.bizplace = { id: obj.product_bizplace_id } as any
564
- this.domain = { id: obj.product_domain_id } as any
565
- this.inboundUnit = obj.product_inbound_unit
566
- this.convertWeight = obj.product_convert_weight
567
- this.category = obj.product_category
568
- this.boxInQty = obj.product_box_in_qty
569
- this.isAuction = obj.product_is_auction
570
- this.sellCurrency = obj.product_sell_currency
571
- this.costCurrency = obj.product_cost_currency
572
- }
573
- }
574
- }
@@ -1,42 +0,0 @@
1
- import _ from 'lodash'
2
- import { EntityManager, IsNull, Not } from 'typeorm'
3
-
4
- import { User } from '@things-factory/auth-base'
5
- import { Domain } from '@things-factory/shell'
6
-
7
- import { Product } from './product'
8
-
9
- export async function validateProduct(product: Product, context: ResolverContext) {
10
- const { tx } = context.state
11
-
12
- let errors = []
13
-
14
- if (_.isEmpty(product.sku) || '') {
15
- errors.push('Product SKU is required')
16
- }
17
- if (_.isEmpty(product.name) || '') {
18
- errors.push('Product name is required')
19
- }
20
- if (_.isEmpty(product.type) || '') {
21
- errors.push('Product type is required')
22
- }
23
-
24
- if (
25
- (await tx.getRepository(Product).count({
26
- where: {
27
- sku: product.sku,
28
- bizplace: { id: product.bizplace.id },
29
- domain: { id: product.domain.id },
30
- id: product?.id == null ? Not(IsNull()) : Not(product.id)
31
- }
32
- })) > 0
33
- ) {
34
- errors.push('Duplicated SKU found.')
35
- }
36
-
37
- if (errors.length > 0) {
38
- throw new Error(errors.join(', '))
39
- }
40
-
41
- return true
42
- }
@@ -1,6 +0,0 @@
1
- import { ProductBundle } from './product-bundle'
2
- import { ProductBundleMutation } from './product-bundle-mutation'
3
- import { ProductBundleQuery } from './product-bundle-query'
4
-
5
- export const entities = [ProductBundle]
6
- export const resolvers = [ProductBundleQuery, ProductBundleMutation]