add: change implement enum and distribution
This commit is contained in:
@@ -6,11 +6,7 @@ import {
|
||||
} from 'typeorm';
|
||||
import { Product } from './product.entity';
|
||||
import { BaseModel } from '../../config/basemodel.entity';
|
||||
|
||||
enum Type {
|
||||
NORMAL,
|
||||
PROMO,
|
||||
}
|
||||
import { productType } from '../../helper/enum-list';
|
||||
|
||||
@Entity()
|
||||
export class ProductHistoryPrice extends BaseModel {
|
||||
@@ -30,5 +26,5 @@ export class ProductHistoryPrice extends BaseModel {
|
||||
endDate: Date;
|
||||
|
||||
@Column('text')
|
||||
type: Type;
|
||||
type: productType;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,7 @@ import { CreateProductDto } from '../product/dto/product/create-product.dto';
|
||||
import { ProductSubCategoriesService } from './product-sub-categories.service';
|
||||
import { UpdateProductDto } from './dto/product/update-product.dto';
|
||||
import { ProductHistoryPrice } from './entities/product-history-price.entity';
|
||||
|
||||
enum Type {
|
||||
NORMAL,
|
||||
PROMO,
|
||||
}
|
||||
import { productType } from '../helper/enum-list';
|
||||
|
||||
export class ProductService {
|
||||
constructor(
|
||||
@@ -36,7 +32,7 @@ export class ProductService {
|
||||
|
||||
await this.productHistoryPrice.insert({
|
||||
product: result.identifiers[0],
|
||||
type: Type.NORMAL,
|
||||
type: productType.NORMAL,
|
||||
startDate: new Date(),
|
||||
endDate: null,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user