merge with dev

This commit is contained in:
José Salazar
2026-02-26 11:17:01 -05:00
parent f389b6de5b
commit 3cf791ddbf
8 changed files with 81 additions and 62 deletions

View File

@@ -1,37 +1,29 @@
# ----------------------------------------------------------
# CREATE COST CENTER
# ----------------------------------------------------------
mutation createCostCenter(
$name: String!
$createdBy: String
) @auth(level: USER) {
$businessId: UUID!
) @auth(level: USER) {
costCenter_insert(
data: {
data: {
name: $name
createdBy: $createdBy
businessId: $businessId
}
)
}
# ----------------------------------------------------------
# UPDATE COST CENTER
# ----------------------------------------------------------
mutation updateCostCenter(
$id: UUID!
$name: String
) @auth(level: USER) {
$businessId: UUID
) @auth(level: USER) {
costCenter_update(
id: $id
data: {
id: $id,
data: {
name: $name
businessId: $businessId
}
)
}
# ----------------------------------------------------------
# DELETE COST CENTER
# ----------------------------------------------------------
mutation deleteCostCenter($id: UUID!) @auth(level: USER) {
costCenter_delete(id: $id)
}

View File

@@ -1,47 +1,30 @@
# ----------------------------------------------------------
# LIST ALL COST CENTERS
# ----------------------------------------------------------
query listCostCenters(
$offset: Int
$limit: Int
) @auth(level: USER) {
costCenters(offset: $offset, limit: $limit) {
query listCostCenters @auth(level: USER) {
costCenters {
id
name
createdAt
updatedAt
createdBy
businessId
}
}
# ----------------------------------------------------------
# GET BY ID
# ----------------------------------------------------------
query getCostCenterById($id: UUID!) @auth(level: USER) {
costCenter(id: $id) {
id
name
createdAt
updatedAt
createdBy
businessId
}
}
# ----------------------------------------------------------
# GET COST CENTER LINKED TO A SPECIFIC HUB
# ----------------------------------------------------------
query getCostCenterByHubId($hubId: UUID!) @auth(level: USER) {
hubs(where: { id: { eq: $hubId } }) {
query filterCostCenters(
$name: String,
$businessId: UUID
) @auth(level: USER) {
costCenters(
where: {
name: { eq: $name },
businessId: { eq: $businessId }
}) {
id
name
costCenterId
costCenter {
id
name
createdAt
updatedAt
createdBy
}
businessId
}
}