spending in home view working

This commit is contained in:
José Salazar
2026-01-27 15:00:25 -05:00
parent dbd4c2fdc8
commit 4cdbebf2c0
6 changed files with 17246 additions and 16776 deletions

View File

@@ -464,3 +464,63 @@ query listShiftRolesByBusinessAndDatesSummary(
role { id name }
}
}
# ------------------------------------------------------------
# BUSINESS: GET COMPLETED SHIFTS FOR A BUSINESS (via order.businessId)
# ------------------------------------------------------------
#for spending insights in home view
query getCompletedShiftsByBusinessId(
$businessId: UUID!
$dateFrom: Timestamp!
$dateTo: Timestamp!
$offset: Int
$limit: Int
) @auth(level: USER) {
shifts(
where: {
order: { businessId: { eq: $businessId } }
status: {in: [IN_PROGRESS, CONFIRMED, COMPLETED, OPEN]}
date: { ge: $dateFrom, le: $dateTo }
}
offset: $offset
limit: $limit
) {
id
#title
#orderId
date
startTime
endTime
hours
cost
#location
#locationAddress
#latitude
#longitude
#description
#status
workersNeeded
filled
#filledAt
#managers
#durationDays
createdAt
order {
#id
#eventName
status
#orderType
#businessId
#vendorId
#business { id businessName email contactName }
#vendor { id companyName }
}
}
}