| | |
| | | import { http } from "./httpClient"; |
| | | |
| | | import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model"; |
| | | import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, ToCloseAppointment, ToDoneAppointment, updatedMemoInfo } from "~/shared/models/appointment.model"; |
| | | |
| | | class AppointmentService { |
| | | |
| | |
| | | } |
| | | |
| | | // 新增註記 |
| | | createMemo(memoInfo: createdMemoInfo): Promise<AppointmentMemoInfo> { |
| | | async createMemo(memoInfo: createdMemoInfo): Promise<AppointmentMemoInfo> { |
| | | return http.post('/appointment/memo/create', memoInfo).then(res => res.data); |
| | | } |
| | | |
| | | // 編輯註記 |
| | | updateMemo(memoInfo: updatedMemoInfo): Promise<AppointmentMemoInfo> { |
| | | async updateMemo(memoInfo: updatedMemoInfo): Promise<AppointmentMemoInfo> { |
| | | return http.post('/appointment/memo/update', memoInfo).then(res => res.data); |
| | | } |
| | | |
| | |
| | | deleteMemo(appointmentMemoId: number) { |
| | | return http.delete(`/appointment/memo/${appointmentMemoId}`) |
| | | } |
| | | |
| | | // 預約單結案 |
| | | async closeAppointment(appointmentInfo: ToDoneAppointment | ToCloseAppointment) { |
| | | return http.post(`/appointment/close`, appointmentInfo).then((res) => res.data); |
| | | } |
| | | } |
| | | |
| | | export default new AppointmentService(); |