11 lines
272 B
TypeScript
11 lines
272 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;
|
||
|
|
||
|
else return discount.Target.Factor;
|
||
|
}
|