Skip to content

Commit 434e0b8

Browse files
committed
Refactor: Move license price calculation to new function
1 parent c7ef8f3 commit 434e0b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
export function tieredPricing(licenseAmount: number): number {
2+
const licensePrice = calculateLicensePrice(licenseAmount);
3+
4+
return licensePrice * licenseAmount;
5+
}
6+
7+
function calculateLicensePrice(licenseAmount: number): number {
28
let licensePrice = 299;
39
if (licenseAmount >= 3) {
410
licensePrice = 239;
@@ -7,5 +13,5 @@ export function tieredPricing(licenseAmount: number): number {
713
licensePrice = 219;
814
}
915

10-
return licensePrice * licenseAmount;
16+
return licensePrice;
1117
}

0 commit comments

Comments
 (0)