archetecture security fix
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"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
|
||||
Reference in New Issue
Block a user