projeto-hit/backend/src/services/SchedulingNotifyServices/CreateSchedulingNotifyServi...

41 lines
838 B
TypeScript
Raw Normal View History

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