@things-factory/product-base 7.0.1-alpha.93 → 7.0.1-alpha.96
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/product/product.js +6 -2
- package/dist-server/service/product/product.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle.js +1 -1
- package/dist-server/service/product-bundle/product-bundle.js.map +1 -1
- package/dist-server/service/product-detail/product-detail.js +1 -1
- package/dist-server/service/product-detail/product-detail.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js +5 -2
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -1
- package/dist-server/service/product-set/product-set.js +1 -1
- package/dist-server/service/product-set/product-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/product/product.ts +23 -4
- package/server/service/product-bundle/product-bundle.ts +12 -2
- package/server/service/product-detail/product-detail.ts +22 -4
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts +15 -3
- package/server/service/product-set/product-set.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/product-base",
|
|
3
|
-
"version": "7.0.1-alpha.
|
|
3
|
+
"version": "7.0.1-alpha.96",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/biz-base": "^7.0.1-alpha.
|
|
27
|
+
"@things-factory/biz-base": "^7.0.1-alpha.96",
|
|
28
28
|
"@things-factory/env": "^7.0.1-alpha.71",
|
|
29
|
-
"@things-factory/routing-base": "^7.0.1-alpha.
|
|
29
|
+
"@things-factory/routing-base": "^7.0.1-alpha.96"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "454f3e70a838f7cf177bcad936d335ad446093c8"
|
|
32
32
|
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Field, Float, ID, ObjectType } from 'type-graphql'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
Index,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
OneToMany,
|
|
9
|
+
PrimaryGeneratedColumn,
|
|
10
|
+
RelationId,
|
|
11
|
+
UpdateDateColumn
|
|
12
|
+
} from 'typeorm'
|
|
3
13
|
|
|
4
14
|
import { User } from '@things-factory/auth-base'
|
|
5
15
|
import { Bizplace } from '@things-factory/biz-base'
|
|
@@ -22,7 +32,11 @@ export enum pickStrategy {
|
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
@Entity()
|
|
25
|
-
@Index(
|
|
35
|
+
@Index(
|
|
36
|
+
'ix_product_0',
|
|
37
|
+
(product: Product) => [product.domain, product.bizplace, product.name, product.description, product.weight],
|
|
38
|
+
{ unique: true }
|
|
39
|
+
)
|
|
26
40
|
@Index('ix_product_1', (product: Product) => [product.bizplace])
|
|
27
41
|
@ObjectType()
|
|
28
42
|
export class Product {
|
|
@@ -31,7 +45,7 @@ export class Product {
|
|
|
31
45
|
id: string
|
|
32
46
|
|
|
33
47
|
@ManyToOne(type => Domain)
|
|
34
|
-
@Field()
|
|
48
|
+
@Field(type => Domain)
|
|
35
49
|
domain: Domain
|
|
36
50
|
|
|
37
51
|
@RelationId((product: Product) => product.domain)
|
|
@@ -367,7 +381,12 @@ export class Product {
|
|
|
367
381
|
|
|
368
382
|
@Column({
|
|
369
383
|
nullable: false,
|
|
370
|
-
type:
|
|
384
|
+
type:
|
|
385
|
+
DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
386
|
+
? 'enum'
|
|
387
|
+
: DATABASE_TYPE == 'oracle'
|
|
388
|
+
? 'varchar2'
|
|
389
|
+
: 'smallint',
|
|
371
390
|
enum: pickStrategy,
|
|
372
391
|
default: pickStrategy.FIFO
|
|
373
392
|
})
|
|
@@ -2,7 +2,17 @@ import { User } from '@things-factory/auth-base'
|
|
|
2
2
|
import { Bizplace } from '@things-factory/biz-base'
|
|
3
3
|
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
4
4
|
import { Field, ID, ObjectType } from 'type-graphql'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Column,
|
|
7
|
+
CreateDateColumn,
|
|
8
|
+
Entity,
|
|
9
|
+
Index,
|
|
10
|
+
ManyToOne,
|
|
11
|
+
OneToMany,
|
|
12
|
+
PrimaryGeneratedColumn,
|
|
13
|
+
RelationId,
|
|
14
|
+
UpdateDateColumn
|
|
15
|
+
} from 'typeorm'
|
|
6
16
|
import { ProductBundleSetting } from '../product-bundle-setting/product-bundle-setting'
|
|
7
17
|
|
|
8
18
|
@Entity()
|
|
@@ -16,7 +26,7 @@ export class ProductBundle {
|
|
|
16
26
|
readonly id: string
|
|
17
27
|
|
|
18
28
|
@ManyToOne(type => Domain)
|
|
19
|
-
@Field()
|
|
29
|
+
@Field(type => Domain)
|
|
20
30
|
domain: Domain
|
|
21
31
|
|
|
22
32
|
@RelationId((productBundle: ProductBundle) => productBundle.domain)
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Field, Float, ID, ObjectType } from 'type-graphql'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
Index,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
OneToMany,
|
|
9
|
+
PrimaryGeneratedColumn,
|
|
10
|
+
RelationId,
|
|
11
|
+
UpdateDateColumn
|
|
12
|
+
} from 'typeorm'
|
|
3
13
|
|
|
4
14
|
import { User } from '@things-factory/auth-base'
|
|
5
15
|
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
@@ -61,7 +71,11 @@ import { Product } from '../product/product'
|
|
|
61
71
|
**/
|
|
62
72
|
|
|
63
73
|
@Entity()
|
|
64
|
-
@Index(
|
|
74
|
+
@Index(
|
|
75
|
+
'ix_product_detail_0',
|
|
76
|
+
(productDetail: ProductDetail) => [productDetail.domain, productDetail.gtin, productDetail.product],
|
|
77
|
+
{ unique: true }
|
|
78
|
+
)
|
|
65
79
|
@Index('ix_product_detail_1', (productDetail: ProductDetail) => [productDetail.product])
|
|
66
80
|
@Index('ix_product_detail_2', (productDetail: ProductDetail) => [productDetail.domain, productDetail.refCode], {
|
|
67
81
|
unique: true
|
|
@@ -125,7 +139,7 @@ export class ProductDetail {
|
|
|
125
139
|
readonly id: string
|
|
126
140
|
|
|
127
141
|
@ManyToOne(type => Domain)
|
|
128
|
-
@Field()
|
|
142
|
+
@Field(type => Domain)
|
|
129
143
|
domain: Domain
|
|
130
144
|
|
|
131
145
|
@RelationId((productDetail: ProductDetail) => productDetail.domain)
|
|
@@ -179,7 +193,11 @@ export class ProductDetail {
|
|
|
179
193
|
@Field(type => [ProductDetail], { nullable: true })
|
|
180
194
|
parentProductDetails: ProductDetail[]
|
|
181
195
|
|
|
182
|
-
@OneToMany(
|
|
196
|
+
@OneToMany(
|
|
197
|
+
type => ProductDetailBizplaceSetting,
|
|
198
|
+
productDetailBizplaceSetting => productDetailBizplaceSetting.productDetail,
|
|
199
|
+
{ nullable: true }
|
|
200
|
+
)
|
|
183
201
|
@Field(type => [ProductDetailBizplaceSetting], { nullable: true })
|
|
184
202
|
productDetailBizplaceSettings: ProductDetailBizplaceSetting[]
|
|
185
203
|
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Field, ID, ObjectType } from 'type-graphql'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
Index,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
PrimaryGeneratedColumn,
|
|
9
|
+
RelationId,
|
|
10
|
+
UpdateDateColumn
|
|
11
|
+
} from 'typeorm'
|
|
3
12
|
|
|
4
13
|
import { User } from '@things-factory/auth-base'
|
|
5
14
|
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
@@ -24,7 +33,10 @@ import { ProductDetail } from '../product-detail/product-detail'
|
|
|
24
33
|
@Entity()
|
|
25
34
|
@Index(
|
|
26
35
|
'ix_product_detail_bizplace_setting_0',
|
|
27
|
-
(productDetailBizplaceSetting: ProductDetailBizplaceSetting) => [
|
|
36
|
+
(productDetailBizplaceSetting: ProductDetailBizplaceSetting) => [
|
|
37
|
+
productDetailBizplaceSetting.domain,
|
|
38
|
+
productDetailBizplaceSetting.productDetail
|
|
39
|
+
],
|
|
28
40
|
{ unique: true }
|
|
29
41
|
)
|
|
30
42
|
@ObjectType()
|
|
@@ -34,7 +46,7 @@ export class ProductDetailBizplaceSetting {
|
|
|
34
46
|
readonly id: string
|
|
35
47
|
|
|
36
48
|
@ManyToOne(type => Domain)
|
|
37
|
-
@Field()
|
|
49
|
+
@Field(type => Domain)
|
|
38
50
|
domain: Domain
|
|
39
51
|
|
|
40
52
|
@RelationId((productDetailBizplaceSetting: ProductDetailBizplaceSetting) => productDetailBizplaceSetting.domain)
|