feat(sms): send class start date, days, and course time
Expose schedule fields on class and invoice templates so SMS can include Jalali start date, weekdays, and hour range.
This commit is contained in:
@@ -58,4 +58,15 @@ describe('SMS template variables', () => {
|
||||
assert.deepEqual(merged.variables.map((item) => item.slot), ['amount', 'fullName', 'course']);
|
||||
assert.deepEqual(merged.variables.map((item) => item.name), ['PAYMENT_PRICE', 'FULLNAME', 'COURSE']);
|
||||
});
|
||||
|
||||
it('exposes class start date, class days, and course time slots', () => {
|
||||
const expected = ['classStartDate', 'classDays', 'courseTime'];
|
||||
for (const key of ['classRegistered', 'classReminder', 'invoiceCreated']) {
|
||||
const def = SMS_TEMPLATE_DEFS.find((item) => item.key === key);
|
||||
const slots = (def?.slots || []).map((slot) => slot.key);
|
||||
for (const slot of expected) {
|
||||
assert.ok(slots.includes(slot), `${key} is missing slot ${slot}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user