chore(legacy): relocate v1 dataconnect source
This commit is contained in:
118
legacy/dataconnect-v1/connector/teamHub/mutations.gql
Normal file
118
legacy/dataconnect-v1/connector/teamHub/mutations.gql
Normal file
@@ -0,0 +1,118 @@
|
||||
mutation createTeamHub(
|
||||
$teamId: UUID!
|
||||
$costCenterId: UUID
|
||||
$hubName: String!
|
||||
$address: String!
|
||||
|
||||
$placeId: String
|
||||
$latitude: Float
|
||||
$longitude: Float
|
||||
|
||||
$city: String
|
||||
$state: String
|
||||
$street: String
|
||||
$country: String
|
||||
$zipCode: String
|
||||
|
||||
$managerName: String
|
||||
$isActive: Boolean
|
||||
$departments: Any
|
||||
) @auth(level: USER) {
|
||||
teamHub_insert(
|
||||
data: {
|
||||
teamId: $teamId
|
||||
costCenterId: $costCenterId
|
||||
hubName: $hubName
|
||||
address: $address
|
||||
|
||||
placeId: $placeId
|
||||
latitude: $latitude
|
||||
longitude: $longitude
|
||||
|
||||
city: $city
|
||||
state: $state
|
||||
street: $street
|
||||
country: $country
|
||||
zipCode: $zipCode
|
||||
|
||||
managerName: $managerName
|
||||
isActive: $isActive
|
||||
departments: $departments
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateTeamHub(
|
||||
$id: UUID!
|
||||
|
||||
$teamId: UUID
|
||||
$costCenterId: UUID
|
||||
$hubName: String
|
||||
$address: String
|
||||
|
||||
$placeId: String
|
||||
$latitude: Float
|
||||
$longitude: Float
|
||||
|
||||
$city: String
|
||||
$state: String
|
||||
$street: String
|
||||
$country: String
|
||||
$zipCode: String
|
||||
|
||||
$managerName: String
|
||||
$isActive: Boolean
|
||||
$departments: Any
|
||||
|
||||
) @auth(level: USER) {
|
||||
teamHub_update(
|
||||
id: $id
|
||||
data: {
|
||||
teamId: $teamId
|
||||
costCenterId: $costCenterId
|
||||
hubName: $hubName
|
||||
address: $address
|
||||
|
||||
placeId: $placeId
|
||||
latitude: $latitude
|
||||
longitude: $longitude
|
||||
|
||||
city: $city
|
||||
state: $state
|
||||
street: $street
|
||||
country: $country
|
||||
zipCode: $zipCode
|
||||
|
||||
managerName: $managerName
|
||||
isActive: $isActive
|
||||
departments: $departments
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
)
|
||||
}
|
||||
150
legacy/dataconnect-v1/connector/teamHub/queries.gql
Normal file
150
legacy/dataconnect-v1/connector/teamHub/queries.gql
Normal file
@@ -0,0 +1,150 @@
|
||||
|
||||
# ==========================================================
|
||||
# TEAM HUB - QUERIES (USE where, NOT filter)
|
||||
# Include ALL fields in TeamHub
|
||||
# ==========================================================
|
||||
|
||||
query listTeamHubs($offset: Int, $limit: Int) @auth(level: USER) {
|
||||
teamHubs(offset: $offset, limit: $limit, orderBy: { createdAt: DESC }) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
placeId
|
||||
latitude
|
||||
longitude
|
||||
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
zipCode
|
||||
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
query getTeamHubById($id: UUID!) @auth(level: USER) {
|
||||
teamHub(id: $id) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
placeId
|
||||
latitude
|
||||
longitude
|
||||
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
zipCode
|
||||
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
query getTeamHubsByTeamId(
|
||||
$teamId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
teamHubs(
|
||||
where: { teamId: { eq: $teamId } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { createdAt: DESC }
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
placeId
|
||||
latitude
|
||||
longitude
|
||||
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
zipCode
|
||||
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST TEAM HUBS BY OWNER (Vendor/Business)
|
||||
# ------------------------------------------------------------
|
||||
query listTeamHubsByOwnerId(
|
||||
$ownerId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
teamHubs(
|
||||
where: {
|
||||
team: {
|
||||
ownerId: { eq: $ownerId }
|
||||
}
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { createdAt: DESC }
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
costCenterId
|
||||
hubName
|
||||
|
||||
address
|
||||
placeId
|
||||
latitude
|
||||
longitude
|
||||
|
||||
city
|
||||
state
|
||||
street
|
||||
country
|
||||
zipCode
|
||||
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
costCenter {
|
||||
id
|
||||
name
|
||||
businessId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user