fix: Issue 523, 536 to delete duplicate queries and create cost center schema and queries
This commit is contained in:
@@ -1,38 +1,3 @@
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# 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)
|
||||
# ----------------------------------------------------------
|
||||
@@ -109,16 +74,9 @@ query listBenefitsDataByStaffId(
|
||||
id
|
||||
vendorBenefitPlanId
|
||||
current
|
||||
staffId
|
||||
|
||||
staff {
|
||||
id
|
||||
fullName
|
||||
}
|
||||
|
||||
vendorBenefitPlan {
|
||||
id
|
||||
vendorId
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
@@ -196,4 +154,4 @@ query listBenefitsDataByVendorBenefitPlanIds(
|
||||
isActive
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user