modifications queries, mutations of contact, recentPayment, shiftRole, teamhub
This commit is contained in:
@@ -348,3 +348,70 @@ query listRecentPaymentsByInvoiceIds(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST BY BUSINESS ID (direct)
|
||||
# ------------------------------------------------------------
|
||||
query listRecentPaymentsByBusinessId(
|
||||
$businessId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
recentPayments(
|
||||
where: {
|
||||
invoice: {
|
||||
businessId: { eq: $businessId }
|
||||
}
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { createdAt: DESC }
|
||||
) {
|
||||
id
|
||||
workedTime
|
||||
status
|
||||
staffId
|
||||
applicationId
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
application {
|
||||
id
|
||||
staffId
|
||||
checkInTime
|
||||
checkOutTime
|
||||
shiftRole {
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
|
||||
role { id name costPerHour }
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
location
|
||||
locationAddress
|
||||
description
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
invoice {
|
||||
id
|
||||
invoiceNumber
|
||||
status
|
||||
issueDate
|
||||
dueDate
|
||||
amount
|
||||
|
||||
business { id businessName }
|
||||
vendor { id companyName }
|
||||
order { id eventName location }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
mutation createRequiredDoc(
|
||||
$name: String!
|
||||
$description: String
|
||||
$status: ReqDocumentStatus
|
||||
$staffId: UUID!
|
||||
$fileUrl: String
|
||||
) @auth(level: USER) {
|
||||
requiredDoc_insert(
|
||||
data: {
|
||||
name: $name
|
||||
description: $description
|
||||
status: $status
|
||||
staffId: $staffId
|
||||
fileUrl: $fileUrl
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateRequiredDoc(
|
||||
$id: UUID!
|
||||
$name: String
|
||||
$description: String
|
||||
$status: ReqDocumentStatus
|
||||
$fileUrl: String
|
||||
) @auth(level: USER) {
|
||||
requiredDoc_update(
|
||||
id: $id
|
||||
data: {
|
||||
name: $name
|
||||
description: $description
|
||||
status: $status
|
||||
fileUrl: $fileUrl
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteRequiredDoc($id: UUID!) @auth(level: USER) {
|
||||
requiredDoc_delete(id: $id)
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
query listRequiredDocs @auth(level: USER) {
|
||||
requiredDocs {
|
||||
id
|
||||
name
|
||||
description
|
||||
status
|
||||
staffId
|
||||
fileUrl
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query getRequiredDocById($id: UUID!) @auth(level: USER) {
|
||||
requiredDoc(id: $id) {
|
||||
id
|
||||
name
|
||||
description
|
||||
status
|
||||
staffId
|
||||
fileUrl
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query getRequiredDocsByStaffId($staffId: UUID!) @auth(level: USER) {
|
||||
requiredDocs(where: { staffId: { eq: $staffId } }) {
|
||||
id
|
||||
name
|
||||
description
|
||||
status
|
||||
staffId
|
||||
fileUrl
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
query filterRequiredDocs(
|
||||
$staffId: UUID
|
||||
$status: ReqDocumentStatus
|
||||
$name: String
|
||||
) @auth(level: USER) {
|
||||
requiredDocs(
|
||||
where: {
|
||||
staffId: { eq: $staffId }
|
||||
status: { eq: $status }
|
||||
name: { eq: $name }
|
||||
}
|
||||
) {
|
||||
id
|
||||
name
|
||||
status
|
||||
staffId
|
||||
fileUrl
|
||||
}
|
||||
}
|
||||
@@ -225,3 +225,71 @@ query listShiftRolesByShiftIdAndTimeRange(
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST SHIFT ROLES BY VENDOR (via Shift -> Order)
|
||||
# ------------------------------------------------------------
|
||||
query listShiftRolesByVendorId(
|
||||
$vendorId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
shiftRoles(
|
||||
where: {
|
||||
shift: {
|
||||
order: {
|
||||
vendorId: { eq: $vendorId }
|
||||
}
|
||||
}
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { createdAt: DESC }
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
department
|
||||
uniform
|
||||
breakType
|
||||
totalValue
|
||||
createdAt
|
||||
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
location
|
||||
locationAddress
|
||||
description
|
||||
orderId
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
vendorId
|
||||
businessId
|
||||
orderType
|
||||
status
|
||||
date
|
||||
recurringDays
|
||||
permanentDays
|
||||
notes
|
||||
|
||||
business { id businessName }
|
||||
vendor { id companyName }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,3 +51,30 @@ query getTeamHubsByTeamId($teamId: UUID!) @auth(level: USER) {
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST TEAM HUBS BY OWNER (Vendor/Business)
|
||||
# ------------------------------------------------------------
|
||||
query listTeamHubsByOwnerId(
|
||||
$ownerId: String!
|
||||
) @auth(level: USER) {
|
||||
teamHubs(
|
||||
where: {
|
||||
team: {
|
||||
ownerId: { eq: $ownerId }
|
||||
}
|
||||
}
|
||||
) {
|
||||
id
|
||||
teamId
|
||||
hubName
|
||||
address
|
||||
city
|
||||
state
|
||||
zipCode
|
||||
managerName
|
||||
isActive
|
||||
departments
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
enum ReqDocumentStatus {
|
||||
VERIFIED
|
||||
PENDING
|
||||
MISSING
|
||||
REJECTED
|
||||
}
|
||||
|
||||
type RequiredDoc @table(name: "required_docs") {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
|
||||
name: String!
|
||||
description: String
|
||||
status: ReqDocumentStatus!
|
||||
|
||||
staffId: UUID!
|
||||
fileUrl: String
|
||||
|
||||
createdAt: Timestamp @default(expr: "request.time")
|
||||
updatedAt: Timestamp @default(expr: "request.time")
|
||||
createdBy: String
|
||||
}
|
||||
@@ -2,6 +2,8 @@ type TeamHub @table(name: "team_hubs") {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
|
||||
teamId: UUID!
|
||||
team: Team! @ref(fields: "teamId", references: "id")
|
||||
|
||||
hubName: String!
|
||||
address: String!
|
||||
city: String!
|
||||
|
||||
Reference in New Issue
Block a user