Matching UI with improved API

This commit is contained in:
2024-09-24 13:12:44 +02:00
parent bc62174566
commit abe1b496a2
34 changed files with 194 additions and 545 deletions

View File

@@ -1,9 +1,8 @@
import { BasketItemModel } from "@/data/models/basketItemModel";
import { CategoryModel } from "@/data/models/categoryModel";
import { ProductModel } from "@/data/models/productModel";
import { ProductWithCategoryModel } from "@/data/models/productWithCategoryModel";
export function calcProductPrice(product: ProductWithCategoryModel, quantity: number = 1): number {
export function calcProductPrice(product: ProductModel, quantity: number = 1): number {
return calcPrice(product.price, product.discount, quantity)
}
@@ -29,7 +28,7 @@ export function calcPrice(price: number, discount: number = 0, quantity: number
*
* @returns BasketItemModel
*/
export function productToBasketItem(product: ProductWithCategoryModel, quantity: number): BasketItemModel {
export function productToBasketItem(product: ProductModel, quantity: number): BasketItemModel {
let result = new BasketItemModel()
result.productId = product.id