43 lines
867 B
TypeScript
43 lines
867 B
TypeScript
import AppError from "../../errors/AppError";
|
|
import SchedulingNotify from "../../models/SchedulingNotify";
|
|
|
|
|
|
interface Request {
|
|
ticketId: string,
|
|
scheduleId: string,
|
|
cpf_cnpj: string,
|
|
schedulingDate: string,
|
|
reminder: string,
|
|
message: string,
|
|
status: string
|
|
}
|
|
|
|
|
|
const CreateSchedulingNotifyService = async (
|
|
{
|
|
ticketId,
|
|
scheduleId,
|
|
cpf_cnpj,
|
|
schedulingDate,
|
|
reminder,
|
|
message,
|
|
status
|
|
|
|
}: Request): Promise<SchedulingNotify> => {
|
|
|
|
const schedulingNotify = await SchedulingNotify.create(
|
|
{
|
|
ticketId,
|
|
scheduleId,
|
|
cpf_cnpj,
|
|
schedulingDate,
|
|
reminder,
|
|
message,
|
|
status
|
|
|
|
})
|
|
|
|
return schedulingNotify
|
|
}
|
|
|
|
export default CreateSchedulingNotifyService |