feat: Integrate Data Connect and Implement Staff List View Directory

This commit is contained in:
dhinesh-m24
2026-01-31 16:54:59 +05:30
parent 48bb1c457c
commit cb25b33d04
255 changed files with 21425 additions and 109 deletions

View File

@@ -0,0 +1,36 @@
mutation createBenefitsData(
$vendorBenefitPlanId: UUID!
$staffId: UUID!
$current: Int!
) @auth(level: USER) {
benefitsData_insert(
data: {
vendorBenefitPlanId: $vendorBenefitPlanId
staffId: $staffId
current: $current
}
)
}
mutation updateBenefitsData(
$staffId: UUID!
$vendorBenefitPlanId: UUID!
$current: Int
) @auth(level: USER) {
benefitsData_update(
key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }
data: {
current: $current
}
)
}
mutation deleteBenefitsData(
$staffId: UUID!
$vendorBenefitPlanId: UUID!
) @auth(level: USER) {
benefitsData_delete(
key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }
)
}

View File

@@ -0,0 +1,165 @@
# ----------------------------------------------------------
# LIST ALL (admin/debug)
# ----------------------------------------------------------
query listBenefitsData(
$offset: Int
$limit: Int
) @auth(level: USER) {
benefitsDatas(offset: $offset, limit: $limit) {
id
vendorBenefitPlanId
current
staffId
staff {
id
fullName
}
vendorBenefitPlan {
id
vendorId
title
description
requestLabel
total
isActive
}
}
}
# ----------------------------------------------------------
# GET BY KEY (staffId + vendorBenefitPlanId) ✅ (replaces getById in practice)
# ----------------------------------------------------------
query getBenefitsDataByKey(
$staffId: UUID!
$vendorBenefitPlanId: UUID!
) @auth(level: USER) {
benefitsData(key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }) {
id
vendorBenefitPlanId
current
staffId
staff {
id
fullName
}
vendorBenefitPlan {
id
vendorId
title
description
requestLabel
total
isActive
}
}
}
# ----------------------------------------------------------
# LIST BY STAFF
# ----------------------------------------------------------
query listBenefitsDataByStaffId(
$staffId: UUID!
$offset: Int
$limit: Int
) @auth(level: USER) {
benefitsDatas(
where: { staffId: { eq: $staffId } }
offset: $offset
limit: $limit
) {
id
vendorBenefitPlanId
current
staffId
staff {
id
fullName
}
vendorBenefitPlan {
id
vendorId
title
description
requestLabel
total
isActive
}
}
}
# ----------------------------------------------------------
# LIST BY VENDOR BENEFIT PLAN
# ----------------------------------------------------------
query listBenefitsDataByVendorBenefitPlanId(
$vendorBenefitPlanId: UUID!
$offset: Int
$limit: Int
) @auth(level: USER) {
benefitsDatas(
where: { vendorBenefitPlanId: { eq: $vendorBenefitPlanId } }
offset: $offset
limit: $limit
) {
id
vendorBenefitPlanId
current
staffId
staff {
id
fullName
}
vendorBenefitPlan {
id
vendorId
title
description
requestLabel
total
isActive
}
}
}
# ----------------------------------------------------------
# LIST BY VENDOR (2-step helper: planIds -> benefitsDatas IN)
# ----------------------------------------------------------
query listBenefitsDataByVendorBenefitPlanIds(
$vendorBenefitPlanIds: [UUID!]!
$offset: Int
$limit: Int
) @auth(level: USER) {
benefitsDatas(
where: { vendorBenefitPlanId: { in: $vendorBenefitPlanIds } }
offset: $offset
limit: $limit
) {
id
vendorBenefitPlanId
current
staffId
staff {
id
fullName
}
vendorBenefitPlan {
id
vendorId
title
description
requestLabel
total
isActive
}
}
}