feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
44
backend/dataconnect/example/staffAvailability/mutations.gql
Normal file
44
backend/dataconnect/example/staffAvailability/mutations.gql
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
mutation createStaffAvailability(
|
||||
$staffId: UUID!
|
||||
$day: DayOfWeek!
|
||||
$slot: AvailabilitySlot!
|
||||
$status: AvailabilityStatus
|
||||
$notes: String
|
||||
) @auth(level: USER) {
|
||||
staffAvailability_insert(
|
||||
data: {
|
||||
staffId: $staffId
|
||||
day: $day
|
||||
slot: $slot
|
||||
status: $status
|
||||
notes: $notes
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateStaffAvailability(
|
||||
$staffId: UUID!
|
||||
$day: DayOfWeek!
|
||||
$slot: AvailabilitySlot!
|
||||
$status: AvailabilityStatus
|
||||
$notes: String
|
||||
) @auth(level: USER) {
|
||||
staffAvailability_update(
|
||||
key: { staffId: $staffId, day: $day, slot: $slot }
|
||||
data: {
|
||||
status: $status
|
||||
notes: $notes
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteStaffAvailability(
|
||||
$staffId: UUID!
|
||||
$day: DayOfWeek!
|
||||
$slot: AvailabilitySlot!
|
||||
) @auth(level: USER) {
|
||||
staffAvailability_delete(
|
||||
key: { staffId: $staffId, day: $day, slot: $slot }
|
||||
)
|
||||
}
|
||||
87
backend/dataconnect/example/staffAvailability/queries.gql
Normal file
87
backend/dataconnect/example/staffAvailability/queries.gql
Normal file
@@ -0,0 +1,87 @@
|
||||
|
||||
query listStaffAvailabilities(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
staffAvailabilities(offset: $offset, limit: $limit) {
|
||||
id
|
||||
staffId
|
||||
day
|
||||
slot
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
staff { id fullName }
|
||||
}
|
||||
}
|
||||
|
||||
query listStaffAvailabilitiesByStaffId(
|
||||
$staffId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
staffAvailabilities(
|
||||
where: { staffId: { eq: $staffId } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
staffId
|
||||
day
|
||||
slot
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
staff { id fullName }
|
||||
}
|
||||
}
|
||||
|
||||
query getStaffAvailabilityByKey(
|
||||
$staffId: UUID!
|
||||
$day: DayOfWeek!
|
||||
$slot: AvailabilitySlot!
|
||||
) @auth(level: USER) {
|
||||
staffAvailability(key: { staffId: $staffId, day: $day, slot: $slot }) {
|
||||
id
|
||||
staffId
|
||||
day
|
||||
slot
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
staff { id fullName }
|
||||
}
|
||||
}
|
||||
|
||||
query listStaffAvailabilitiesByDay(
|
||||
$day: DayOfWeek!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
staffAvailabilities(
|
||||
where: { day: { eq: $day } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
staffId
|
||||
day
|
||||
slot
|
||||
status
|
||||
notes
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
staff { id fullName }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user