11 lines
267 B
TypeScript
11 lines
267 B
TypeScript
import { Discount } from "../../model";
|
|
|
|
|
|
export function findDiscountFactor(discount: Discount | null | undefined): number {
|
|
if (!discount) return 1;
|
|
|
|
if (discount.Layer === 1) return discount.Target.Products[0].Factor;
|
|
|
|
return discount.Target.Factor;
|
|
}
|