27 lines
621 B
TypeScript
27 lines
621 B
TypeScript
import { Alerta } from "@prisma/client";
|
|
|
|
export class NotificacaoService {
|
|
async enviarNotificacao(
|
|
usuarioId: string,
|
|
tipo: string,
|
|
mensagem: string,
|
|
): Promise<void> {
|
|
// Implementar push notifications (ex: usando Firebase Cloud Messaging)
|
|
await this.salvarAlerta({
|
|
usuarioId,
|
|
tipo,
|
|
mensagem,
|
|
dataAlerta: new Date(),
|
|
});
|
|
}
|
|
|
|
private async salvarAlerta(dados: Partial<Alerta>): Promise<Alerta> {
|
|
// Implementar salvamento no banco
|
|
return null as any;
|
|
}
|
|
|
|
async verificarPrazos(): Promise<void> {
|
|
// Verificar prazos próximos e enviar alertas
|
|
}
|
|
}
|