feat:Update benfitsDate query to add retrieve worker benefits query

This commit is contained in:
dhinesh-m24
2026-02-24 12:36:17 +05:30
parent 5cc1c42dd0
commit 78ce0f6cda

View File

@@ -1,4 +1,38 @@
# ----------------------------------------------------------
# GET WORKER BENEFIT BALANCES (M4)
# Returns all active benefit plans with balance data for a given worker.
# Supports: Sick Leave (40h), Holidays (24h), Vacation (40h)
# Extensible: any future VendorBenefitPlan will appear automatically.
#
# Fields:
# vendorBenefitPlan.title → benefit type name
# vendorBenefitPlan.total → total entitlement (hours)
# current → used hours
# remaining = total - current → computed client-side
# ----------------------------------------------------------
query getWorkerBenefitBalances(
$staffId: UUID!
) @auth(level: USER) {
benefitsDatas(
where: {
staffId: { eq: $staffId }
}
) {
vendorBenefitPlanId
current
vendorBenefitPlan {
id
title
description
requestLabel
total
isActive
}
}
}
# ----------------------------------------------------------
# LIST ALL (admin/debug)
# ----------------------------------------------------------