feat: add waitlist module, quick payment/transaction edit, and catering fee deduction from professor share
This commit is contained in:
@@ -52,6 +52,21 @@ describe('calculatePercentageShare (Model A)', () => {
|
||||
assert.equal(calculatePercentageShare({ payoutPercentage: 40, revenue: 10_000_000 }), 4_000_000);
|
||||
});
|
||||
|
||||
it('deducts serviceFeePerPerson * studentsCount from revenue before calculating percentage', () => {
|
||||
// 2 students with 10M tuition (revenue = 20M), serviceFeePerPerson = 400,000, 50% payout
|
||||
// Net revenue = 20M - (400,000 * 2) = 19,200,000
|
||||
// Professor share = 19,200,000 * 50% = 9,600,000
|
||||
assert.equal(
|
||||
calculatePercentageShare({
|
||||
payoutPercentage: 50,
|
||||
revenue: 20_000_000,
|
||||
serviceFeePerPerson: 400_000,
|
||||
studentsCount: 2
|
||||
}),
|
||||
9_600_000
|
||||
);
|
||||
});
|
||||
|
||||
it('clamps percentage above 100 and negative revenue to zero', () => {
|
||||
assert.equal(calculatePercentageShare({ payoutPercentage: 150, revenue: 1_000_000 }), 1_000_000);
|
||||
assert.equal(calculatePercentageShare({ payoutPercentage: 40, revenue: -500 }), 0);
|
||||
|
||||
Reference in New Issue
Block a user