Wire up the dataconnect-generated package for the web app and add a new `hub` field to invoice mutations and queries. Updates include: add package links in apps/web package and workspace config, adjust connector.yaml JavaScript SDK output/package paths, add `hub` to invoice create/update mutations and to invoice queries, remove many example dataconnect GraphQL files and the web README, and minor formatting/newline fixes (Makefile and several .gql files).
436 lines
6.2 KiB
GraphQL
436 lines
6.2 KiB
GraphQL
# ------------------------------------------------------------
|
|
# LIST ALL ORDERS
|
|
# ------------------------------------------------------------
|
|
query listOrders(
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(offset: $offset, limit: $limit) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# GET ORDER BY ID
|
|
# ------------------------------------------------------------
|
|
query getOrderById($id: UUID!) @auth(level: USER) {
|
|
order(id: $id) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# GET ORDERS BY BUSINESS
|
|
# ------------------------------------------------------------
|
|
query getOrdersByBusinessId(
|
|
$businessId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(
|
|
where: { businessId: { eq: $businessId } }
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# GET ORDERS BY VENDOR
|
|
# ------------------------------------------------------------
|
|
query getOrdersByVendorId(
|
|
$vendorId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(
|
|
where: { vendorId: { eq: $vendorId } }
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# GET ORDERS BY STATUS
|
|
# ------------------------------------------------------------
|
|
query getOrdersByStatus(
|
|
$status: OrderStatus!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(
|
|
where: { status: { eq: $status } }
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# GET ORDERS BY DATE RANGE
|
|
# ------------------------------------------------------------
|
|
query getOrdersByDateRange(
|
|
$start: Timestamp!
|
|
$end: Timestamp!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(
|
|
where: {
|
|
date: { ge: $start, le: $end }
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# GET RAPID ORDERS
|
|
# ------------------------------------------------------------
|
|
query getRapidOrders(
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(
|
|
where: { orderType: { eq: RAPID } }
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
eventName
|
|
|
|
vendorId
|
|
businessId
|
|
orderType
|
|
#location
|
|
status
|
|
date
|
|
startDate
|
|
endDate
|
|
duration
|
|
lunchBreak
|
|
total
|
|
assignedStaff
|
|
shifts
|
|
requested
|
|
recurringDays
|
|
permanentDays
|
|
poReference
|
|
detectedConflicts
|
|
notes
|
|
createdAt
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
#to validate if an hub has orders before delete
|
|
query listOrdersByBusinessAndTeamHub(
|
|
$businessId: UUID!
|
|
$teamHubId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
orders(
|
|
where: {
|
|
businessId: { eq: $businessId }
|
|
teamHubId: { eq: $teamHubId }
|
|
#status: {in: [ DRAFT POSTED FILLED PENDING FULLY_STAFFED PARTIAL_STAFFED ] }
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { createdAt: DESC }
|
|
) {
|
|
id
|
|
eventName
|
|
orderType
|
|
status
|
|
duration
|
|
|
|
businessId
|
|
vendorId
|
|
teamHubId
|
|
|
|
date
|
|
startDate
|
|
endDate
|
|
|
|
requested
|
|
total
|
|
notes
|
|
|
|
createdAt
|
|
updatedAt
|
|
createdBy
|
|
}
|
|
}
|