view shits of ordes by date

This commit is contained in:
José Salazar
2026-01-23 20:43:18 -05:00
parent 5c159493dd
commit afba0e64df
20 changed files with 20246 additions and 18735 deletions

View File

@@ -302,3 +302,57 @@ query getApplicationsByStaffId(
}
}
#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 }
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 }
}
}

View File

@@ -293,3 +293,42 @@ query listShiftRolesByVendorId(
}
}
}
#orders view client
query listShiftRolesByBusinessAndDateRange(
$businessId: UUID!
$start: Timestamp!
$end: Timestamp!
$offset: Int
$limit: Int
) @auth(level: USER) {
shiftRoles(
where: {
shift: {
date: { ge: $start, le: $end }
order: { businessId: { eq: $businessId } }
}
}
offset: $offset
limit: $limit
orderBy: { createdAt: DESC }
) {
shiftId
roleId
count
assigned
hours
startTime
endTime
totalValue
role { id name }
shift {
id
date
location
locationAddress
title
order { id }
}
}
}