feat: add waitlist module, quick payment/transaction edit, and catering fee deduction from professor share

This commit is contained in:
2026-08-23 23:00:02 +03:30
parent e3b51a1629
commit 53fce86ad5
21 changed files with 609 additions and 16 deletions
+5 -2
View File
@@ -48,9 +48,12 @@ const resolveSessionDurationHours = (cls = {}) => {
/**
* Model A — percentage of class revenue.
* `revenue` is the amount the percentage should be applied to (e.g. actual received revenue).
* `serviceFeePerPerson` (catering / service expenses per student) is deducted first before calculating the professor share.
*/
const calculatePercentageShare = ({ payoutPercentage = 0, revenue = 0 } = {}) => {
return (toPercentage(payoutPercentage) / 100) * toNonNegativeNumber(revenue);
const calculatePercentageShare = ({ payoutPercentage = 0, revenue = 0, serviceFeePerPerson = 0, studentsCount = 0 } = {}) => {
const totalServiceFee = toNonNegativeNumber(serviceFeePerPerson) * toNonNegativeNumber(studentsCount);
const netRevenue = Math.max(0, toNonNegativeNumber(revenue) - totalServiceFee);
return (toPercentage(payoutPercentage) / 100) * netRevenue;
};
/**