Merge remote-tracking branch 'origin/dev' into codex/feat-architecture-lead-bootstrap
This commit is contained in:
@@ -356,6 +356,95 @@ query getApplicationsByStaffId(
|
||||
}
|
||||
}
|
||||
|
||||
query getMyApplicationsByStaffId(
|
||||
$staffId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$dayStart: Timestamp
|
||||
$dayEnd: Timestamp
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
staffId: { eq: $staffId }
|
||||
status: { in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE, PENDING] }
|
||||
shift: {
|
||||
date: { ge: $dayStart, le: $dayEnd }
|
||||
}
|
||||
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
staffId
|
||||
status
|
||||
appliedAt
|
||||
checkInTime
|
||||
checkOutTime
|
||||
origin
|
||||
createdAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
location
|
||||
status
|
||||
durationDays
|
||||
description
|
||||
latitude
|
||||
longitude
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
companyLogoUrl
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shiftRole {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
breakType
|
||||
isBreakPaid
|
||||
totalValue
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
query vaidateDayStaffApplication(
|
||||
$staffId: UUID!
|
||||
$offset: Int
|
||||
@@ -543,6 +632,36 @@ query listAcceptedApplicationsByShiftRoleKey(
|
||||
}
|
||||
}
|
||||
|
||||
query listOverlappingAcceptedApplicationsByStaff(
|
||||
$staffId: UUID!
|
||||
$newStart: Timestamp!
|
||||
$newEnd: Timestamp!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
applications(
|
||||
where: {
|
||||
staffId: { eq: $staffId }
|
||||
status: { in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE ] }
|
||||
shiftRole: {
|
||||
startTime: { lt: $newEnd }
|
||||
endTime: { gt: $newStart }
|
||||
}
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { appliedAt: ASC }
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
roleId
|
||||
checkInTime
|
||||
checkOutTime
|
||||
staff { id fullName email phone photoUrl }
|
||||
shiftRole { startTime endTime }
|
||||
}
|
||||
}
|
||||
|
||||
#getting staffs of an shiftrole status for orders of the day view client
|
||||
query listAcceptedApplicationsByBusinessForDay(
|
||||
$businessId: UUID!
|
||||
@@ -665,10 +784,14 @@ query listCompletedApplicationsByStaffId(
|
||||
durationDays
|
||||
latitude
|
||||
longitude
|
||||
orderId
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
orderType
|
||||
startDate
|
||||
endDate
|
||||
|
||||
teamHub {
|
||||
address
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
mutation createAttireOption(
|
||||
$itemId: String!
|
||||
$label: String!
|
||||
$icon: String
|
||||
$description: String
|
||||
$imageUrl: String
|
||||
$isMandatory: Boolean
|
||||
$vendorId: UUID
|
||||
@@ -10,7 +10,7 @@ mutation createAttireOption(
|
||||
data: {
|
||||
itemId: $itemId
|
||||
label: $label
|
||||
icon: $icon
|
||||
description: $description
|
||||
imageUrl: $imageUrl
|
||||
isMandatory: $isMandatory
|
||||
vendorId: $vendorId
|
||||
@@ -22,7 +22,7 @@ mutation updateAttireOption(
|
||||
$id: UUID!
|
||||
$itemId: String
|
||||
$label: String
|
||||
$icon: String
|
||||
$description: String
|
||||
$imageUrl: String
|
||||
$isMandatory: Boolean
|
||||
$vendorId: UUID
|
||||
@@ -32,7 +32,7 @@ mutation updateAttireOption(
|
||||
data: {
|
||||
itemId: $itemId
|
||||
label: $label
|
||||
icon: $icon
|
||||
description: $description
|
||||
imageUrl: $imageUrl
|
||||
isMandatory: $isMandatory
|
||||
vendorId: $vendorId
|
||||
|
||||
@@ -3,7 +3,7 @@ query listAttireOptions @auth(level: USER) {
|
||||
id
|
||||
itemId
|
||||
label
|
||||
icon
|
||||
description
|
||||
imageUrl
|
||||
isMandatory
|
||||
vendorId
|
||||
@@ -16,7 +16,7 @@ query getAttireOptionById($id: UUID!) @auth(level: USER) {
|
||||
id
|
||||
itemId
|
||||
label
|
||||
icon
|
||||
description
|
||||
imageUrl
|
||||
isMandatory
|
||||
vendorId
|
||||
@@ -39,7 +39,7 @@ query filterAttireOptions(
|
||||
id
|
||||
itemId
|
||||
label
|
||||
icon
|
||||
description
|
||||
imageUrl
|
||||
isMandatory
|
||||
vendorId
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# GET WORKER BENEFIT BALANCES (M4)
|
||||
# Returns all active benefit plans with balance data for a given worker.
|
||||
# Supports: Sick Leave (40h), Holidays (24h), Vacation (40h)
|
||||
# Extensible: any future VendorBenefitPlan will appear automatically.
|
||||
#
|
||||
# Fields:
|
||||
# vendorBenefitPlan.title → benefit type name
|
||||
# vendorBenefitPlan.total → total entitlement (hours)
|
||||
# current → used hours
|
||||
# remaining = total - current → computed client-side
|
||||
# ----------------------------------------------------------
|
||||
query getWorkerBenefitBalances(
|
||||
$staffId: UUID!
|
||||
) @auth(level: USER) {
|
||||
benefitsDatas(
|
||||
where: {
|
||||
staffId: { eq: $staffId }
|
||||
}
|
||||
) {
|
||||
vendorBenefitPlanId
|
||||
current
|
||||
|
||||
vendorBenefitPlan {
|
||||
id
|
||||
title
|
||||
description
|
||||
requestLabel
|
||||
total
|
||||
isActive
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST ALL (admin/debug)
|
||||
# ----------------------------------------------------------
|
||||
|
||||
@@ -15,9 +15,10 @@ mutation createOrder(
|
||||
$shifts: Any
|
||||
$requested: Int
|
||||
$teamHubId: UUID!
|
||||
$recurringDays: Any
|
||||
$hubManagerId: UUID
|
||||
$recurringDays: [String!]
|
||||
$permanentStartDate: Timestamp
|
||||
$permanentDays: Any
|
||||
$permanentDays: [String!]
|
||||
$notes: String
|
||||
$detectedConflicts: Any
|
||||
$poReference: String
|
||||
@@ -40,6 +41,7 @@ mutation createOrder(
|
||||
shifts: $shifts
|
||||
requested: $requested
|
||||
teamHubId: $teamHubId
|
||||
hubManagerId: $hubManagerId
|
||||
recurringDays: $recurringDays
|
||||
permanentDays: $permanentDays
|
||||
notes: $notes
|
||||
@@ -64,8 +66,8 @@ mutation updateOrder(
|
||||
$shifts: Any
|
||||
$requested: Int
|
||||
$teamHubId: UUID!
|
||||
$recurringDays: Any
|
||||
$permanentDays: Any
|
||||
$recurringDays: [String!]
|
||||
$permanentDays: [String!]
|
||||
$notes: String
|
||||
$detectedConflicts: Any
|
||||
$poReference: String
|
||||
|
||||
@@ -433,3 +433,98 @@ query listOrdersByBusinessAndTeamHub(
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# GET COMPLETED ORDERS BY BUSINESS AND DATE RANGE
|
||||
# ------------------------------------------------------------
|
||||
query listCompletedOrdersByBusinessAndDateRange(
|
||||
$businessId: UUID!
|
||||
$start: Timestamp!
|
||||
$end: Timestamp!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
orders(
|
||||
where: {
|
||||
businessId: { eq: $businessId }
|
||||
status: { eq: COMPLETED }
|
||||
date: { ge: $start, le: $end }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { createdAt: DESC }
|
||||
) {
|
||||
id
|
||||
eventName
|
||||
|
||||
vendorId
|
||||
businessId
|
||||
orderType
|
||||
status
|
||||
date
|
||||
startDate
|
||||
endDate
|
||||
duration
|
||||
lunchBreak
|
||||
total
|
||||
assignedStaff
|
||||
requested
|
||||
recurringDays
|
||||
permanentDays
|
||||
poReference
|
||||
notes
|
||||
createdAt
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
}
|
||||
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
|
||||
teamHub {
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
}
|
||||
|
||||
# Assigned shifts and their roles
|
||||
shifts_on_order {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
cost
|
||||
location
|
||||
locationAddress
|
||||
status
|
||||
workersNeeded
|
||||
filled
|
||||
|
||||
shiftRoles_on_shift {
|
||||
id
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
totalValue
|
||||
|
||||
role {
|
||||
id
|
||||
name
|
||||
costPerHour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ query listInvoicesForSpendByBusiness(
|
||||
status
|
||||
invoiceNumber
|
||||
|
||||
vendor { id companyName }
|
||||
vendor { id companyName serviceSpecialty }
|
||||
business { id businessName }
|
||||
order { id eventName }
|
||||
}
|
||||
@@ -306,7 +306,7 @@ query listInvoicesForSpendByVendor(
|
||||
status
|
||||
invoiceNumber
|
||||
|
||||
vendor { id companyName }
|
||||
vendor { id companyName serviceSpecialty }
|
||||
business { id businessName }
|
||||
order { id eventName }
|
||||
}
|
||||
@@ -332,7 +332,7 @@ query listInvoicesForSpendByOrder(
|
||||
status
|
||||
invoiceNumber
|
||||
|
||||
vendor { id companyName }
|
||||
vendor { id companyName serviceSpecialty }
|
||||
business { id businessName }
|
||||
order { id eventName }
|
||||
}
|
||||
|
||||
129
backend/dataconnect/connector/shiftDayCompletion/mutations.gql
Normal file
129
backend/dataconnect/connector/shiftDayCompletion/mutations.gql
Normal file
@@ -0,0 +1,129 @@
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# CREATE — called automatically at the end of each shift day
|
||||
# ------------------------------------------------------------
|
||||
mutation createShiftDayCompletion(
|
||||
$shiftId: UUID!
|
||||
$orderId: UUID!
|
||||
$businessId: UUID!
|
||||
$vendorId: UUID!
|
||||
$dayDate: Timestamp!
|
||||
$dayNumber: Int!
|
||||
$hours: Float
|
||||
$cost: Float
|
||||
$staffSummary: Any
|
||||
$createdBy: String
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletion_insert(
|
||||
data: {
|
||||
shiftId: $shiftId
|
||||
orderId: $orderId
|
||||
businessId: $businessId
|
||||
vendorId: $vendorId
|
||||
dayDate: $dayDate
|
||||
dayNumber: $dayNumber
|
||||
status: PENDING_REVIEW
|
||||
hours: $hours
|
||||
cost: $cost
|
||||
staffSummary: $staffSummary
|
||||
createdBy: $createdBy
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# APPROVE — client approves a daily completion record
|
||||
# ------------------------------------------------------------
|
||||
mutation approveShiftDayCompletion(
|
||||
$id: UUID!
|
||||
$reviewedBy: String!
|
||||
$reviewedAt: Timestamp!
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletion_update(
|
||||
id: $id
|
||||
data: {
|
||||
status: APPROVED
|
||||
reviewedBy: $reviewedBy
|
||||
reviewedAt: $reviewedAt
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# DISPUTE — client disputes a daily completion record
|
||||
# ------------------------------------------------------------
|
||||
mutation disputeShiftDayCompletion(
|
||||
$id: UUID!
|
||||
$reviewedBy: String!
|
||||
$reviewedAt: Timestamp!
|
||||
$disputeReason: String!
|
||||
$disputeDetails: String
|
||||
$disputedItems: Any
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletion_update(
|
||||
id: $id
|
||||
data: {
|
||||
status: DISPUTED
|
||||
reviewedBy: $reviewedBy
|
||||
reviewedAt: $reviewedAt
|
||||
disputeReason: $disputeReason
|
||||
disputeDetails: $disputeDetails
|
||||
disputedItems: $disputedItems
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LINK INVOICE — set once invoice is generated after full approval
|
||||
# ------------------------------------------------------------
|
||||
mutation linkInvoiceToShiftDayCompletion(
|
||||
$id: UUID!
|
||||
$invoiceId: UUID!
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletion_update(
|
||||
id: $id
|
||||
data: {
|
||||
invoiceId: $invoiceId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# UPDATE — general-purpose update (admin use)
|
||||
# ------------------------------------------------------------
|
||||
mutation updateShiftDayCompletion(
|
||||
$id: UUID!
|
||||
$status: ShiftDayCompletionStatus
|
||||
$hours: Float
|
||||
$cost: Float
|
||||
$staffSummary: Any
|
||||
$disputeReason: String
|
||||
$disputeDetails: String
|
||||
$disputedItems: Any
|
||||
$reviewedBy: String
|
||||
$reviewedAt: Timestamp
|
||||
$invoiceId: UUID
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletion_update(
|
||||
id: $id
|
||||
data: {
|
||||
status: $status
|
||||
hours: $hours
|
||||
cost: $cost
|
||||
staffSummary: $staffSummary
|
||||
disputeReason: $disputeReason
|
||||
disputeDetails: $disputeDetails
|
||||
disputedItems: $disputedItems
|
||||
reviewedBy: $reviewedBy
|
||||
reviewedAt: $reviewedAt
|
||||
invoiceId: $invoiceId
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# DELETE
|
||||
# ------------------------------------------------------------
|
||||
mutation deleteShiftDayCompletion($id: UUID!) @auth(level: USER) {
|
||||
shiftDayCompletion_delete(id: $id)
|
||||
}
|
||||
417
backend/dataconnect/connector/shiftDayCompletion/queries.gql
Normal file
417
backend/dataconnect/connector/shiftDayCompletion/queries.gql
Normal file
@@ -0,0 +1,417 @@
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# GET BY ID
|
||||
# ------------------------------------------------------------
|
||||
query getShiftDayCompletionById($id: UUID!) @auth(level: USER) {
|
||||
shiftDayCompletion(id: $id) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
disputeReason
|
||||
disputeDetails
|
||||
disputedItems
|
||||
reviewedBy
|
||||
reviewedAt
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
hours
|
||||
durationDays
|
||||
status
|
||||
}
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
orderType
|
||||
poReference
|
||||
teamHub {
|
||||
hubName
|
||||
address
|
||||
}
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
contactName
|
||||
}
|
||||
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
email
|
||||
}
|
||||
|
||||
invoice {
|
||||
id
|
||||
invoiceNumber
|
||||
status
|
||||
issueDate
|
||||
dueDate
|
||||
amount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST ALL COMPLETION RECORDS FOR A SHIFT
|
||||
# ------------------------------------------------------------
|
||||
query listShiftDayCompletionsByShift(
|
||||
$shiftId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletions(
|
||||
where: { shiftId: { eq: $shiftId } }
|
||||
orderBy: { dayNumber: ASC }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
disputeReason
|
||||
disputeDetails
|
||||
disputedItems
|
||||
reviewedBy
|
||||
reviewedAt
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
durationDays
|
||||
status
|
||||
}
|
||||
|
||||
invoice {
|
||||
id
|
||||
invoiceNumber
|
||||
status
|
||||
amount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST ALL COMPLETION RECORDS FOR AN ORDER
|
||||
# ------------------------------------------------------------
|
||||
query listShiftDayCompletionsByOrder(
|
||||
$orderId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletions(
|
||||
where: { orderId: { eq: $orderId } }
|
||||
orderBy: { dayDate: ASC }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
disputeReason
|
||||
disputeDetails
|
||||
disputedItems
|
||||
reviewedBy
|
||||
reviewedAt
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
durationDays
|
||||
status
|
||||
}
|
||||
|
||||
invoice {
|
||||
id
|
||||
invoiceNumber
|
||||
status
|
||||
amount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST PENDING REVIEW RECORDS FOR A BUSINESS (client view)
|
||||
# ------------------------------------------------------------
|
||||
query listPendingShiftDayCompletionsByBusiness(
|
||||
$businessId: UUID!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletions(
|
||||
where: {
|
||||
businessId: { eq: $businessId }
|
||||
status: { eq: PENDING_REVIEW }
|
||||
}
|
||||
orderBy: { dayDate: ASC }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
createdAt
|
||||
updatedAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
durationDays
|
||||
status
|
||||
location
|
||||
locationAddress
|
||||
}
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
orderType
|
||||
poReference
|
||||
teamHub {
|
||||
hubName
|
||||
address
|
||||
}
|
||||
}
|
||||
|
||||
vendor {
|
||||
id
|
||||
companyName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST ALL RECORDS FOR A BUSINESS FILTERED BY STATUS
|
||||
# ------------------------------------------------------------
|
||||
query listShiftDayCompletionsByBusinessAndStatus(
|
||||
$businessId: UUID!
|
||||
$status: ShiftDayCompletionStatus!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletions(
|
||||
where: {
|
||||
businessId: { eq: $businessId }
|
||||
status: { eq: $status }
|
||||
}
|
||||
orderBy: { dayDate: DESC }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
disputeReason
|
||||
disputeDetails
|
||||
disputedItems
|
||||
reviewedBy
|
||||
reviewedAt
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
durationDays
|
||||
status
|
||||
}
|
||||
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
orderType
|
||||
poReference
|
||||
}
|
||||
|
||||
invoice {
|
||||
id
|
||||
invoiceNumber
|
||||
status
|
||||
amount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST ALL APPROVED RECORDS FOR A SHIFT (invoice trigger check)
|
||||
# ------------------------------------------------------------
|
||||
query listApprovedShiftDayCompletionsByShift(
|
||||
$shiftId: UUID!
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletions(
|
||||
where: {
|
||||
shiftId: { eq: $shiftId }
|
||||
status: { eq: APPROVED }
|
||||
}
|
||||
orderBy: { dayNumber: ASC }
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
reviewedBy
|
||||
reviewedAt
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
durationDays
|
||||
hours
|
||||
cost
|
||||
status
|
||||
order {
|
||||
id
|
||||
eventName
|
||||
businessId
|
||||
vendorId
|
||||
poReference
|
||||
teamHub {
|
||||
hubName
|
||||
address
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LIST ALL RECORDS BY VENDOR FILTERED BY STATUS
|
||||
# ------------------------------------------------------------
|
||||
query listShiftDayCompletionsByVendorAndStatus(
|
||||
$vendorId: UUID!
|
||||
$status: ShiftDayCompletionStatus!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
shiftDayCompletions(
|
||||
where: {
|
||||
vendorId: { eq: $vendorId }
|
||||
status: { eq: $status }
|
||||
}
|
||||
orderBy: { dayDate: DESC }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
orderId
|
||||
businessId
|
||||
vendorId
|
||||
dayDate
|
||||
dayNumber
|
||||
status
|
||||
hours
|
||||
cost
|
||||
staffSummary
|
||||
disputeReason
|
||||
disputeDetails
|
||||
reviewedBy
|
||||
reviewedAt
|
||||
invoiceId
|
||||
createdAt
|
||||
updatedAt
|
||||
|
||||
shift {
|
||||
id
|
||||
title
|
||||
date
|
||||
startTime
|
||||
endTime
|
||||
durationDays
|
||||
status
|
||||
}
|
||||
|
||||
business {
|
||||
id
|
||||
businessName
|
||||
email
|
||||
}
|
||||
|
||||
invoice {
|
||||
id
|
||||
invoiceNumber
|
||||
status
|
||||
amount
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ query listShiftRolesByVendorId(
|
||||
shiftRoles(
|
||||
where: {
|
||||
shift: {
|
||||
status: {in: [IN_PROGRESS, CONFIRMED, ASSIGNED, OPEN, PENDING]} #IN_PROGRESS? PENDING?
|
||||
status: {in: [IN_PROGRESS, ASSIGNED, OPEN]} #IN_PROGRESS?
|
||||
order: {
|
||||
vendorId: { eq: $vendorId }
|
||||
}
|
||||
@@ -306,6 +306,8 @@ query listShiftRolesByVendorId(
|
||||
orderType
|
||||
status
|
||||
date
|
||||
startDate
|
||||
endDate
|
||||
recurringDays
|
||||
permanentDays
|
||||
notes
|
||||
@@ -354,7 +356,7 @@ query listShiftRolesByBusinessAndDateRange(
|
||||
locationAddress
|
||||
title
|
||||
status
|
||||
order { id eventName }
|
||||
order { id eventName orderType }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -399,14 +401,21 @@ query listShiftRolesByBusinessAndOrder(
|
||||
orderId
|
||||
location
|
||||
locationAddress
|
||||
filled
|
||||
|
||||
order{
|
||||
vendorId
|
||||
eventName
|
||||
date
|
||||
startDate
|
||||
endDate
|
||||
recurringDays
|
||||
permanentDays
|
||||
orderType
|
||||
#location
|
||||
|
||||
teamHub {
|
||||
id
|
||||
address
|
||||
placeId
|
||||
hubName
|
||||
@@ -417,6 +426,29 @@ query listShiftRolesByBusinessAndOrder(
|
||||
}
|
||||
}
|
||||
|
||||
query listShiftRolesByOrderAndRole(
|
||||
$orderId: UUID!
|
||||
$roleId: UUID!
|
||||
) @auth(level: USER) {
|
||||
shiftRoles(
|
||||
where: {
|
||||
shift: { orderId: { eq: $orderId } }
|
||||
roleId: { eq: $roleId }
|
||||
}
|
||||
) {
|
||||
id
|
||||
shiftId
|
||||
roleId
|
||||
count
|
||||
assigned
|
||||
shift {
|
||||
id
|
||||
filled
|
||||
date
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#reorder get list by businessId
|
||||
query listShiftRolesByBusinessDateRangeCompletedOrders(
|
||||
$businessId: UUID!
|
||||
@@ -511,7 +543,7 @@ query getCompletedShiftsByBusinessId(
|
||||
shifts(
|
||||
where: {
|
||||
order: { businessId: { eq: $businessId } }
|
||||
status: {in: [IN_PROGRESS, CONFIRMED, COMPLETED, OPEN]}
|
||||
status: {in: [IN_PROGRESS, COMPLETED, OPEN]}
|
||||
date: { ge: $dateFrom, le: $dateTo }
|
||||
}
|
||||
offset: $offset
|
||||
|
||||
@@ -214,3 +214,12 @@ mutation UpdateStaff(
|
||||
mutation DeleteStaff($id: UUID!) @auth(level: USER) {
|
||||
staff_delete(id: $id)
|
||||
}
|
||||
|
||||
mutation UpdateStaffProfileVisibility($id: UUID!, $isProfileVisible: Boolean!) @auth(level: USER) {
|
||||
staff_update(
|
||||
id: $id
|
||||
data: {
|
||||
isProfileVisible: $isProfileVisible
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# ==========================================================
|
||||
# STAFF PROFILE COMPLETION - QUERIES
|
||||
# ==========================================================
|
||||
|
||||
query getStaffProfileCompletion($id: UUID!) @auth(level: USER) {
|
||||
staff(id: $id) {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
phone
|
||||
preferredLocations
|
||||
industries
|
||||
skills
|
||||
}
|
||||
emergencyContacts(where: { staffId: { eq: $id } }) {
|
||||
id
|
||||
}
|
||||
taxForms(where: { staffId: { eq: $id } }) {
|
||||
id
|
||||
formType
|
||||
status
|
||||
}
|
||||
}
|
||||
|
||||
query getStaffPersonalInfoCompletion($id: UUID!) @auth(level: USER) {
|
||||
staff(id: $id) {
|
||||
id
|
||||
fullName
|
||||
email
|
||||
phone
|
||||
preferredLocations
|
||||
}
|
||||
}
|
||||
|
||||
query getStaffEmergencyProfileCompletion($id: UUID!) @auth(level: USER) {
|
||||
emergencyContacts(where: { staffId: { eq: $id } }) {
|
||||
id
|
||||
}
|
||||
}
|
||||
|
||||
query getStaffExperienceProfileCompletion($id: UUID!) @auth(level: USER) {
|
||||
staff(id: $id) {
|
||||
id
|
||||
industries
|
||||
skills
|
||||
}
|
||||
}
|
||||
|
||||
query getStaffTaxFormsProfileCompletion($id: UUID!) @auth(level: USER) {
|
||||
taxForms(where: { staffId: { eq: $id } }) {
|
||||
id
|
||||
formType
|
||||
status
|
||||
}
|
||||
}
|
||||
@@ -204,3 +204,10 @@ query filterStaff(
|
||||
zipCode
|
||||
}
|
||||
}
|
||||
|
||||
query getStaffProfileVisibility($staffId: UUID!) @auth(level: USER) {
|
||||
staff(id: $staffId) {
|
||||
id
|
||||
isProfileVisible
|
||||
}
|
||||
}
|
||||
17
backend/dataconnect/connector/staffAttire/mutations.gql
Normal file
17
backend/dataconnect/connector/staffAttire/mutations.gql
Normal file
@@ -0,0 +1,17 @@
|
||||
mutation upsertStaffAttire(
|
||||
$staffId: UUID!
|
||||
$attireOptionId: UUID!
|
||||
$verificationPhotoUrl: String
|
||||
$verificationId: String
|
||||
$verificationStatus: AttireVerificationStatus
|
||||
) @auth(level: USER) {
|
||||
staffAttire_upsert(
|
||||
data: {
|
||||
staffId: $staffId
|
||||
attireOptionId: $attireOptionId
|
||||
verificationPhotoUrl: $verificationPhotoUrl
|
||||
verificationId: $verificationId
|
||||
verificationStatus: $verificationStatus
|
||||
}
|
||||
)
|
||||
}
|
||||
8
backend/dataconnect/connector/staffAttire/queries.gql
Normal file
8
backend/dataconnect/connector/staffAttire/queries.gql
Normal file
@@ -0,0 +1,8 @@
|
||||
query getStaffAttire($staffId: UUID!) @auth(level: USER) {
|
||||
staffAttires(where: { staffId: { eq: $staffId } }) {
|
||||
attireOptionId
|
||||
verificationStatus
|
||||
verificationPhotoUrl
|
||||
verificationId
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
mutation CreateUser(
|
||||
$id: String!, # Firebase UID
|
||||
$email: String,
|
||||
$phone: String,
|
||||
$fullName: String,
|
||||
$role: UserBaseRole!,
|
||||
$userRole: String,
|
||||
@@ -10,6 +11,7 @@ mutation CreateUser(
|
||||
data: {
|
||||
id: $id
|
||||
email: $email
|
||||
phone: $phone
|
||||
fullName: $fullName
|
||||
role: $role
|
||||
userRole: $userRole
|
||||
@@ -21,6 +23,7 @@ mutation CreateUser(
|
||||
mutation UpdateUser(
|
||||
$id: String!,
|
||||
$email: String,
|
||||
$phone: String,
|
||||
$fullName: String,
|
||||
$role: UserBaseRole,
|
||||
$userRole: String,
|
||||
@@ -30,6 +33,7 @@ mutation UpdateUser(
|
||||
id: $id,
|
||||
data: {
|
||||
email: $email
|
||||
phone: $phone
|
||||
fullName: $fullName
|
||||
role: $role
|
||||
userRole: $userRole
|
||||
|
||||
@@ -2,6 +2,7 @@ query listUsers @auth(level: USER) {
|
||||
users {
|
||||
id
|
||||
email
|
||||
phone
|
||||
fullName
|
||||
role
|
||||
userRole
|
||||
@@ -17,6 +18,7 @@ query getUserById(
|
||||
user(id: $id) {
|
||||
id
|
||||
email
|
||||
phone
|
||||
fullName
|
||||
role
|
||||
userRole
|
||||
@@ -40,6 +42,7 @@ query filterUsers(
|
||||
) {
|
||||
id
|
||||
email
|
||||
phone
|
||||
fullName
|
||||
role
|
||||
userRole
|
||||
|
||||
3
backend/dataconnect/functions/cleanAttire.gql
Normal file
3
backend/dataconnect/functions/cleanAttire.gql
Normal file
@@ -0,0 +1,3 @@
|
||||
mutation cleanAttireOptions @transaction {
|
||||
attireOption_deleteMany(all: true)
|
||||
}
|
||||
@@ -927,7 +927,7 @@ mutation seedAll @transaction {
|
||||
placeId: "Eiw0MDAwIFNhbiBKb3NlIFN0cmVldCwgR3JhbmFkYSBIaWxscywgQ0EsIFVTQSIuKiwKFAoSCYNJZBTdmsKAEddGOfBj8LvTEhQKEglnNXI0zZrCgBEjR6om62lcVw"
|
||||
latitude: 34.2611486
|
||||
longitude: -118.5010287
|
||||
status: ASSIGNED
|
||||
status: OPEN
|
||||
workersNeeded: 2
|
||||
filled: 1
|
||||
}
|
||||
@@ -950,7 +950,7 @@ mutation seedAll @transaction {
|
||||
placeId: "Eiw2ODAwIFNhbiBKb3NlIFN0cmVldCwgR3JhbmFkYSBIaWxscywgQ0EsIFVTQSIuKiwKFAoSCYNJZBTdmsKAEddGOfBj8LvTEhQKEglnNXI0zZrCgBEjR6om62lcVw"
|
||||
latitude: 34.2611486
|
||||
longitude: -118.5010287
|
||||
status: ASSIGNED
|
||||
status: OPEN
|
||||
workersNeeded: 2
|
||||
filled: 1
|
||||
}
|
||||
@@ -996,7 +996,7 @@ mutation seedAll @transaction {
|
||||
placeId: "Eiw0MDAwIFNhbiBKb3NlIFN0cmVldCwgR3JhbmFkYSBIaWxscywgQ0EsIFVTQSIuKiwKFAoSCYNJZBTdmsKAEddGOfBj8LvTEhQKEglnNXI0zZrCgBEjR6om62lcVw"
|
||||
latitude: 34.2611486
|
||||
longitude: -118.5010287
|
||||
status: ASSIGNED
|
||||
status: OPEN
|
||||
workersNeeded: 2
|
||||
filled: 1
|
||||
}
|
||||
@@ -1042,7 +1042,7 @@ mutation seedAll @transaction {
|
||||
placeId: "Eiw1MDAwIFNhbiBKb3NlIFN0cmVldCwgR3JhbmFkYSBIaWxscywgQ0EsIFVTQSIuKiwKFAoSCYNJZBTdmsKAEddGOfBj8LvTEhQKEglnNXI0zZrCgBEjR6om62lcVw"
|
||||
latitude: 34.2611486
|
||||
longitude: -118.5010287
|
||||
status: ASSIGNED
|
||||
status: OPEN
|
||||
workersNeeded: 2
|
||||
filled: 1
|
||||
}
|
||||
@@ -1770,5 +1770,163 @@ mutation seedAll @transaction {
|
||||
invoiceId: "ba0529be-7906-417f-8ec7-c866d0633fee"
|
||||
}
|
||||
)
|
||||
|
||||
# Attire Options (Required)
|
||||
attire_1: attireOption_insert(
|
||||
data: {
|
||||
id: "4bce6592-e38e-4d90-a478-d1ce0f286146"
|
||||
itemId: "shoes_non_slip"
|
||||
label: "Non Slip Shoes"
|
||||
description: "Black, closed-toe, non-slip work shoes."
|
||||
imageUrl: "https://images.unsplash.com/photo-1549298916-b41d501d3772?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_2: attireOption_insert(
|
||||
data: {
|
||||
id: "786e9761-b398-42bd-b363-91a40938864e"
|
||||
itemId: "pants_black"
|
||||
label: "Black Pants"
|
||||
description: "Professional black slacks or trousers. No jeans."
|
||||
imageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_3: attireOption_insert(
|
||||
data: {
|
||||
id: "17b135e6-b8f0-4541-b12b-505e95de31ef"
|
||||
itemId: "socks_black"
|
||||
label: "Black Socks"
|
||||
description: "Solid black dress or crew socks."
|
||||
imageUrl: "https://images.unsplash.com/photo-1582966298431-99c6a1e8d44e?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_4: attireOption_insert(
|
||||
data: {
|
||||
id: "bbff61b3-3f99-4637-9a2f-1d4c6fa61517"
|
||||
itemId: "shirt_white_button_up"
|
||||
label: "White Button Up"
|
||||
description: "Clean, pressed, long-sleeve white button-up shirt."
|
||||
imageUrl: "https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
|
||||
# Attire Options (Non-Essential)
|
||||
attire_5: attireOption_insert(
|
||||
data: {
|
||||
id: "32e77813-24f5-495b-98de-872e33073820"
|
||||
itemId: "pants_blue_jeans"
|
||||
label: "Blue Jeans"
|
||||
description: "Standard blue denim jeans, no rips or tears."
|
||||
imageUrl: "https://images.unsplash.com/photo-1542272604-787c3835535d?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_6: attireOption_insert(
|
||||
data: {
|
||||
id: "de3c5a90-2c88-4c87-bb00-b62c6460d506"
|
||||
itemId: "shirt_white_polo"
|
||||
label: "White Polo"
|
||||
description: "White polo shirt with collar."
|
||||
imageUrl: "https://images.unsplash.com/photo-1581655353564-df123a1eb820?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_7: attireOption_insert(
|
||||
data: {
|
||||
id: "64149864-b886-4a00-9aa2-09903a401b5b"
|
||||
itemId: "shirt_catering"
|
||||
label: "Catering Shirt"
|
||||
description: "Company approved catering staff shirt."
|
||||
imageUrl: "https://images.unsplash.com/photo-1559339352-11d035aa65de?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_8: attireOption_insert(
|
||||
data: {
|
||||
id: "9b2e493e-e95c-4dcd-9073-e42dbcf77076"
|
||||
itemId: "banquette"
|
||||
label: "Banquette"
|
||||
description: "Standard banquette or event setup uniform."
|
||||
imageUrl: "https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_9: attireOption_insert(
|
||||
data: {
|
||||
id: "2e30cde5-5acd-4dd0-b8e9-af6d6b59b248"
|
||||
itemId: "hat_black_cap"
|
||||
label: "Black Cap"
|
||||
description: "Plain black baseball cap, no logos."
|
||||
imageUrl: "https://images.unsplash.com/photo-1588850561407-ed78c282e89b?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_10: attireOption_insert(
|
||||
data: {
|
||||
id: "90d912ed-1227-44ef-ae75-bc7ca2c491c6"
|
||||
itemId: "chef_coat"
|
||||
label: "Chef Coat"
|
||||
description: "Standard white double-breasted chef coat."
|
||||
imageUrl: "https://images.unsplash.com/photo-1583394293214-28ded15ee548?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_11: attireOption_insert(
|
||||
data: {
|
||||
id: "d857d96b-5bf4-4648-bb9c-f909436729fd"
|
||||
itemId: "shirt_black_button_up"
|
||||
label: "Black Button Up"
|
||||
description: "Clean, pressed, long-sleeve black button-up shirt."
|
||||
imageUrl: "https://images.unsplash.com/photo-1598033129183-c4f50c7176c8?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_12: attireOption_insert(
|
||||
data: {
|
||||
id: "1f61267b-1f7a-43f1-bfd7-2a018347285b"
|
||||
itemId: "shirt_black_polo"
|
||||
label: "Black Polo"
|
||||
description: "Black polo shirt with collar."
|
||||
imageUrl: "https://images.unsplash.com/photo-1583743814966-8936f5b7be1a?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_13: attireOption_insert(
|
||||
data: {
|
||||
id: "16192098-e5ec-4bf2-86d3-c693663BA687"
|
||||
itemId: "all_black_bistro"
|
||||
label: "All Black Bistro"
|
||||
description: "Full black bistro uniform including apron."
|
||||
imageUrl: "https://images.unsplash.com/photo-1551632432-c735e8399527?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_14: attireOption_insert(
|
||||
data: {
|
||||
id: "6be15ab9-6c73-453b-950b-d4ba35d875de"
|
||||
itemId: "white_black_bistro"
|
||||
label: "White and Black Bistro"
|
||||
description: "White shirt with black pants and bistro apron."
|
||||
imageUrl: "https://images.unsplash.com/photo-1600565193348-f74bd3c7ccdf?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
}
|
||||
#v.3
|
||||
159
backend/dataconnect/functions/seedAttire.gql
Normal file
159
backend/dataconnect/functions/seedAttire.gql
Normal file
@@ -0,0 +1,159 @@
|
||||
mutation seedAttireOptions @transaction {
|
||||
# Attire Options (Required)
|
||||
attire_1: attireOption_upsert(
|
||||
data: {
|
||||
id: "4bce6592-e38e-4d90-a478-d1ce0f286146"
|
||||
itemId: "shoes_non_slip"
|
||||
label: "Non Slip Shoes"
|
||||
description: "Black, closed-toe, non-slip work shoes."
|
||||
imageUrl: "https://images.unsplash.com/photo-1549298916-b41d501d3772?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_2: attireOption_upsert(
|
||||
data: {
|
||||
id: "786e9761-b398-42bd-b363-91a40938864e"
|
||||
itemId: "pants_black"
|
||||
label: "Black Pants"
|
||||
description: "Professional black slacks or trousers. No jeans."
|
||||
imageUrl: "https://images.unsplash.com/photo-1594633312681-425c7b97ccd1?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_3: attireOption_upsert(
|
||||
data: {
|
||||
id: "17b135e6-b8f0-4541-b12b-505e95de31ef"
|
||||
itemId: "socks_black"
|
||||
label: "Black Socks"
|
||||
description: "Solid black dress or crew socks."
|
||||
imageUrl: "https://images.unsplash.com/photo-1582966298431-99c6a1e8d44e?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_4: attireOption_upsert(
|
||||
data: {
|
||||
id: "bbff61b3-3f99-4637-9a2f-1d4c6fa61517"
|
||||
itemId: "shirt_white_button_up"
|
||||
label: "White Button Up"
|
||||
description: "Clean, pressed, long-sleeve white button-up shirt."
|
||||
imageUrl: "https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: true
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
|
||||
# Attire Options (Non-Essential)
|
||||
attire_5: attireOption_upsert(
|
||||
data: {
|
||||
id: "32e77813-24f5-495b-98de-872e33073820"
|
||||
itemId: "pants_blue_jeans"
|
||||
label: "Blue Jeans"
|
||||
description: "Standard blue denim jeans, no rips or tears."
|
||||
imageUrl: "https://images.unsplash.com/photo-1542272604-787c3835535d?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_6: attireOption_upsert(
|
||||
data: {
|
||||
id: "de3c5a90-2c88-4c87-bb00-b62c6460d506"
|
||||
itemId: "shirt_white_polo"
|
||||
label: "White Polo"
|
||||
description: "White polo shirt with collar."
|
||||
imageUrl: "https://images.unsplash.com/photo-1581655353564-df123a1eb820?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_7: attireOption_upsert(
|
||||
data: {
|
||||
id: "64149864-b886-4a00-9aa2-09903a401b5b"
|
||||
itemId: "shirt_catering"
|
||||
label: "Catering Shirt"
|
||||
description: "Company approved catering staff shirt."
|
||||
imageUrl: "https://images.unsplash.com/photo-1559339352-11d035aa65de?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_8: attireOption_upsert(
|
||||
data: {
|
||||
id: "9b2e493e-e95c-4dcd-9073-e42dbcf77076"
|
||||
itemId: "banquette"
|
||||
label: "Banquette"
|
||||
description: "Standard banquette or event setup uniform."
|
||||
imageUrl: "https://images.unsplash.com/photo-1514362545857-3bc16c4c7d1b?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_9: attireOption_upsert(
|
||||
data: {
|
||||
id: "2e30cde5-5acd-4dd0-b8e9-af6d6b59b248"
|
||||
itemId: "hat_black_cap"
|
||||
label: "Black Cap"
|
||||
description: "Plain black baseball cap, no logos."
|
||||
imageUrl: "https://images.unsplash.com/photo-1588850561407-ed78c282e89b?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_10: attireOption_upsert(
|
||||
data: {
|
||||
id: "90d912ed-1227-44ef-ae75-bc7ca2c491c6"
|
||||
itemId: "chef_coat"
|
||||
label: "Chef Coat"
|
||||
description: "Standard white double-breasted chef coat."
|
||||
imageUrl: "https://images.unsplash.com/photo-1583394293214-28ded15ee548?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_11: attireOption_upsert(
|
||||
data: {
|
||||
id: "d857d96b-5bf4-4648-bb9c-f909436729fd"
|
||||
itemId: "shirt_black_button_up"
|
||||
label: "Black Button Up"
|
||||
description: "Clean, pressed, long-sleeve black button-up shirt."
|
||||
imageUrl: "https://images.unsplash.com/photo-1598033129183-c4f50c7176c8?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_12: attireOption_upsert(
|
||||
data: {
|
||||
id: "1f61267b-1f7a-43f1-bfd7-2a018347285b"
|
||||
itemId: "shirt_black_polo"
|
||||
label: "Black Polo"
|
||||
description: "Black polo shirt with collar."
|
||||
imageUrl: "https://images.unsplash.com/photo-1583743814966-8936f5b7be1a?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_13: attireOption_upsert(
|
||||
data: {
|
||||
id: "16192098-e5ec-4bf2-86d3-c693663BA687"
|
||||
itemId: "all_black_bistro"
|
||||
label: "All Black Bistro"
|
||||
description: "Full black bistro uniform including apron."
|
||||
imageUrl: "https://images.unsplash.com/photo-1551632432-c735e8399527?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
attire_14: attireOption_upsert(
|
||||
data: {
|
||||
id: "6be15ab9-6c73-453b-950b-d4ba35d875de"
|
||||
itemId: "white_black_bistro"
|
||||
label: "White and Black Bistro"
|
||||
description: "White shirt with black pants and bistro apron."
|
||||
imageUrl: "https://images.unsplash.com/photo-1600565193348-f74bd3c7ccdf?auto=format&fit=crop&q=80&w=400&h=400"
|
||||
isMandatory: false
|
||||
vendorId: "c3b25c47-0ebd-4402-a9b1-b8a875a7f71a"
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -2,7 +2,7 @@ type AttireOption @table(name: "attire_options") {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
itemId: String!
|
||||
label: String!
|
||||
icon: String
|
||||
description: String
|
||||
imageUrl: String
|
||||
isMandatory: Boolean
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
type BenefitsData @table(name: "benefits_data", key: ["staffId", "vendorBenefitPlanId"]) {
|
||||
type BenefitsData
|
||||
@table(name: "benefits_data", key: ["staffId", "vendorBenefitPlanId"]) {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
|
||||
vendorBenefitPlanId: UUID!
|
||||
vendorBenefitPlan: VendorBenefitPlan! @ref( fields: "vendorBenefitPlanId", references: "id" )
|
||||
vendorBenefitPlanId: UUID!
|
||||
vendorBenefitPlan: VendorBenefitPlan!
|
||||
@ref(fields: "vendorBenefitPlanId", references: "id")
|
||||
|
||||
current: Int!
|
||||
|
||||
staffId: UUID!
|
||||
staff: Staff! @ref( fields: "staffId", references: "id" )
|
||||
staff: Staff! @ref(fields: "staffId", references: "id")
|
||||
|
||||
createdAt: Timestamp @default(expr: "request.time")
|
||||
updatedAt: Timestamp @default(expr: "request.time")
|
||||
|
||||
@@ -47,15 +47,18 @@ 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
|
||||
endDate: Timestamp #for recurring and permanent
|
||||
|
||||
recurringDays: Any @col(dataType: "jsonb")
|
||||
recurringDays: [String!]
|
||||
poReference: String
|
||||
|
||||
permanentDays: Any @col(dataType: "jsonb")
|
||||
permanentDays: [String!]
|
||||
|
||||
detectedConflicts: Any @col(dataType:"jsonb")
|
||||
notes: String
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
enum ShiftStatus {
|
||||
DRAFT
|
||||
FILLED
|
||||
PENDING
|
||||
ASSIGNED
|
||||
CONFIRMED
|
||||
OPEN
|
||||
IN_PROGRESS
|
||||
COMPLETED
|
||||
|
||||
45
backend/dataconnect/schema/shiftDayCompletion.gql
Normal file
45
backend/dataconnect/schema/shiftDayCompletion.gql
Normal file
@@ -0,0 +1,45 @@
|
||||
enum ShiftDayCompletionStatus {
|
||||
PENDING_REVIEW
|
||||
APPROVED
|
||||
DISPUTED
|
||||
}
|
||||
|
||||
type ShiftDayCompletion @table(name: "shift_day_completions", key: ["id"]) {
|
||||
id: UUID! @default(expr: "uuidV4()")
|
||||
|
||||
shiftId: UUID!
|
||||
shift: Shift! @ref(fields: "shiftId", references: "id")
|
||||
|
||||
orderId: UUID!
|
||||
order: Order! @ref(fields: "orderId", references: "id")
|
||||
|
||||
businessId: UUID!
|
||||
business: Business! @ref(fields: "businessId", references: "id")
|
||||
|
||||
vendorId: UUID!
|
||||
vendor: Vendor! @ref(fields: "vendorId", references: "id")
|
||||
|
||||
dayDate: Timestamp!
|
||||
dayNumber: Int!
|
||||
|
||||
status: ShiftDayCompletionStatus! @default(expr: "'PENDING_REVIEW'")
|
||||
|
||||
hours: Float
|
||||
cost: Float
|
||||
|
||||
staffSummary: Any @col(dataType: "jsonb")
|
||||
|
||||
disputeReason: String
|
||||
disputeDetails: String
|
||||
disputedItems: Any @col(dataType: "jsonb")
|
||||
|
||||
reviewedBy: String
|
||||
reviewedAt: Timestamp
|
||||
|
||||
invoiceId: UUID
|
||||
invoice: Invoice @ref(fields: "invoiceId", references: "id")
|
||||
|
||||
createdAt: Timestamp @default(expr: "request.time")
|
||||
updatedAt: Timestamp @default(expr: "request.time")
|
||||
createdBy: String
|
||||
}
|
||||
27
backend/dataconnect/schema/staffAttire.gql
Normal file
27
backend/dataconnect/schema/staffAttire.gql
Normal file
@@ -0,0 +1,27 @@
|
||||
enum AttireVerificationStatus {
|
||||
PENDING
|
||||
PROCESSING
|
||||
AUTO_PASS
|
||||
AUTO_FAIL
|
||||
NEEDS_REVIEW
|
||||
APPROVED
|
||||
REJECTED
|
||||
ERROR
|
||||
}
|
||||
|
||||
type StaffAttire @table(name: "staff_attires", key: ["staffId", "attireOptionId"]) {
|
||||
staffId: UUID!
|
||||
staff: Staff! @ref(fields: "staffId", references: "id")
|
||||
|
||||
attireOptionId: UUID!
|
||||
attireOption: AttireOption! @ref(fields: "attireOptionId", references: "id")
|
||||
|
||||
# Verification Metadata
|
||||
verificationStatus: AttireVerificationStatus @default(expr: "'PENDING'")
|
||||
verifiedAt: Timestamp
|
||||
verificationPhotoUrl: String # Proof of ownership
|
||||
verificationId: String
|
||||
|
||||
createdAt: Timestamp @default(expr: "request.time")
|
||||
updatedAt: Timestamp @default(expr: "request.time")
|
||||
}
|
||||
@@ -6,6 +6,7 @@ enum UserBaseRole {
|
||||
type User @table(name: "users") {
|
||||
id: String! # user_id / uid de Firebase
|
||||
email: String
|
||||
phone: String
|
||||
fullName: String
|
||||
role: UserBaseRole!
|
||||
userRole: String
|
||||
|
||||
Reference in New Issue
Block a user