Hide prices until admin sends the invoice, enforce status transitions, add customer/admin SMS+in-app notifications, schedule cash invoice reminders, and ship updated dist/prisma-client/deploy-bundle for git-pull deploys. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
1.1 KiB
TypeScript
23 lines
1.1 KiB
TypeScript
import { NotificationTone, OrderStatus } from '@prisma/client';
|
|
export type CustomerEvent = 'order_submitted' | 'invoice_priced' | 'checks_approved' | 'checks_need_fix' | 'receipt_approved' | 'receipt_rejected' | 'cash_invoice_reminder' | 'cash_invoice_expired' | 'order_preparing' | 'order_ready_to_ship' | 'order_shipped' | 'order_delivered' | 'order_cancelled';
|
|
type SmsSwitch = 'smsOrderRegistered' | 'smsPricingReady' | 'smsPaymentReminder' | 'smsCheckReview' | 'smsShippingUpdate' | null;
|
|
export type CustomerEventTemplate = {
|
|
title: string;
|
|
body: (ctx: EventContext) => string;
|
|
sms?: (ctx: EventContext) => string;
|
|
tone: NotificationTone;
|
|
smsSwitch: SmsSwitch;
|
|
};
|
|
export type EventContext = {
|
|
orderNumber: string;
|
|
appName: string;
|
|
amount?: number | null;
|
|
note?: string | null;
|
|
deadline?: string | null;
|
|
carrier?: string | null;
|
|
trackingNumber?: string | null;
|
|
};
|
|
export declare function eventForStatus(status: OrderStatus): CustomerEvent | null;
|
|
export declare const CUSTOMER_EVENTS: Record<CustomerEvent, CustomerEventTemplate>;
|
|
export {};
|