@things-factory/product-base 8.0.0-beta.1 → 8.0.0-beta.4
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/package.json +5 -5
- package/server/constants/index.ts +0 -1
- package/server/constants/product.ts +0 -24
- package/server/controllers/index.ts +0 -0
- package/server/index.ts +0 -2
- package/server/middlewares/index.ts +0 -0
- package/server/migrations/index.ts +0 -9
- package/server/service/index.ts +0 -61
- package/server/service/product/index.ts +0 -6
- package/server/service/product/product-mutation.ts +0 -407
- package/server/service/product/product-query.ts +0 -336
- package/server/service/product/product-types.ts +0 -450
- package/server/service/product/product.ts +0 -543
- package/server/service/product/validate-product.ts +0 -42
- package/server/service/product-bundle/index.ts +0 -6
- package/server/service/product-bundle/product-bundle-mutation.ts +0 -140
- package/server/service/product-bundle/product-bundle-query.ts +0 -104
- package/server/service/product-bundle/product-bundle-types.ts +0 -51
- package/server/service/product-bundle/product-bundle.ts +0 -102
- package/server/service/product-bundle-setting/index.ts +0 -6
- package/server/service/product-bundle-setting/product-bundle-setting-mutation.ts +0 -168
- package/server/service/product-bundle-setting/product-bundle-setting-query.ts +0 -139
- package/server/service/product-bundle-setting/product-bundle-setting-types.ts +0 -41
- package/server/service/product-bundle-setting/product-bundle-setting.ts +0 -45
- package/server/service/product-combination/index.ts +0 -6
- package/server/service/product-combination/product-combination-mutation.ts +0 -148
- package/server/service/product-combination/product-combination-query.ts +0 -48
- package/server/service/product-combination/product-combination-type.ts +0 -50
- package/server/service/product-combination/product-combination.ts +0 -116
- package/server/service/product-combination-setting/index.ts +0 -6
- package/server/service/product-combination-setting/product-combination-setting-mutation.ts +0 -248
- package/server/service/product-combination-setting/product-combination-setting-query.ts +0 -176
- package/server/service/product-combination-setting/product-combination-setting-type.ts +0 -44
- package/server/service/product-combination-setting/product-combination-setting.ts +0 -77
- package/server/service/product-detail/index.ts +0 -6
- package/server/service/product-detail/product-detail-mutation.ts +0 -238
- package/server/service/product-detail/product-detail-query.ts +0 -213
- package/server/service/product-detail/product-detail-types.ts +0 -280
- package/server/service/product-detail/product-detail.ts +0 -388
- package/server/service/product-detail-bizplace-setting/index.ts +0 -6
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-mutation.ts +0 -118
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.ts +0 -90
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-types.ts +0 -62
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts +0 -104
- package/server/service/product-set/index.ts +0 -6
- package/server/service/product-set/product-set-mutation.ts +0 -149
- package/server/service/product-set/product-set-query.ts +0 -114
- package/server/service/product-set/product-set-types.ts +0 -45
- package/server/service/product-set/product-set.ts +0 -95
- package/server/utils/index.ts +0 -1
- package/server/utils/product-util.ts +0 -11
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { User } from '@things-factory/auth-base'
|
|
2
|
-
import { Bizplace } from '@things-factory/biz-base'
|
|
3
|
-
import { Domain } from '@things-factory/shell'
|
|
4
|
-
import { Field, ID, ObjectType } from 'type-graphql'
|
|
5
|
-
import {
|
|
6
|
-
Column,
|
|
7
|
-
CreateDateColumn,
|
|
8
|
-
Entity,
|
|
9
|
-
Index,
|
|
10
|
-
ManyToOne,
|
|
11
|
-
OneToMany,
|
|
12
|
-
PrimaryGeneratedColumn,
|
|
13
|
-
RelationId,
|
|
14
|
-
UpdateDateColumn
|
|
15
|
-
} from 'typeorm'
|
|
16
|
-
import { Product } from '../product/product'
|
|
17
|
-
|
|
18
|
-
@Entity()
|
|
19
|
-
@Index('ix_product_set_0', (productSet: ProductSet) => [productSet.bizplace, productSet.name], { unique: true })
|
|
20
|
-
@ObjectType()
|
|
21
|
-
export class ProductSet {
|
|
22
|
-
@PrimaryGeneratedColumn('uuid')
|
|
23
|
-
@Field(type => ID)
|
|
24
|
-
readonly id: string
|
|
25
|
-
|
|
26
|
-
@ManyToOne(type => Domain)
|
|
27
|
-
@Field(type => Domain)
|
|
28
|
-
domain: Domain
|
|
29
|
-
|
|
30
|
-
@RelationId((productSet: ProductSet) => productSet.domain)
|
|
31
|
-
domainId: string
|
|
32
|
-
|
|
33
|
-
@ManyToOne(type => Bizplace, {
|
|
34
|
-
nullable: false
|
|
35
|
-
})
|
|
36
|
-
@Field({ nullable: true })
|
|
37
|
-
bizplace: Bizplace
|
|
38
|
-
|
|
39
|
-
@Column({ nullable: true })
|
|
40
|
-
@Field({ nullable: true })
|
|
41
|
-
code: string
|
|
42
|
-
|
|
43
|
-
@Column()
|
|
44
|
-
@Field()
|
|
45
|
-
name: string
|
|
46
|
-
|
|
47
|
-
@Column({
|
|
48
|
-
nullable: true
|
|
49
|
-
})
|
|
50
|
-
@Field({ nullable: true })
|
|
51
|
-
description: string
|
|
52
|
-
|
|
53
|
-
@OneToMany(type => Product, product => product.productSet, {
|
|
54
|
-
nullable: true
|
|
55
|
-
})
|
|
56
|
-
@Field(type => [Product], { nullable: true })
|
|
57
|
-
product: Product[]
|
|
58
|
-
|
|
59
|
-
@Column({
|
|
60
|
-
nullable: true,
|
|
61
|
-
default: 'ACTIVE'
|
|
62
|
-
})
|
|
63
|
-
@Field({ nullable: true })
|
|
64
|
-
status: string
|
|
65
|
-
|
|
66
|
-
@Column()
|
|
67
|
-
@Field()
|
|
68
|
-
type: string
|
|
69
|
-
|
|
70
|
-
@CreateDateColumn()
|
|
71
|
-
@Field({ nullable: true })
|
|
72
|
-
createdAt: Date
|
|
73
|
-
|
|
74
|
-
@UpdateDateColumn()
|
|
75
|
-
@Field({ nullable: true })
|
|
76
|
-
updatedAt: Date
|
|
77
|
-
|
|
78
|
-
@ManyToOne(type => User, {
|
|
79
|
-
nullable: true
|
|
80
|
-
})
|
|
81
|
-
@Field({ nullable: true })
|
|
82
|
-
creator: User
|
|
83
|
-
|
|
84
|
-
@RelationId((productSet: ProductSet) => productSet.creator)
|
|
85
|
-
creatorId: string
|
|
86
|
-
|
|
87
|
-
@ManyToOne(type => User, {
|
|
88
|
-
nullable: true
|
|
89
|
-
})
|
|
90
|
-
@Field({ nullable: true })
|
|
91
|
-
updater: User
|
|
92
|
-
|
|
93
|
-
@RelationId((productSet: ProductSet) => productSet.updater)
|
|
94
|
-
updaterId: string
|
|
95
|
-
}
|
package/server/utils/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './product-util'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class ProductUtil {
|
|
2
|
-
static productSetCode() {
|
|
3
|
-
return 'PS' + generateRandomString(10)
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const generateRandomString = function (length, randomString = '') {
|
|
8
|
-
randomString += Math.random().toString(20).substr(2, length)
|
|
9
|
-
if (randomString.length > length) return randomString.slice(0, length)
|
|
10
|
-
return generateRandomString(length, randomString)
|
|
11
|
-
}
|