feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
47
backend/dataconnect/example/application/mutations.gql
Normal file
47
backend/dataconnect/example/application/mutations.gql
Normal file
@@ -0,0 +1,47 @@
|
||||
mutation createApplication(
|
||||
$shiftId: UUID!
|
||||
$staffId: UUID!
|
||||
$status: ApplicationStatus!
|
||||
$checkInTime: Timestamp
|
||||
$checkOutTime: Timestamp
|
||||
$origin: ApplicationOrigin!
|
||||
$roleId: UUID!
|
||||
) @auth(level: USER) {
|
||||
application_insert(
|
||||
data: {
|
||||
shiftId: $shiftId
|
||||
staffId: $staffId
|
||||
status: $status
|
||||
checkInTime: $checkInTime
|
||||
checkOutTime: $checkOutTime
|
||||
origin: $origin
|
||||
roleId: $roleId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateApplicationStatus(
|
||||
$id: UUID!
|
||||
$shiftId: UUID
|
||||
$staffId: UUID
|
||||
$status: ApplicationStatus
|
||||
$checkInTime: Timestamp
|
||||
$checkOutTime: Timestamp
|
||||
$roleId: UUID!
|
||||
) @auth(level: USER) {
|
||||
application_update(
|
||||
id: $id
|
||||
data: {
|
||||
shiftId: $shiftId
|
||||
staffId: $staffId
|
||||
status: $status
|
||||
checkInTime: $checkInTime
|
||||
checkOutTime: $checkOutTime
|
||||
roleId: $roleId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteApplication($id: UUID!) @auth(level: USER) {
|
||||
application_delete(id: $id)
|
||||
}
|
||||
452
backend/dataconnect/example/application/queries.gql
Normal file
452
backend/dataconnect/example/application/queries.gql
Normal file
@@ -0,0 +1,452 @@
|
||||
query listApplications @auth(level: USER) {
|
||||
applications {
|
||||
id
|
||||
shiftId
|
||||
staffId
|
||||
status
|
||||
appliedAt
|
||||
checkInTime
|
||||
checkOutTime
|
||||
origin
|
||||
createdAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
location
|
||||
status
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
companyLogoUrl
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shiftRole {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#shifts in staff app
|
||||
query getApplicationById($id: UUID!) @auth(level: USER) {
|
||||
application(id: $id) {
|
||||
id
|
||||
shiftId
|
||||
staffId
|
||||
status
|
||||
appliedAt
|
||||
checkInTime
|
||||
checkOutTime
|
||||
origin
|
||||
createdAt
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
location
|
||||
status
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
companyLogoUrl
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shiftRole {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query getApplicationsByShiftId($shiftId: UUID!) @auth(level: USER) {
|
||||
applications(where: { shiftId: { eq: $shiftId } }) {
|
||||
id
|
||||
shiftId
|
||||
staffId
|
||||
status
|
||||
appliedAt
|
||||
checkInTime
|
||||
checkOutTime
|
||||
origin
|
||||
createdAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
location
|
||||
status
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shiftRole {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
query getApplicationsByShiftIdAndStatus(
|
||||
$shiftId: UUID!
|
||||
$status: ApplicationStatus!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
shiftId: { eq: $shiftId }
|
||||
status: { eq: $status }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
staffId
|
||||
status
|
||||
appliedAt
|
||||
checkInTime
|
||||
checkOutTime
|
||||
origin
|
||||
createdAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
location
|
||||
status
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shiftRole {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query getApplicationsByStaffId(
|
||||
$staffId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$dayStart: Timestamp
|
||||
$dayEnd: Timestamp
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
staffId: { eq: $staffId }
|
||||
shift: {
|
||||
date: { ge: $dayStart, le: $dayEnd }
|
||||
}
|
||||
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
staffId
|
||||
status
|
||||
appliedAt
|
||||
checkInTime
|
||||
checkOutTime
|
||||
origin
|
||||
createdAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
location
|
||||
status
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
companyLogoUrl
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shiftRole {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#getting staffs of an shiftrole ACCEPTED for orders view client
|
||||
query listAcceptedApplicationsByShiftRoleKey(
|
||||
$shiftId: UUID!
|
||||
$roleId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
shiftId: { eq: $shiftId }
|
||||
roleId: { eq: $roleId }
|
||||
status: { eq: ACCEPTED }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { appliedAt: ASC }
|
||||
) {
|
||||
id
|
||||
checkInTime
|
||||
checkOutTime
|
||||
staff { id fullName email phone photoUrl }
|
||||
}
|
||||
}
|
||||
|
||||
#getting staffs of an shiftrole ACCEPTED for orders of the day view client
|
||||
query listAcceptedApplicationsByBusinessForDay(
|
||||
$businessId: UUID!
|
||||
$dayStart: Timestamp!
|
||||
$dayEnd: Timestamp!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
#status: { eq: ACCEPTED }
|
||||
status: { in: [ACCEPTED, CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE] }
|
||||
shift: {
|
||||
date: { ge: $dayStart, le: $dayEnd }
|
||||
order: { businessId: { eq: $businessId } }
|
||||
}
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { appliedAt: ASC }
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
roleId
|
||||
checkInTime
|
||||
checkOutTime
|
||||
appliedAt
|
||||
staff { id fullName email phone photoUrl averageRating }
|
||||
}
|
||||
}
|
||||
|
||||
#coverage list and today live
|
||||
query listStaffsApplicationsByBusinessForDay(
|
||||
$businessId: UUID!
|
||||
$dayStart: Timestamp!
|
||||
$dayEnd: Timestamp!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
status: {in: [ACCEPTED, CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE]}
|
||||
shift: {
|
||||
date: { ge: $dayStart, le: $dayEnd }
|
||||
order: { businessId: { eq: $businessId } }
|
||||
#status: { eq: ACCEPTED }
|
||||
}
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { appliedAt: ASC }
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
roleId
|
||||
checkInTime
|
||||
checkOutTime
|
||||
appliedAt
|
||||
status
|
||||
|
||||
shiftRole{
|
||||
shift{
|
||||
location
|
||||
cost
|
||||
}
|
||||
count
|
||||
assigned
|
||||
hours
|
||||
|
||||
role{
|
||||
name
|
||||
}
|
||||
}
|
||||
staff { id fullName email phone photoUrl }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user