fix(notifications): accept Prisma Decimal in order email payloads
Deploy Canina / deploy (push) Successful in 5m30s
Deploy Canina / deploy (push) Successful in 5m30s
Widen totalAmount typing so wallet/order/payment Prisma models type-check under tsc -b.
This commit is contained in:
1 parent
625c3f5ce2
commit
4d41a5bbf7
1 file changed
+2
-2
@@ -42,7 +42,7 @@ export class TransactionalEmailsService {
|
||||
await this.sendSafe(to, subject, text, html);
|
||||
}
|
||||
|
||||
async sendOrderCreated(to: string | null | undefined, order: { id?: string; trackingNumber?: string | null; totalAmount?: number | string | null }) {
|
||||
async sendOrderCreated(to: string | null | undefined, order: { id?: string; trackingNumber?: string | null; totalAmount?: number | string | { toString(): string } | null }) {
|
||||
if (!to) return;
|
||||
const orderRef = escapeHtml(String(order.trackingNumber || order.id || ''));
|
||||
const amount = Number(order.totalAmount || 0);
|
||||
@@ -55,7 +55,7 @@ export class TransactionalEmailsService {
|
||||
await this.sendSafe(to, subject, text, html);
|
||||
}
|
||||
|
||||
async sendOrderPaid(to: string | null | undefined, order: { id?: string; trackingNumber?: string | null; totalAmount?: number | string | null }) {
|
||||
async sendOrderPaid(to: string | null | undefined, order: { id?: string; trackingNumber?: string | null; totalAmount?: number | string | { toString(): string } | null }) {
|
||||
if (!to) return;
|
||||
const orderRef = escapeHtml(String(order.trackingNumber || order.id || ''));
|
||||
const amount = Number(order.totalAmount || 0);
|
||||
|
||||
Reference in new issue
Block a user