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

37 lines
774 B
TypeScript
Raw Normal View History

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