2022-02-28 13:51:11 +00:00
|
|
|
import AppError from "../../errors/AppError";
|
|
|
|
import SchedulingNotify from "../../models/SchedulingNotify";
|
|
|
|
|
2022-02-28 18:17:36 +00:00
|
|
|
|
2022-02-28 13:51:11 +00:00
|
|
|
interface Request {
|
2022-02-28 18:17:36 +00:00
|
|
|
ticketId: string,
|
2022-03-06 19:37:09 +00:00
|
|
|
scheduleId: string,
|
|
|
|
schedulingDate: string,
|
2022-03-12 05:13:15 +00:00
|
|
|
schedulingTime: string,
|
2022-03-06 19:37:09 +00:00
|
|
|
message: string
|
2022-02-28 18:17:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const CreateSchedulingNotifyService = async (
|
|
|
|
{
|
|
|
|
ticketId,
|
2022-03-06 19:37:09 +00:00
|
|
|
scheduleId,
|
|
|
|
schedulingDate,
|
2022-03-12 05:13:15 +00:00
|
|
|
schedulingTime,
|
2022-03-06 19:37:09 +00:00
|
|
|
message
|
2022-02-28 18:17:36 +00:00
|
|
|
|
|
|
|
}: Request): Promise<SchedulingNotify> => {
|
2022-02-28 13:51:11 +00:00
|
|
|
|
|
|
|
const schedulingNotify = await SchedulingNotify.create(
|
|
|
|
{
|
|
|
|
ticketId,
|
2022-03-06 19:37:09 +00:00
|
|
|
scheduleId,
|
|
|
|
schedulingDate,
|
2022-03-12 05:13:15 +00:00
|
|
|
schedulingTime,
|
2022-03-06 19:37:09 +00:00
|
|
|
message
|
2022-02-28 18:17:36 +00:00
|
|
|
|
|
|
|
})
|
2022-02-28 13:51:11 +00:00
|
|
|
|
|
|
|
return schedulingNotify
|
|
|
|
}
|
|
|
|
|
|
|
|
export default CreateSchedulingNotifyService
|