feat: add waitlist module, quick payment/transaction edit, and catering fee deduction from professor share
This commit is contained in:
@@ -104,6 +104,12 @@ const classSchema = new mongoose.Schema({
|
||||
default: 0,
|
||||
min: 0
|
||||
},
|
||||
/** Catering / service fee per person deducted from tuition before percentage payout */
|
||||
serviceFeePerPerson: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
min: 0
|
||||
},
|
||||
isActive: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
|
||||
@@ -32,7 +32,7 @@ const applyScheduleFields = (payload, body) => {
|
||||
return payload;
|
||||
};
|
||||
|
||||
const CLASS_LIST_FIELDS = 'name course professor students capacity tuitionFee hasDiscount discount freeSpots showOnFrontend startDate endDate days startTime endTime numberOfSessions payoutType payoutPercentage payoutHourlyRate extraExpensePerSession isActive isDeleted deletedAt adminNotes createdAt updatedAt';
|
||||
const CLASS_LIST_FIELDS = 'name course professor students capacity tuitionFee hasDiscount discount freeSpots showOnFrontend startDate endDate days startTime endTime numberOfSessions payoutType payoutPercentage payoutHourlyRate extraExpensePerSession serviceFeePerPerson isActive isDeleted deletedAt adminNotes createdAt updatedAt';
|
||||
|
||||
const normalizePricingFields = (body = {}) => {
|
||||
const tuitionFee = Math.max(0, Number(body.tuitionFee) || 0);
|
||||
@@ -48,7 +48,8 @@ const normalizePayoutFields = (body = {}) => {
|
||||
const payoutPercentage = Math.min(100, Math.max(0, Number(body.payoutPercentage) || 0));
|
||||
const payoutHourlyRate = Math.max(0, Number(body.payoutHourlyRate) || 0);
|
||||
const extraExpensePerSession = Math.max(0, Number(body.extraExpensePerSession) || 0);
|
||||
return { payoutType, payoutPercentage, payoutHourlyRate, extraExpensePerSession };
|
||||
const serviceFeePerPerson = Math.max(0, Number(body.serviceFeePerPerson) || 0);
|
||||
return { payoutType, payoutPercentage, payoutHourlyRate, extraExpensePerSession, serviceFeePerPerson };
|
||||
};
|
||||
|
||||
const normalizeNumberOfSessions = (value) => {
|
||||
|
||||
Reference in New Issue
Block a user