AppointmentService
public protocol AppointmentService
The AppointmentService provides access to a list of scheduled appointments with the logged in user, as well as functions to create appointments
-
An asynchronous call to fetch a list of the patients retail visits that have been scheduled.
Internally, this will filter the appointment based on status=requested
Declaration
Swift
func getRetailVisits(success: @escaping ([ScheduledVisit]) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
successA closure called when the call succeeds. A possibly empty array of
ScheduledVisitobjects is passed to the closure.failureA closure called when the call fails.
-
Returns a list of CancellationReason objects that will be used in
cancelRetailAppointmentcallDeclaration
Swift
func getCancelReasons(brandName: String, success: @escaping ([CancelReason]) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
successA closure called with a list of
CancelReasonobjectsfailureA closure called if any FailedReason errors are returned
-
Cancels an appointment
Declaration
Swift
func cancelRetailAppointment(visitId: String, cancelReason: CancelReason, success: @escaping () -> Void, failure: @escaping (FailedReason) -> Void)Parameters
visitIdThe visit id of the
ScheduledVisitto be cancelledcancelReasonReason for cancellation selected from the
CancelReasonobjects returned fromgetCancelReasons(brandName:success:failure:)successA closure called if the appointment is successfully cancelled
failureA closure called if any FailedReason errors are returned
-
getRetailVisits()AsynchronousAn asynchronous call to fetch a list of the patients retail visits that have been scheduled.
Internally, this will filter the appointment based on status=requested
Throws
FailedReasonNote
The return array may be emptyDeclaration
Swift
func getRetailVisits() async throws -> [ScheduledVisit]Return Value
An array of
ScheduledVisitobjects. -
getCancelReasons(brandName:Asynchronous) Returns a list of CancellationReason objects that will be used in
cancelRetailAppointmentcallThrows
FailedReasonDeclaration
Swift
func getCancelReasons(brandName: String) async throws -> [CancelReason]Return Value
An array of
CancelReasonobjects -
cancelRetailAppointment(visitId:AsynchronouscancelReason: ) Cancels an appointment
Throws
Throws:FailedReasonDeclaration
Swift
func cancelRetailAppointment(visitId: String, cancelReason: CancelReason) async throwsParameters
visitIdThe visit id of the
ScheduledVisitto be cancelledcancelReasonReason for cancellation selected from the
CancelReasonobjects returned fromgetCancelReasons(brandName:success:failure:)Return Value
Void - indicates the appointment is successfully cancelled
View on GitHub
Install in Dash