Files
barker/bookie/src/app/sales/bills/inventory.ts
Amritanshu 8957e4ce8c All voucher routes now work with bundles.
Need to check / update all reports and prints
2026-02-05 00:46:49 +00:00

44 lines
1.0 KiB
TypeScript

import { Modifier } from '../../core/modifier';
import { ProductQuery } from '../../core/product-query';
import { Tax } from '../../core/tax';
export class Inventory {
id: string | undefined;
clientId: string | undefined;
sku: ProductQuery;
quantity: number;
price: number;
isHappyHour: boolean;
type: 'regular' | 'bundle' | 'bundle_item';
parentId?: string;
tax: Tax;
taxRate: number;
discount: number;
modifiers: Modifier[];
sortOrder: number;
children: Inventory[];
public get stableId(): string | undefined {
return this.id ?? this.clientId;
}
public constructor(init?: Partial<Inventory>) {
this.id = undefined;
if (!this.id) {
this.clientId = crypto.randomUUID();
}
this.sku = new ProductQuery();
this.quantity = 0;
this.price = 0;
this.isHappyHour = false;
this.type = 'regular';
this.taxRate = 0;
this.tax = new Tax();
this.discount = 0;
this.modifiers = [];
this.sortOrder = 0;
this.children = [];
Object.assign(this, init);
}
}