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
success
A closure called when the call succeeds. A possibly empty array of
ScheduledVisit
objects is passed to the closure.failure
A closure called when the call fails.
-
Returns a list of CancellationReason objects that will be used in
cancelRetailAppointment
callDeclaration
Swift
func getCancelReasons(brandName: String, success: @escaping ([CancelReason]) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
success
A closure called with a list of
CancelReason
objectsfailure
A 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
visitId
The visit id of the
ScheduledVisit
to be cancelledcancelReason
Reason for cancellation selected from the
CancelReason
objects returned fromgetCancelReasons(brandName:success:failure:)
success
A closure called if the appointment is successfully cancelled
failure
A 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
ScheduledVisit
objects. -
getCancelReasons(brandName:
Asynchronous) Returns a list of CancellationReason objects that will be used in
cancelRetailAppointment
callThrows
FailedReason
Declaration
Swift
func getCancelReasons(brandName: String) async throws -> [CancelReason]
Return Value
An array of
CancelReason
objects -
cancelRetailAppointment(visitId:
AsynchronouscancelReason: ) Cancels an appointment
Throws
Throws:FailedReason
Declaration
Swift
func cancelRetailAppointment(visitId: String, cancelReason: CancelReason) async throws
Parameters
visitId
The visit id of the
ScheduledVisit
to be cancelledcancelReason
Reason for cancellation selected from the
CancelReason
objects returned fromgetCancelReasons(brandName:success:failure:)
Return Value
Void - indicates the appointment is successfully cancelled