feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
48
backend/dataconnect/example/vendorBenefitPlan/mutations.gql
Normal file
48
backend/dataconnect/example/vendorBenefitPlan/mutations.gql
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
mutation createVendorBenefitPlan(
|
||||
$vendorId: UUID!
|
||||
$title: String!
|
||||
$description: String
|
||||
$requestLabel: String
|
||||
$total: Int
|
||||
$isActive: Boolean
|
||||
$createdBy: String
|
||||
) @auth(level: USER) {
|
||||
vendorBenefitPlan_insert(
|
||||
data: {
|
||||
vendorId: $vendorId
|
||||
title: $title
|
||||
description: $description
|
||||
requestLabel: $requestLabel
|
||||
total: $total
|
||||
isActive: $isActive
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateVendorBenefitPlan(
|
||||
$id: UUID!
|
||||
$vendorId: UUID
|
||||
$title: String
|
||||
$description: String
|
||||
$requestLabel: String
|
||||
$total: Int
|
||||
$isActive: Boolean
|
||||
$createdBy: String
|
||||
) @auth(level: USER) {
|
||||
vendorBenefitPlan_update(
|
||||
id: $id
|
||||
data: {
|
||||
vendorId: $vendorId
|
||||
title: $title
|
||||
description: $description
|
||||
requestLabel: $requestLabel
|
||||
total: $total
|
||||
isActive: $isActive
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteVendorBenefitPlan($id: UUID!) @auth(level: USER) {
|
||||
vendorBenefitPlan_delete(id: $id)
|
||||
}
|
||||
149
backend/dataconnect/example/vendorBenefitPlan/queries.gql
Normal file
149
backend/dataconnect/example/vendorBenefitPlan/queries.gql
Normal file
@@ -0,0 +1,149 @@
|
||||
# ----------------------------------------------------------
|
||||
# LIST ALL (admin/debug)
|
||||
# ----------------------------------------------------------
|
||||
query listVendorBenefitPlans(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
vendorBenefitPlans(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
vendorId
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
total
|
||||
isActive
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
vendor {
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# GET BY ID
|
||||
# ----------------------------------------------------------
|
||||
query getVendorBenefitPlanById($id: UUID!) @auth(level: USER) {
|
||||
vendorBenefitPlan(id: $id) {
|
||||
id
|
||||
vendorId
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
total
|
||||
isActive
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
vendor {
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST BY VENDOR
|
||||
# ----------------------------------------------------------
|
||||
query listVendorBenefitPlansByVendorId(
|
||||
$vendorId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
vendorBenefitPlans(
|
||||
where: { vendorId: { eq: $vendorId } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
vendorId
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
total
|
||||
isActive
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
vendor {
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST ACTIVE PLANS BY VENDOR
|
||||
# ----------------------------------------------------------
|
||||
query listActiveVendorBenefitPlansByVendorId(
|
||||
$vendorId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
vendorBenefitPlans(
|
||||
where: {
|
||||
vendorId: { eq: $vendorId }
|
||||
isActive: { eq: true }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
vendorId
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
total
|
||||
isActive
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
vendor {
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# FILTER (vendorId + title + isActive)
|
||||
# - Useful for "does this plan already exist?"
|
||||
# ----------------------------------------------------------
|
||||
query filterVendorBenefitPlans(
|
||||
$vendorId: UUID
|
||||
$title: String
|
||||
$isActive: Boolean
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
vendorBenefitPlans(
|
||||
where: {
|
||||
vendorId: { eq: $vendorId }
|
||||
title: { eq: $title }
|
||||
isActive: { eq: $isActive }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
vendorId
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
total
|
||||
isActive
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
vendor {
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user