79 lines
1.5 KiB
TypeScript
79 lines
1.5 KiB
TypeScript
import { ProductGroup } from './product-group';
|
|
|
|
export class StockKeepingUnit {
|
|
units: string;
|
|
fraction: number;
|
|
productYield: number;
|
|
costPrice: number;
|
|
salePrice: number;
|
|
|
|
public constructor(init?: Partial<StockKeepingUnit>) {
|
|
this.units = '';
|
|
this.fraction = 1;
|
|
this.productYield = 1;
|
|
this.costPrice = 0;
|
|
this.salePrice = 0;
|
|
Object.assign(this, init);
|
|
}
|
|
}
|
|
|
|
export class Product {
|
|
id: string | undefined;
|
|
code: number;
|
|
name: string;
|
|
description: string | undefined;
|
|
skus: StockKeepingUnit[];
|
|
fractionUnits: string | undefined;
|
|
|
|
isActive: boolean;
|
|
isFixture: boolean;
|
|
isPurchased: boolean;
|
|
isSold: boolean;
|
|
productGroup?: ProductGroup;
|
|
|
|
allergen: string;
|
|
protein: number;
|
|
carbohydrate: number;
|
|
totalSugar: number;
|
|
addedSugar: number;
|
|
totalFat: number;
|
|
saturatedFat: number;
|
|
transFat: number;
|
|
cholestrol: number;
|
|
sodium: number;
|
|
|
|
msnf: number;
|
|
otherSolids: number;
|
|
totalSolids: number;
|
|
water: number;
|
|
|
|
public constructor(init?: Partial<Product>) {
|
|
this.code = 0;
|
|
this.name = '';
|
|
this.skus = [];
|
|
|
|
this.isActive = true;
|
|
this.isFixture = false;
|
|
this.isPurchased = true;
|
|
this.isSold = false;
|
|
|
|
this.allergen = '';
|
|
this.protein = 0;
|
|
this.carbohydrate = 0;
|
|
this.totalSugar = 0;
|
|
this.addedSugar = 0;
|
|
this.totalFat = 0;
|
|
this.saturatedFat = 0;
|
|
this.transFat = 0;
|
|
this.cholestrol = 0;
|
|
this.sodium = 0;
|
|
|
|
this.msnf = 0;
|
|
this.otherSolids = 0;
|
|
this.totalSolids = 0;
|
|
this.water = 0;
|
|
|
|
Object.assign(this, init);
|
|
}
|
|
}
|