Files
plates-server/src/push-notifications/interfaces/push-notification.interface.ts
2025-10-11 17:38:04 +08:00

65 lines
1.2 KiB
TypeScript

import { PushType } from '../enums/push-type.enum';
export interface PushNotificationRequest {
userIds: string[];
title: string;
body: string;
payload?: any;
pushType?: PushType;
priority?: number;
expiry?: number;
collapseId?: string;
}
export interface PushNotificationByTemplateRequest {
userIds: string[];
templateKey: string;
data: any;
payload?: any;
}
export interface PushResult {
userId: string;
deviceToken: string;
success: boolean;
error?: string;
apnsResponse?: any;
}
export interface BatchPushResult {
totalUsers: number;
totalTokens: number;
successCount: number;
failedCount: number;
results: PushResult[];
}
export interface RenderedTemplate {
title: string;
body: string;
payload?: any;
pushType: PushType;
priority: number;
}
export interface PushStats {
totalSent: number;
totalFailed: number;
successRate: number;
averageDeliveryTime: number;
errorBreakdown: Record<string, number>;
}
export interface QueryOptions {
limit?: number;
offset?: number;
startDate?: Date;
endDate?: Date;
status?: string;
messageType?: string;
}
export interface TimeRange {
startDate: Date;
endDate: Date;
}