Files
alrahma_sunday_school_api/apps/api/dist/modules/reservations/reservation.pricing.service.js
T
2026-06-11 03:22:12 -04:00

23 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyPricingRules = void 0;
exports.calculateUpdatedInsuranceCharge = calculateUpdatedInsuranceCharge;
exports.calculateUpdatedAdditionalDriverCharge = calculateUpdatedAdditionalDriverCharge;
var pricingRuleService_1 = require("../../services/pricingRuleService");
Object.defineProperty(exports, "applyPricingRules", { enumerable: true, get: function () { return pricingRuleService_1.applyPricingRules; } });
function calculateUpdatedInsuranceCharge(chargeType, chargeValue, totalDays, baseRentalAmount) {
switch (chargeType) {
case 'PER_DAY': return chargeValue * totalDays;
case 'PER_RENTAL': return chargeValue;
case 'PERCENTAGE_OF_RENTAL': return Math.round(baseRentalAmount * chargeValue / 100);
default: return 0;
}
}
function calculateUpdatedAdditionalDriverCharge(chargeType, chargeValue, totalDays) {
switch (chargeType) {
case 'PER_DAY': return chargeValue * totalDays;
case 'FLAT': return chargeValue;
default: return 0;
}
}
//# sourceMappingURL=reservation.pricing.service.js.map