This repository was archived by the owner on Apr 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS SDK] In-person appointment - ID based details screen (#24386)
- Loading branch information
Showing
21 changed files
with
445 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
170 changes: 170 additions & 0 deletions
170
Sources/NablaScheduling/Data/GQL/Generated/GetAppointment.graphql.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
// @generated | ||
// This file was automatically generated and should not be edited. | ||
|
||
import Apollo | ||
import Foundation | ||
|
||
/// GQL namespace | ||
extension GQL { | ||
final class GetAppointmentQuery: GraphQLQuery { | ||
/// The raw GraphQL definition of this operation. | ||
let operationDefinition: String = | ||
""" | ||
query GetAppointment($id: UUID!) { | ||
appointment(id: $id) { | ||
__typename | ||
appointment { | ||
__typename | ||
...AppointmentFragment | ||
} | ||
} | ||
} | ||
""" | ||
|
||
let operationName: String = "GetAppointment" | ||
|
||
var queryDocument: String { | ||
var document: String = operationDefinition | ||
document.append("\n" + AppointmentFragment.fragmentDefinition) | ||
document.append("\n" + ProviderFragment.fragmentDefinition) | ||
document.append("\n" + UpcomingAppointmentFragment.fragmentDefinition) | ||
document.append("\n" + FinalizedAppointmentFragment.fragmentDefinition) | ||
document.append("\n" + LocationFragment.fragmentDefinition) | ||
document.append("\n" + AddressFragment.fragmentDefinition) | ||
document.append("\n" + LivekitRoomFragment.fragmentDefinition) | ||
document.append("\n" + LivekitRoomOpenStatusFragment.fragmentDefinition) | ||
document.append("\n" + LivekitRoomClosedStatusFragment.fragmentDefinition) | ||
return document | ||
} | ||
|
||
var id: GQL.UUID | ||
|
||
init(id: GQL.UUID) { | ||
self.id = id | ||
} | ||
|
||
var variables: GraphQLMap? { | ||
return ["id": id] | ||
} | ||
|
||
struct Data: GraphQLSelectionSet { | ||
static let possibleTypes: [String] = ["Query"] | ||
|
||
static var selections: [GraphQLSelection] { | ||
return [ | ||
GraphQLField("appointment", arguments: ["id": GraphQLVariable("id")], type: .nonNull(.object(Appointment.selections))), | ||
] | ||
} | ||
|
||
private(set) var resultMap: ResultMap | ||
|
||
init(unsafeResultMap: ResultMap) { | ||
self.resultMap = unsafeResultMap | ||
} | ||
|
||
init(appointment: Appointment) { | ||
self.init(unsafeResultMap: ["__typename": "Query", "appointment": appointment.resultMap]) | ||
} | ||
|
||
var appointment: Appointment { | ||
get { | ||
return Appointment(unsafeResultMap: resultMap["appointment"]! as! ResultMap) | ||
} | ||
set { | ||
resultMap.updateValue(newValue.resultMap, forKey: "appointment") | ||
} | ||
} | ||
|
||
struct Appointment: GraphQLSelectionSet { | ||
static let possibleTypes: [String] = ["AppointmentOutput"] | ||
|
||
static var selections: [GraphQLSelection] { | ||
return [ | ||
GraphQLField("__typename", type: .nonNull(.scalar(String.self))), | ||
GraphQLField("appointment", type: .nonNull(.object(Appointment.selections))), | ||
] | ||
} | ||
|
||
private(set) var resultMap: ResultMap | ||
|
||
init(unsafeResultMap: ResultMap) { | ||
self.resultMap = unsafeResultMap | ||
} | ||
|
||
init(appointment: Appointment) { | ||
self.init(unsafeResultMap: ["__typename": "AppointmentOutput", "appointment": appointment.resultMap]) | ||
} | ||
|
||
var __typename: String { | ||
get { | ||
return resultMap["__typename"]! as! String | ||
} | ||
set { | ||
resultMap.updateValue(newValue, forKey: "__typename") | ||
} | ||
} | ||
|
||
var appointment: Appointment { | ||
get { | ||
return Appointment(unsafeResultMap: resultMap["appointment"]! as! ResultMap) | ||
} | ||
set { | ||
resultMap.updateValue(newValue.resultMap, forKey: "appointment") | ||
} | ||
} | ||
|
||
struct Appointment: GraphQLSelectionSet { | ||
static let possibleTypes: [String] = ["Appointment"] | ||
|
||
static var selections: [GraphQLSelection] { | ||
return [ | ||
GraphQLField("__typename", type: .nonNull(.scalar(String.self))), | ||
GraphQLFragmentSpread(AppointmentFragment.self), | ||
] | ||
} | ||
|
||
private(set) var resultMap: ResultMap | ||
|
||
init(unsafeResultMap: ResultMap) { | ||
self.resultMap = unsafeResultMap | ||
} | ||
|
||
var __typename: String { | ||
get { | ||
return resultMap["__typename"]! as! String | ||
} | ||
set { | ||
resultMap.updateValue(newValue, forKey: "__typename") | ||
} | ||
} | ||
|
||
var fragments: Fragments { | ||
get { | ||
return Fragments(unsafeResultMap: resultMap) | ||
} | ||
set { | ||
resultMap += newValue.resultMap | ||
} | ||
} | ||
|
||
struct Fragments { | ||
private(set) var resultMap: ResultMap | ||
|
||
init(unsafeResultMap: ResultMap) { | ||
self.resultMap = unsafeResultMap | ||
} | ||
|
||
var appointmentFragment: AppointmentFragment { | ||
get { | ||
return AppointmentFragment(unsafeResultMap: resultMap) | ||
} | ||
set { | ||
resultMap += newValue.resultMap | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Sources/NablaScheduling/Data/GQL/Schema/Queries/GetAppointment.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
query GetAppointment($id: UUID!) { | ||
appointment(id: $id) { | ||
appointment { | ||
...AppointmentFragment | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Sources/NablaScheduling/Domain/Interactors/WatchAppointment/WatchAppointmentInteractor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Combine | ||
import Foundation | ||
import NablaCore | ||
|
||
protocol WatchAppointmentInteractor { | ||
func execute(id: UUID) -> AnyPublisher<Appointment, NablaError> | ||
} |
23 changes: 23 additions & 0 deletions
23
.../NablaScheduling/Domain/Interactors/WatchAppointment/WatchAppointmentInteractorImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Combine | ||
import Foundation | ||
import NablaCore | ||
|
||
final class WatchAppointmentInteractorImpl: WatchAppointmentInteractor { | ||
// MARK: - Internal | ||
|
||
func execute(id: UUID) -> AnyPublisher<Appointment, NablaError> { | ||
repository.watchAppointment(withId: id) | ||
} | ||
|
||
// MARK: Init | ||
|
||
init( | ||
repository: AppointmentRepository | ||
) { | ||
self.repository = repository | ||
} | ||
|
||
// MARK: - Private | ||
|
||
private let repository: AppointmentRepository | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.