@things-factory/product-base 6.2.138 → 6.2.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/product/product.js +24 -28
- 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 +15 -15
- 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 +2 -5
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/product/product.ts +26 -35
- package/server/service/product-bundle/product-bundle.ts +3 -13
- package/server/service/product-detail/product-detail.ts +18 -26
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting.ts +3 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/product-base",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.142",
|
|
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": "^6.2.
|
|
28
|
-
"@things-factory/env": "^6.2.
|
|
29
|
-
"@things-factory/routing-base": "^6.2.
|
|
27
|
+
"@things-factory/biz-base": "^6.2.139",
|
|
28
|
+
"@things-factory/env": "^6.2.139",
|
|
29
|
+
"@things-factory/routing-base": "^6.2.139"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "78bb2ad1a9d851be0c6ea0e176ccbab61c3b6cc8"
|
|
32
32
|
}
|
|
@@ -5,7 +5,7 @@ import { User } from '@things-factory/auth-base'
|
|
|
5
5
|
import { Bizplace } from '@things-factory/biz-base'
|
|
6
6
|
import { config } from '@things-factory/env'
|
|
7
7
|
import { Routing } from '@things-factory/routing-base'
|
|
8
|
-
import { Domain } from '@things-factory/shell'
|
|
8
|
+
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
9
9
|
|
|
10
10
|
import { ProductDetail } from '../product-detail/product-detail'
|
|
11
11
|
import { ProductSet } from '../product-set/product-set'
|
|
@@ -22,11 +22,7 @@ export enum pickStrategy {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
@Entity()
|
|
25
|
-
@Index(
|
|
26
|
-
'ix_product_0',
|
|
27
|
-
(product: Product) => [product.domain, product.bizplace, product.name, product.description, product.weight],
|
|
28
|
-
{ unique: true }
|
|
29
|
-
)
|
|
25
|
+
@Index('ix_product_0', (product: Product) => [product.domain, product.bizplace, product.name, product.description, product.weight], { unique: true })
|
|
30
26
|
@Index('ix_product_1', (product: Product) => [product.bizplace])
|
|
31
27
|
@ObjectType()
|
|
32
28
|
export class Product {
|
|
@@ -80,12 +76,12 @@ export class Product {
|
|
|
80
76
|
inboundUnit?: string
|
|
81
77
|
|
|
82
78
|
// 변환 kg
|
|
83
|
-
@Column('float', { nullable: true, default: 1 })
|
|
79
|
+
@Column('float', { nullable: true, default: 1, transformer: roundTransformer })
|
|
84
80
|
@Field({ nullable: true })
|
|
85
81
|
convertWeight?: number
|
|
86
82
|
|
|
87
83
|
// 박스입수
|
|
88
|
-
@Column('float', { nullable: true, default: 0 })
|
|
84
|
+
@Column('float', { nullable: true, default: 0, transformer: roundTransformer })
|
|
89
85
|
@Field({ nullable: true })
|
|
90
86
|
boxInQty?: number
|
|
91
87
|
|
|
@@ -145,7 +141,7 @@ export class Product {
|
|
|
145
141
|
childProducts: Product[]
|
|
146
142
|
|
|
147
143
|
//// To be removed ////
|
|
148
|
-
@Column('float', { nullable: true })
|
|
144
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
149
145
|
@Field({ nullable: true })
|
|
150
146
|
bundleQty: number
|
|
151
147
|
|
|
@@ -160,27 +156,27 @@ export class Product {
|
|
|
160
156
|
weightUnit: string
|
|
161
157
|
|
|
162
158
|
//// To be removed ////
|
|
163
|
-
@Column('float', { nullable: true })
|
|
159
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
164
160
|
@Field({ nullable: true })
|
|
165
161
|
weight: number
|
|
166
162
|
|
|
167
163
|
//// To be removed ////
|
|
168
|
-
@Column('float', { nullable: true })
|
|
164
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
169
165
|
@Field({ nullable: true })
|
|
170
166
|
grossWeight: number
|
|
171
167
|
|
|
172
168
|
//// To be removed ////
|
|
173
|
-
@Column('float', { nullable: true })
|
|
169
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
174
170
|
@Field({ nullable: true })
|
|
175
171
|
caseWeight: number
|
|
176
172
|
|
|
177
173
|
//// To be removed ////
|
|
178
|
-
@Column('float', { nullable: true })
|
|
174
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
179
175
|
@Field({ nullable: true })
|
|
180
176
|
caseGrossWeight: number
|
|
181
177
|
|
|
182
178
|
//// To be removed ////
|
|
183
|
-
@Column('float', { nullable: true })
|
|
179
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
184
180
|
@Field({ nullable: true })
|
|
185
181
|
density: number
|
|
186
182
|
|
|
@@ -190,67 +186,67 @@ export class Product {
|
|
|
190
186
|
lengthUnit: string
|
|
191
187
|
|
|
192
188
|
//// To be removed ////
|
|
193
|
-
@Column('float', { nullable: true })
|
|
189
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
194
190
|
@Field({ nullable: true })
|
|
195
191
|
costPrice: number
|
|
196
192
|
|
|
197
193
|
//// To be removed ////
|
|
198
|
-
@Column('float', { nullable: true })
|
|
194
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
199
195
|
@Field({ nullable: true })
|
|
200
196
|
mrpPrice: number
|
|
201
197
|
|
|
202
198
|
//// To be removed ////
|
|
203
|
-
@Column('float', { nullable: true })
|
|
199
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
204
200
|
@Field({ nullable: true })
|
|
205
201
|
sellPrice: number
|
|
206
202
|
|
|
207
203
|
//// To be removed ////
|
|
208
|
-
@Column('float', { nullable: true })
|
|
204
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
209
205
|
@Field({ nullable: true })
|
|
210
206
|
afterTaxCostPrice: number
|
|
211
207
|
|
|
212
208
|
//// To be removed ////
|
|
213
|
-
@Column('float', { nullable: true })
|
|
209
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
214
210
|
@Field({ nullable: true })
|
|
215
211
|
afterTaxSalesPrice: number
|
|
216
212
|
|
|
217
213
|
//// To be removed ////
|
|
218
|
-
@Column('float', { nullable: true })
|
|
214
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
219
215
|
@Field({ nullable: true })
|
|
220
216
|
width: number
|
|
221
217
|
|
|
222
218
|
//// To be removed ////
|
|
223
|
-
@Column('float', { nullable: true })
|
|
219
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
224
220
|
@Field({ nullable: true })
|
|
225
221
|
depth: number
|
|
226
222
|
|
|
227
223
|
//// To be removed ////
|
|
228
|
-
@Column('float', { nullable: true })
|
|
224
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
229
225
|
@Field({ nullable: true })
|
|
230
226
|
height: number
|
|
231
227
|
|
|
232
228
|
//// To be removed ////
|
|
233
|
-
@Column('float', { nullable: true })
|
|
229
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
234
230
|
@Field({ nullable: true })
|
|
235
231
|
volume: number
|
|
236
232
|
|
|
237
233
|
//// To be removed ////
|
|
238
|
-
@Column('float', { nullable: true })
|
|
234
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
239
235
|
@Field({ nullable: true })
|
|
240
236
|
caseWidth: number
|
|
241
237
|
|
|
242
238
|
//// To be removed ////
|
|
243
|
-
@Column('float', { nullable: true })
|
|
239
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
244
240
|
@Field({ nullable: true })
|
|
245
241
|
caseDepth: number
|
|
246
242
|
|
|
247
243
|
//// To be removed ////
|
|
248
|
-
@Column('float', { nullable: true })
|
|
244
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
249
245
|
@Field({ nullable: true })
|
|
250
246
|
caseHeight: number
|
|
251
247
|
|
|
252
248
|
//// To be removed ////
|
|
253
|
-
@Column('float', { nullable: true })
|
|
249
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
254
250
|
@Field({ nullable: true })
|
|
255
251
|
caseVolume: number
|
|
256
252
|
|
|
@@ -265,7 +261,7 @@ export class Product {
|
|
|
265
261
|
primaryUnit: string
|
|
266
262
|
|
|
267
263
|
//// To be removed ////
|
|
268
|
-
@Column('float', { nullable: true })
|
|
264
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
269
265
|
@Field({ nullable: true })
|
|
270
266
|
primaryValue: number
|
|
271
267
|
|
|
@@ -325,7 +321,7 @@ export class Product {
|
|
|
325
321
|
bufferQty: number
|
|
326
322
|
|
|
327
323
|
//// To be removed ////
|
|
328
|
-
@Column('float', { nullable: true })
|
|
324
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
329
325
|
@Field({ nullable: true })
|
|
330
326
|
minQty: number
|
|
331
327
|
|
|
@@ -371,12 +367,7 @@ export class Product {
|
|
|
371
367
|
|
|
372
368
|
@Column({
|
|
373
369
|
nullable: false,
|
|
374
|
-
type:
|
|
375
|
-
DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
376
|
-
? 'enum'
|
|
377
|
-
: DATABASE_TYPE == 'oracle'
|
|
378
|
-
? 'varchar2'
|
|
379
|
-
: 'smallint',
|
|
370
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'enum' : DATABASE_TYPE == 'oracle' ? 'varchar2' : 'smallint',
|
|
380
371
|
enum: pickStrategy,
|
|
381
372
|
default: pickStrategy.FIFO
|
|
382
373
|
})
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { User } from '@things-factory/auth-base'
|
|
2
2
|
import { Bizplace } from '@things-factory/biz-base'
|
|
3
|
-
import { Domain } from '@things-factory/shell'
|
|
3
|
+
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
4
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'
|
|
5
|
+
import { Column, CreateDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
|
|
16
6
|
import { ProductBundleSetting } from '../product-bundle-setting/product-bundle-setting'
|
|
17
7
|
|
|
18
8
|
@Entity()
|
|
@@ -70,7 +60,7 @@ export class ProductBundle {
|
|
|
70
60
|
@Field()
|
|
71
61
|
packingType: string
|
|
72
62
|
|
|
73
|
-
@Column({ type: 'float', default: 1 })
|
|
63
|
+
@Column({ type: 'float', default: 1, transformer: roundTransformer })
|
|
74
64
|
@Field()
|
|
75
65
|
packingSize: number
|
|
76
66
|
|
|
@@ -2,7 +2,7 @@ import { Field, Float, ID, ObjectType } from 'type-graphql'
|
|
|
2
2
|
import { Column, CreateDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
|
|
3
3
|
|
|
4
4
|
import { User } from '@things-factory/auth-base'
|
|
5
|
-
import { Domain } from '@things-factory/shell'
|
|
5
|
+
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
6
6
|
|
|
7
7
|
import { ProductDetailBizplaceSetting } from '../product-detail-bizplace-setting/product-detail-bizplace-setting'
|
|
8
8
|
import { Product } from '../product/product'
|
|
@@ -61,11 +61,7 @@ import { Product } from '../product/product'
|
|
|
61
61
|
**/
|
|
62
62
|
|
|
63
63
|
@Entity()
|
|
64
|
-
@Index(
|
|
65
|
-
'ix_product_detail_0',
|
|
66
|
-
(productDetail: ProductDetail) => [productDetail.domain, productDetail.gtin, productDetail.product],
|
|
67
|
-
{ unique: true }
|
|
68
|
-
)
|
|
64
|
+
@Index('ix_product_detail_0', (productDetail: ProductDetail) => [productDetail.domain, productDetail.gtin, productDetail.product], { unique: true })
|
|
69
65
|
@Index('ix_product_detail_1', (productDetail: ProductDetail) => [productDetail.product])
|
|
70
66
|
@Index('ix_product_detail_2', (productDetail: ProductDetail) => [productDetail.domain, productDetail.refCode], {
|
|
71
67
|
unique: true
|
|
@@ -159,7 +155,7 @@ export class ProductDetail {
|
|
|
159
155
|
@Field()
|
|
160
156
|
packingType: string
|
|
161
157
|
|
|
162
|
-
@Column('float', { default: 1 })
|
|
158
|
+
@Column('float', { default: 1, transformer: roundTransformer })
|
|
163
159
|
@Field()
|
|
164
160
|
packingSize: number
|
|
165
161
|
|
|
@@ -171,7 +167,7 @@ export class ProductDetail {
|
|
|
171
167
|
@Field()
|
|
172
168
|
uom: string
|
|
173
169
|
|
|
174
|
-
@Column('float')
|
|
170
|
+
@Column('float', { transformer: roundTransformer })
|
|
175
171
|
@Field()
|
|
176
172
|
uomValue: number
|
|
177
173
|
|
|
@@ -183,15 +179,11 @@ export class ProductDetail {
|
|
|
183
179
|
@Field(type => [ProductDetail], { nullable: true })
|
|
184
180
|
parentProductDetails: ProductDetail[]
|
|
185
181
|
|
|
186
|
-
@OneToMany(
|
|
187
|
-
type => ProductDetailBizplaceSetting,
|
|
188
|
-
productDetailBizplaceSetting => productDetailBizplaceSetting.productDetail,
|
|
189
|
-
{ nullable: true }
|
|
190
|
-
)
|
|
182
|
+
@OneToMany(type => ProductDetailBizplaceSetting, productDetailBizplaceSetting => productDetailBizplaceSetting.productDetail, { nullable: true })
|
|
191
183
|
@Field(type => [ProductDetailBizplaceSetting], { nullable: true })
|
|
192
184
|
productDetailBizplaceSettings: ProductDetailBizplaceSetting[]
|
|
193
185
|
|
|
194
|
-
@Column('float', { nullable: true })
|
|
186
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
195
187
|
@Field({ nullable: true })
|
|
196
188
|
childQty: number
|
|
197
189
|
|
|
@@ -199,11 +191,11 @@ export class ProductDetail {
|
|
|
199
191
|
@Field({ nullable: true })
|
|
200
192
|
weightUnit: string
|
|
201
193
|
|
|
202
|
-
@Column('float', { nullable: true })
|
|
194
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
203
195
|
@Field({ nullable: true })
|
|
204
196
|
nettWeight: number
|
|
205
197
|
|
|
206
|
-
@Column('float', { nullable: true })
|
|
198
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
207
199
|
@Field({ nullable: true })
|
|
208
200
|
grossWeight: number
|
|
209
201
|
|
|
@@ -211,19 +203,19 @@ export class ProductDetail {
|
|
|
211
203
|
@Field({ nullable: true })
|
|
212
204
|
lengthUnit: string
|
|
213
205
|
|
|
214
|
-
@Column('float', { nullable: true })
|
|
206
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
215
207
|
@Field({ nullable: true })
|
|
216
208
|
width: number
|
|
217
209
|
|
|
218
|
-
@Column('float', { nullable: true })
|
|
210
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
219
211
|
@Field({ nullable: true })
|
|
220
212
|
depth: number
|
|
221
213
|
|
|
222
|
-
@Column('float', { nullable: true })
|
|
214
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
223
215
|
@Field({ nullable: true })
|
|
224
216
|
height: number
|
|
225
217
|
|
|
226
|
-
@Column('float', { nullable: true })
|
|
218
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
227
219
|
@Field({ nullable: true })
|
|
228
220
|
volume: number
|
|
229
221
|
|
|
@@ -231,7 +223,7 @@ export class ProductDetail {
|
|
|
231
223
|
@Field()
|
|
232
224
|
bufferQty: number
|
|
233
225
|
|
|
234
|
-
@Column('float', { default: 0 })
|
|
226
|
+
@Column('float', { default: 0, transformer: roundTransformer })
|
|
235
227
|
@Field()
|
|
236
228
|
minQty: number
|
|
237
229
|
|
|
@@ -305,27 +297,27 @@ export class ProductDetail {
|
|
|
305
297
|
discountId: number
|
|
306
298
|
|
|
307
299
|
//// For Accounting Integration ////
|
|
308
|
-
@Column('float', { nullable: true })
|
|
300
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
309
301
|
@Field({ nullable: true })
|
|
310
302
|
costPrice: number
|
|
311
303
|
|
|
312
304
|
//// For Accounting Integration ////
|
|
313
|
-
@Column('float', { nullable: true })
|
|
305
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
314
306
|
@Field({ nullable: true })
|
|
315
307
|
mrpPrice: number
|
|
316
308
|
|
|
317
309
|
//// For Accounting Integration ////
|
|
318
|
-
@Column('float', { nullable: true })
|
|
310
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
319
311
|
@Field({ nullable: true })
|
|
320
312
|
sellPrice: number
|
|
321
313
|
|
|
322
314
|
//// For Accounting Integration ////
|
|
323
|
-
@Column('float', { nullable: true })
|
|
315
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
324
316
|
@Field({ nullable: true })
|
|
325
317
|
afterTaxCostPrice: number
|
|
326
318
|
|
|
327
319
|
//// For Accounting Integration ////
|
|
328
|
-
@Column('float', { nullable: true })
|
|
320
|
+
@Column('float', { nullable: true, transformer: roundTransformer })
|
|
329
321
|
@Field({ nullable: true })
|
|
330
322
|
afterTaxSalesPrice: number
|
|
331
323
|
|
|
@@ -2,7 +2,7 @@ import { Field, ID, ObjectType } from 'type-graphql'
|
|
|
2
2
|
import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
|
|
3
3
|
|
|
4
4
|
import { User } from '@things-factory/auth-base'
|
|
5
|
-
import { Domain } from '@things-factory/shell'
|
|
5
|
+
import { Domain, roundTransformer } from '@things-factory/shell'
|
|
6
6
|
|
|
7
7
|
import { ProductDetail } from '../product-detail/product-detail'
|
|
8
8
|
|
|
@@ -24,10 +24,7 @@ import { ProductDetail } from '../product-detail/product-detail'
|
|
|
24
24
|
@Entity()
|
|
25
25
|
@Index(
|
|
26
26
|
'ix_product_detail_bizplace_setting_0',
|
|
27
|
-
(productDetailBizplaceSetting: ProductDetailBizplaceSetting) => [
|
|
28
|
-
productDetailBizplaceSetting.domain,
|
|
29
|
-
productDetailBizplaceSetting.productDetail
|
|
30
|
-
],
|
|
27
|
+
(productDetailBizplaceSetting: ProductDetailBizplaceSetting) => [productDetailBizplaceSetting.domain, productDetailBizplaceSetting.productDetail],
|
|
31
28
|
{ unique: true }
|
|
32
29
|
)
|
|
33
30
|
@ObjectType()
|
|
@@ -59,7 +56,7 @@ export class ProductDetailBizplaceSetting {
|
|
|
59
56
|
@Field()
|
|
60
57
|
bufferQty: number
|
|
61
58
|
|
|
62
|
-
@Column('float', { default: 0 })
|
|
59
|
+
@Column('float', { default: 0, transformer: roundTransformer })
|
|
63
60
|
@Field()
|
|
64
61
|
minQty: number
|
|
65
62
|
|