Temporal Product Fixed.
This commit is contained in:
68
bookie/src/app/temporal-product/temporal-product.ts
Normal file
68
bookie/src/app/temporal-product/temporal-product.ts
Normal file
@ -0,0 +1,68 @@
|
||||
import { MenuCategory } from '../core/menu-category';
|
||||
import { SaleCategory } from '../core/sale-category';
|
||||
|
||||
export class Product {
|
||||
id: string | undefined;
|
||||
versionId?: string;
|
||||
name: string;
|
||||
fraction_units: string;
|
||||
saleCategory?: SaleCategory;
|
||||
sortOrder: number;
|
||||
|
||||
validFrom: string | null;
|
||||
validTill: string | null;
|
||||
|
||||
public constructor(init?: Partial<Product>) {
|
||||
this.id = undefined;
|
||||
this.name = '';
|
||||
this.fraction_units = '';
|
||||
this.sortOrder = 0;
|
||||
this.validFrom = null;
|
||||
this.validTill = null;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
export class StockKeepingUnit {
|
||||
id: string | undefined;
|
||||
versionId?: string;
|
||||
units: string;
|
||||
fraction: number;
|
||||
productYield: number;
|
||||
costPrice: number;
|
||||
salePrice: number;
|
||||
menuCategory?: MenuCategory;
|
||||
|
||||
sortOrder: number;
|
||||
|
||||
hasHappyHour: boolean;
|
||||
isNotAvailable: boolean;
|
||||
|
||||
validFrom: string | null;
|
||||
validTill: string | null;
|
||||
|
||||
public constructor(init?: Partial<StockKeepingUnit>) {
|
||||
this.units = '';
|
||||
this.fraction = 1;
|
||||
this.productYield = 1;
|
||||
this.costPrice = 0;
|
||||
this.salePrice = 0;
|
||||
this.sortOrder = 0;
|
||||
this.hasHappyHour = false;
|
||||
this.isNotAvailable = false;
|
||||
this.validFrom = null;
|
||||
this.validTill = null;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
export class TemporalProduct {
|
||||
products: Product[];
|
||||
skus: StockKeepingUnit[];
|
||||
|
||||
public constructor(init?: Partial<TemporalProduct>) {
|
||||
this.products = [];
|
||||
this.skus = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user