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

29 lines
730 B
TypeScript
Raw Normal View History

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