merge with dev
This commit is contained in:
3
apps/mobile/devtools_options.yaml
Normal file
3
apps/mobile/devtools_options.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
description: This file stores settings for Dart & Flutter DevTools.
|
||||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||
extensions:
|
||||
@@ -1,37 +1,29 @@
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# CREATE COST CENTER
|
||||
# ----------------------------------------------------------
|
||||
mutation createCostCenter(
|
||||
$name: String!
|
||||
$createdBy: String
|
||||
) @auth(level: USER) {
|
||||
$businessId: UUID!
|
||||
) @auth(level: USER) {
|
||||
costCenter_insert(
|
||||
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
|
||||
id: $id,
|
||||
data: {
|
||||
name: $name
|
||||
businessId: $businessId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# DELETE COST CENTER
|
||||
# ----------------------------------------------------------
|
||||
mutation deleteCostCenter($id: UUID!) @auth(level: USER) {
|
||||
costCenter_delete(id: $id)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
mutation createTeamHub(
|
||||
$teamId: UUID!
|
||||
$costCenterId: UUID
|
||||
$hubName: String!
|
||||
$address: String!
|
||||
|
||||
@@ -20,6 +21,7 @@ mutation createTeamHub(
|
||||
teamHub_insert(
|
||||
data: {
|
||||
teamId: $teamId
|
||||
costCenterId: $costCenterId
|
||||
hubName: $hubName
|
||||
address: $address
|
||||
|
||||
@@ -45,6 +47,7 @@ mutation updateTeamHub(
|
||||
$id: UUID!
|
||||
|
||||
$teamId: UUID
|
||||
$costCenterId: UUID
|
||||
$hubName: String
|
||||
$address: String
|
||||
|
||||
@@ -67,6 +70,7 @@ mutation updateTeamHub(
|
||||
id: $id
|
||||
data: {
|
||||
teamId: $teamId
|
||||
costCenterId: $costCenterId
|
||||
hubName: $hubName
|
||||
address: $address
|
||||
|
||||
@@ -91,3 +95,24 @@ mutation updateTeamHub(
|
||||
mutation deleteTeamHub($id: UUID!) @auth(level: USER) {
|
||||
teamHub_delete(id: $id)
|
||||
}
|
||||
|
||||
mutation assignCostCenterToTeamHub(
|
||||
$id: UUID!
|
||||
$costCenterId: UUID!
|
||||
) @auth(level: USER) {
|
||||
teamHub_update(
|
||||
id: $id
|
||||
data: {
|
||||
costCenterId: $costCenterId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation removeCostCenterFromTeamHub($id: UUID!) @auth(level: USER) {
|
||||
teamHub_update(
|
||||
id: $id
|
||||
data: {
|
||||
costCenterId: null
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ query listTeamHubs($offset: Int, $limit: Int) @auth(level: USER) {
|
||||
teamHubs(offset: $offset, limit: $limit, orderBy: { createdAt: DESC }) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
@@ -24,6 +25,11 @@ query listTeamHubs($offset: Int, $limit: Int) @auth(level: USER) {
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -32,6 +38,7 @@ query getTeamHubById($id: UUID!) @auth(level: USER) {
|
||||
teamHub(id: $id) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
@@ -48,6 +55,11 @@ query getTeamHubById($id: UUID!) @auth(level: USER) {
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -65,6 +77,7 @@ query getTeamHubsByTeamId(
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
@@ -81,6 +94,11 @@ query getTeamHubsByTeamId(
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -105,6 +123,7 @@ query listTeamHubsByOwnerId(
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
@@ -121,6 +140,11 @@ query listTeamHubsByOwnerId(
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
type CostCenter @table(name: "cost_centers") {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
name: String!
|
||||
businessId: UUID!
|
||||
|
||||
createdAt: Timestamp @default(expr: "request.time")
|
||||
updatedAt: Timestamp @default(expr: "request.time")
|
||||
createdBy: String
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
type Hub @table(name: "hubs") {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
name: String!
|
||||
locationName: String
|
||||
address: String
|
||||
nfcTagId: String
|
||||
ownerId: UUID!
|
||||
costCenterId: UUID
|
||||
costCenter: CostCenter @ref(fields: "costCenterId", references: "id")
|
||||
createdAt: Timestamp @default(expr: "request.time")
|
||||
updatedAt: Timestamp @default(expr: "request.time")
|
||||
createdBy: String
|
||||
}
|
||||
@@ -4,6 +4,9 @@ type TeamHub @table(name: "team_hubs") {
|
||||
teamId: UUID!
|
||||
team: Team! @ref(fields: "teamId", references: "id")
|
||||
|
||||
costCenterId: UUID
|
||||
costCenter: CostCenter @ref(fields: "costCenterId", references: "id")
|
||||
|
||||
hubName: String!
|
||||
|
||||
address: String!
|
||||
|
||||
Reference in New Issue
Block a user