feat: add waitlist view, quick edit payment dialog, and catering fee in class views
This commit is contained in:
@@ -47,6 +47,19 @@ describe('calculateProfessorPayout', () => {
|
||||
assert.equal(result.totalPayout, 4_500_000);
|
||||
});
|
||||
|
||||
it('computes percentage-based payout deducting serviceFeePerPerson * studentsCount first', () => {
|
||||
const result = calculateProfessorPayout({
|
||||
payoutType: 'percentage',
|
||||
payoutPercentage: 50,
|
||||
revenue: 20_000_000,
|
||||
serviceFeePerPerson: 400_000,
|
||||
studentsCount: 2
|
||||
});
|
||||
// 20M - (400k * 2) = 19.2M * 50% = 9.6M
|
||||
assert.equal(result.baseShare, 9_600_000);
|
||||
assert.equal(result.totalPayout, 9_600_000);
|
||||
});
|
||||
|
||||
it('computes hourly-based payout with extra expenses', () => {
|
||||
const result = calculateProfessorPayout({
|
||||
payoutType: 'hourly',
|
||||
|
||||
Reference in New Issue
Block a user