@things-factory/product-base 4.3.131 → 4.3.142
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/index.js +7 -2
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/product/product-mutation.js +17 -4
- package/dist-server/service/product/product-mutation.js.map +1 -1
- package/dist-server/service/product/product.js +6 -0
- package/dist-server/service/product/product.js.map +1 -1
- package/dist-server/service/product-barcode/index.js +9 -0
- package/dist-server/service/product-barcode/index.js.map +1 -0
- package/dist-server/service/product-barcode/product-barcode-mutation.js +120 -0
- package/dist-server/service/product-barcode/product-barcode-mutation.js.map +1 -0
- package/dist-server/service/product-barcode/product-barcode-query.js +87 -0
- package/dist-server/service/product-barcode/product-barcode-query.js.map +1 -0
- package/dist-server/service/product-barcode/product-barcode-type.js +63 -0
- package/dist-server/service/product-barcode/product-barcode-type.js.map +1 -0
- package/dist-server/service/product-barcode/product-barcode.js +99 -0
- package/dist-server/service/product-barcode/product-barcode.js.map +1 -0
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +3 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-mutation.js +70 -13
- package/dist-server/service/product-detail/product-detail-mutation.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-query.js +12 -7
- package/dist-server/service/product-detail/product-detail-query.js.map +1 -1
- package/dist-server/service/product-detail/product-detail-types.js +4 -3
- package/dist-server/service/product-detail/product-detail-types.js.map +1 -1
- package/dist-server/service/product-detail/product-detail.js +8 -2
- package/dist-server/service/product-detail/product-detail.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js +8 -4
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.js.map +1 -1
- package/package.json +4 -4
- package/server/service/index.ts +7 -2
- package/server/service/product/product-mutation.ts +21 -4
- package/server/service/product/product.ts +5 -0
- package/server/service/product-barcode/index.ts +6 -0
- package/server/service/product-barcode/product-barcode-mutation.ts +112 -0
- package/server/service/product-barcode/product-barcode-query.ts +43 -0
- package/server/service/product-barcode/product-barcode-type.ts +35 -0
- package/server/service/product-barcode/product-barcode.ts +78 -0
- package/server/service/product-bundle-setting/product-bundle-setting-query.ts +6 -4
- package/server/service/product-detail/product-detail-mutation.ts +79 -11
- package/server/service/product-detail/product-detail-query.ts +14 -8
- package/server/service/product-detail/product-detail-types.ts +6 -2
- package/server/service/product-detail/product-detail.ts +7 -2
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.ts +8 -4
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
UpdateDateColumn
|
|
14
14
|
} from 'typeorm'
|
|
15
15
|
import { ProductDetailBizplaceSetting } from '../product-detail-bizplace-setting/product-detail-bizplace-setting'
|
|
16
|
+
import { ProductBarcode } from '../product-barcode/product-barcode'
|
|
16
17
|
import { Product } from '../product/product'
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -147,8 +148,8 @@ export class ProductDetail {
|
|
|
147
148
|
@Field()
|
|
148
149
|
name: string
|
|
149
150
|
|
|
150
|
-
@Column()
|
|
151
|
-
@Field()
|
|
151
|
+
@Column({ nullable: true })
|
|
152
|
+
@Field({ nullable: true })
|
|
152
153
|
gtin: string
|
|
153
154
|
|
|
154
155
|
@Column({ nullable: true })
|
|
@@ -199,6 +200,10 @@ export class ProductDetail {
|
|
|
199
200
|
@Field(type => [ProductDetailBizplaceSetting], { nullable: true })
|
|
200
201
|
productDetailBizplaceSettings: ProductDetailBizplaceSetting[]
|
|
201
202
|
|
|
203
|
+
@OneToMany(type => ProductBarcode, productBarcodes => productBarcodes.productDetail, { nullable: true })
|
|
204
|
+
@Field(type => [ProductBarcode], { nullable: true })
|
|
205
|
+
productBarcodes: ProductBarcode[]
|
|
206
|
+
|
|
202
207
|
@Column('float', { nullable: true })
|
|
203
208
|
@Field({ nullable: true })
|
|
204
209
|
childQty: number
|
package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.ts
CHANGED
|
@@ -47,12 +47,14 @@ export class ProductDetailBizplaceSettingMutation {
|
|
|
47
47
|
const newRecord = _createRecords[i]
|
|
48
48
|
delete newRecord.id
|
|
49
49
|
|
|
50
|
-
const productDetail = await tx
|
|
50
|
+
const productDetail = await tx
|
|
51
|
+
.getRepository(ProductDetail)
|
|
52
|
+
.findOne({ where: { id: newRecord.productDetail.id }, relations: ['productBarcodes'] })
|
|
51
53
|
|
|
52
54
|
if (productDetail) {
|
|
53
55
|
const result = await productDetailBizplaceSettingRepo.save({
|
|
54
56
|
...newRecord,
|
|
55
|
-
name: productDetail.gtin,
|
|
57
|
+
name: productDetail.productBarcodes[0].gtin,
|
|
56
58
|
productDetail,
|
|
57
59
|
domain: domain,
|
|
58
60
|
creator: user,
|
|
@@ -70,12 +72,14 @@ export class ProductDetailBizplaceSettingMutation {
|
|
|
70
72
|
domain,
|
|
71
73
|
id: newRecord.id
|
|
72
74
|
})
|
|
73
|
-
const productDetail = await tx
|
|
75
|
+
const productDetail = await tx
|
|
76
|
+
.getRepository(ProductDetail)
|
|
77
|
+
.findOne({ where: { id: newRecord.productDetail.id }, relations: ['productBarcodes'] })
|
|
74
78
|
|
|
75
79
|
const result = await productDetailBizplaceSettingRepo.save({
|
|
76
80
|
...productDetailBizplaceSetting,
|
|
77
81
|
...newRecord,
|
|
78
|
-
name: productDetail.gtin,
|
|
82
|
+
name: productDetail.productBarocdes[0].gtin,
|
|
79
83
|
productDetail,
|
|
80
84
|
updater: user
|
|
81
85
|
})
|