class FeeCalculator { static calculateRentalFees(baseAmount) { const platformFeeRate = 0.2; const stripeRate = 0.029; const stripeFixedFee = 0.3; const platformFee = baseAmount * platformFeeRate; const processingFee = baseAmount * stripeRate + stripeFixedFee; return { baseRentalAmount: parseFloat(baseAmount.toFixed(2)), platformFee: parseFloat(platformFee.toFixed(2)), processingFee: parseFloat(processingFee.toFixed(2)), totalChargedAmount: parseFloat((baseAmount + processingFee).toFixed(2)), payoutAmount: parseFloat((baseAmount - platformFee).toFixed(2)), }; } static formatFeesForDisplay(fees) { return { baseRental: `$${fees.baseRentalAmount.toFixed(2)}`, platformFee: `$${fees.platformFee.toFixed(2)} (20%)`, processingFee: `$${fees.processingFee.toFixed(2)} (2.9% + $0.30)`, totalCharge: `$${fees.totalChargedAmount.toFixed(2)}`, ownerPayout: `$${fees.payoutAmount.toFixed(2)}`, }; } } module.exports = FeeCalculator;