feat: add domain models

This commit is contained in:
2026-01-17 14:58:39 -03:00
parent ab2aca1d97
commit 90233c7208
5 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { Establishment } from './Establishment';
import { Product } from './Product';
export class Purchase {
#price: number;
constructor(
public establishment: Establishment,
public product: Product,
price = 0,
public quantity = 1,
public date = Date.now(),
public id?: number
) {
this.#price = price * 100;
}
get price() {
return this.#price / 100;
}
set price(price: number) {
this.#price = price * 100;
}
}