fix: Assign hub manager to order
This commit is contained in:
@@ -98,3 +98,26 @@ mutation updateOrder(
|
||||
mutation deleteOrder($id: UUID!) @auth(level: USER) {
|
||||
order_delete(id: $id)
|
||||
}
|
||||
|
||||
mutation assignHubManagerToOrder(
|
||||
$orderId: UUID!
|
||||
$hubManagerId: UUID!
|
||||
) @auth(level: USER) {
|
||||
order_update(
|
||||
id: $orderId
|
||||
data: {
|
||||
hubManagerId: $hubManagerId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation removeHubManagerFromOrder(
|
||||
$orderId: UUID!
|
||||
) @auth(level: USER) {
|
||||
order_update(
|
||||
id: $orderId
|
||||
data: {
|
||||
hubManagerId: null
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -48,6 +48,18 @@ query listOrders(
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +110,18 @@ query getOrderById($id: UUID!) @auth(level: USER) {
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +180,18 @@ query getOrdersByBusinessId(
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +250,18 @@ query getOrdersByVendorId(
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,6 +320,18 @@ query getOrdersByStatus(
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,6 +393,18 @@ query getOrdersByDateRange(
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,6 +462,18 @@ query getRapidOrders(
|
||||
hubName
|
||||
}
|
||||
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,3 +612,27 @@ query listCompletedOrdersByBusinessAndDateRange(
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# GET HUB MANAGER ASSIGNED TO AN ORDER
|
||||
# ------------------------------------------------------------
|
||||
query getHubManagerByOrderId($orderId: UUID!) @auth(level: USER) {
|
||||
order(id: $orderId) {
|
||||
id
|
||||
hubManagerId
|
||||
hubManager {
|
||||
id
|
||||
role
|
||||
title
|
||||
department
|
||||
teamHubId
|
||||
isActive
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,3 +64,35 @@ query getTeamMembersByTeamId($teamId: UUID!) @auth(level: USER) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query getHubManagersByTeamHubId($teamHubId: UUID!) @auth(level: USER) {
|
||||
teamMembers(
|
||||
where: {
|
||||
teamHubId: { eq: $teamHubId }
|
||||
role: { eq: MANAGER }
|
||||
isActive: { eq: true }
|
||||
inviteStatus: { eq: ACCEPTED }
|
||||
}
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
role
|
||||
title
|
||||
department
|
||||
teamHubId
|
||||
isActive
|
||||
createdAt
|
||||
|
||||
user {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
photoUrl
|
||||
}
|
||||
|
||||
teamHub {
|
||||
id
|
||||
hubName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ type Order @table(name: "orders", key: ["id"]) {
|
||||
teamHubId: UUID!
|
||||
teamHub: TeamHub! @ref(fields: "teamHubId", references: "id")
|
||||
|
||||
hubManagerId: UUID
|
||||
hubManager: TeamMember @ref(fields: "hubManagerId", references: "id")
|
||||
|
||||
date: Timestamp
|
||||
|
||||
startDate: Timestamp #for recurring and permanent
|
||||
|
||||
Reference in New Issue
Block a user