Files
fabric_trade_server/dist/notifications/notifications.service.d.ts
T

62 lines
1.9 KiB
TypeScript
Raw Normal View History

import { ConfigService } from '@nestjs/config';
import { NotificationTone } from '@prisma/client';
import { PrismaService } from '../prisma/prisma.service';
import { SmsService } from '../sms/sms.service';
import { type CustomerEvent } from './notification-events';
type NotifyOptions = {
amount?: number | null;
note?: string | null;
carrier?: string | null;
trackingNumber?: string | null;
};
export declare class NotificationsService {
private readonly prisma;
private readonly sms;
private readonly config;
private readonly logger;
constructor(prisma: PrismaService, sms: SmsService, config: ConfigService);
notifyOrderEvent(orderId: string, event: CustomerEvent, options?: NotifyOptions): Promise<void>;
dispatchOrderEvent(orderId: string, event: CustomerEvent, options?: NotifyOptions): void;
notifyAdmin(input: {
title: string;
body: string;
tone?: NotificationTone;
link?: string;
}): Promise<void>;
dispatchAdmin(input: {
title: string;
body: string;
tone?: NotificationTone;
link?: string;
}): void;
listForCustomer(customerId: string, limit?: number): Promise<{
id: string;
orderId: string | undefined;
event: string;
title: string;
body: string;
tone: import("@prisma/client").$Enums.NotificationTone;
link: string | undefined;
isRead: boolean;
sentAt: string;
}[]>;
unreadCount(customerId: string): Promise<{
count: number;
}>;
markRead(customerId: string, id: string): Promise<{
count: number;
}>;
markAllRead(customerId: string): Promise<{
count: number;
}>;
markAdminRead(id: string): Promise<{
ok: boolean;
}>;
markAllAdminRead(): Promise<{
ok: boolean;
}>;
private appName;
private isSmsEventEnabled;
}
export {};