Add support for verificationId throughout the certificate flow: schema, GraphQL mutations/queries, domain, repositories, service implementation, and UI. - Backend: add verificationId to Certificate schema and include it in upsert/create mutations; add auth insecureReason notes to related connector operations. - Data layer: add verificationId parameter to StaffConnectorRepository API and propagation in implementation (SDK call remains commented with FIXME until dataconnect SDK is regenerated). - Domain: add verificationId field to StaffCertificate (constructor, copyWith, props). - Certificates flow: create verification via verificationService, pass returned verificationId to upsertStaffCertificate so the verification record is persisted with the certificate. - UI: update certificate upload page to show existing file path, disable editing of name/issuer/number, rearrange fields, move remove button, change file icon and text style. - Misc: minor lambda formatting cleanup in benefits mapping. Note: the generated dataconnect SDK must be refreshed to enable the new .verificationId(...) call (there is a commented FIXME in the connector implementation).
837 lines
12 KiB
GraphQL
837 lines
12 KiB
GraphQL
query listApplications @auth(level: USER) {
|
|
applications {
|
|
id
|
|
shiftId
|
|
staffId
|
|
status
|
|
appliedAt
|
|
checkInTime
|
|
checkOutTime
|
|
origin
|
|
createdAt
|
|
|
|
shift {
|
|
id
|
|
title
|
|
date
|
|
startTime
|
|
endTime
|
|
location
|
|
status
|
|
|
|
order {
|
|
id
|
|
eventName
|
|
#location
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
shiftRole {
|
|
id
|
|
roleId
|
|
count
|
|
assigned
|
|
startTime
|
|
endTime
|
|
hours
|
|
breakType
|
|
isBreakPaid
|
|
totalValue
|
|
role {
|
|
id
|
|
name
|
|
costPerHour
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
query getApplicationById($id: UUID!) @auth(level: USER) {
|
|
application(id: $id) {
|
|
id
|
|
shiftId
|
|
staffId
|
|
status
|
|
appliedAt
|
|
checkInTime
|
|
checkOutTime
|
|
origin
|
|
createdAt
|
|
shift {
|
|
id
|
|
title
|
|
date
|
|
startTime
|
|
endTime
|
|
location
|
|
status
|
|
|
|
order {
|
|
id
|
|
eventName
|
|
#location
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
shiftRole {
|
|
id
|
|
roleId
|
|
count
|
|
assigned
|
|
startTime
|
|
endTime
|
|
hours
|
|
totalValue
|
|
role {
|
|
id
|
|
name
|
|
costPerHour
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
query getApplicationsByShiftId($shiftId: UUID!) @auth(level: USER) {
|
|
applications(where: { shiftId: { eq: $shiftId } }) {
|
|
id
|
|
shiftId
|
|
staffId
|
|
status
|
|
appliedAt
|
|
checkInTime
|
|
checkOutTime
|
|
origin
|
|
createdAt
|
|
|
|
shift {
|
|
id
|
|
title
|
|
date
|
|
startTime
|
|
endTime
|
|
location
|
|
status
|
|
|
|
order {
|
|
id
|
|
eventName
|
|
#location
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
shiftRole {
|
|
id
|
|
roleId
|
|
count
|
|
assigned
|
|
startTime
|
|
endTime
|
|
hours
|
|
totalValue
|
|
role {
|
|
id
|
|
name
|
|
costPerHour
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
query getApplicationsByShiftIdAndStatus(
|
|
$shiftId: UUID!
|
|
$status: ApplicationStatus!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
applications(
|
|
where: {
|
|
shiftId: { eq: $shiftId }
|
|
status: { eq: $status }
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
shiftId
|
|
staffId
|
|
status
|
|
appliedAt
|
|
checkInTime
|
|
checkOutTime
|
|
origin
|
|
createdAt
|
|
|
|
shift {
|
|
id
|
|
title
|
|
date
|
|
startTime
|
|
endTime
|
|
location
|
|
status
|
|
|
|
order {
|
|
id
|
|
eventName
|
|
#location
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
}
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
}
|
|
}
|
|
|
|
shiftRole {
|
|
id
|
|
roleId
|
|
count
|
|
assigned
|
|
startTime
|
|
endTime
|
|
hours
|
|
totalValue
|
|
role {
|
|
id
|
|
name
|
|
costPerHour
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
query getApplicationsByStaffId(
|
|
$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] }
|
|
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 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
|
|
$limit: Int
|
|
$dayStart: Timestamp
|
|
$dayEnd: Timestamp
|
|
) @auth(level: USER, insecureReason: "The staffId refers to the staff being validated. Ownership is verified at the application layer.") {
|
|
applications(
|
|
where: {
|
|
staffId: { eq: $staffId }
|
|
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
|
|
|
|
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
|
|
totalValue
|
|
role {
|
|
id
|
|
name
|
|
costPerHour
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
#validation before apply
|
|
query getApplicationByStaffShiftAndRole(
|
|
$staffId: UUID!
|
|
$shiftId: UUID!
|
|
$roleId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
applications(
|
|
where: {
|
|
staffId: { eq: $staffId }
|
|
shiftId: { eq: $shiftId }
|
|
shiftRole: { roleId: { eq: $roleId } }
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
) {
|
|
id
|
|
shiftId
|
|
staffId
|
|
status
|
|
appliedAt
|
|
checkInTime
|
|
checkOutTime
|
|
origin
|
|
createdAt
|
|
|
|
shift {
|
|
id
|
|
title
|
|
date
|
|
startTime
|
|
endTime
|
|
location
|
|
status
|
|
|
|
order {
|
|
id
|
|
eventName
|
|
|
|
teamHub {
|
|
address
|
|
placeId
|
|
hubName
|
|
}
|
|
|
|
business {
|
|
id
|
|
businessName
|
|
email
|
|
contactName
|
|
companyLogoUrl
|
|
}
|
|
vendor {
|
|
id
|
|
companyName
|
|
}
|
|
}
|
|
}
|
|
|
|
shiftRole {
|
|
id
|
|
roleId
|
|
count
|
|
assigned
|
|
startTime
|
|
endTime
|
|
hours
|
|
totalValue
|
|
role {
|
|
id
|
|
name
|
|
costPerHour
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#getting staffs of an shiftrole CONFIRMED for orders view client
|
|
query listAcceptedApplicationsByShiftRoleKey(
|
|
$shiftId: UUID!
|
|
$roleId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
applications(
|
|
where: {
|
|
shiftId: { eq: $shiftId }
|
|
roleId: { eq: $roleId }
|
|
status: { eq: CONFIRMED }
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { appliedAt: ASC }
|
|
) {
|
|
id
|
|
checkInTime
|
|
checkOutTime
|
|
staff { id fullName email phone photoUrl }
|
|
}
|
|
}
|
|
|
|
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!
|
|
$dayStart: Timestamp!
|
|
$dayEnd: Timestamp!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
applications(
|
|
where: {
|
|
status: { in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE] }
|
|
staff: { isProfileVisible: { eq: true } }
|
|
shift: {
|
|
date: { ge: $dayStart, le: $dayEnd }
|
|
order: { businessId: { eq: $businessId } }
|
|
}
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { appliedAt: ASC }
|
|
) {
|
|
id
|
|
shiftId
|
|
roleId
|
|
checkInTime
|
|
checkOutTime
|
|
appliedAt
|
|
staff { id fullName email phone photoUrl averageRating }
|
|
}
|
|
}
|
|
|
|
#coverage list and today live
|
|
query listStaffsApplicationsByBusinessForDay(
|
|
$businessId: UUID!
|
|
$dayStart: Timestamp!
|
|
$dayEnd: Timestamp!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
applications(
|
|
where: {
|
|
status: {in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE]}
|
|
staff: { isProfileVisible: { eq: true } }
|
|
shift: {
|
|
date: { ge: $dayStart, le: $dayEnd }
|
|
order: { businessId: { eq: $businessId } }
|
|
}
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { appliedAt: ASC }
|
|
) {
|
|
id
|
|
shiftId
|
|
roleId
|
|
checkInTime
|
|
checkOutTime
|
|
appliedAt
|
|
status
|
|
|
|
shiftRole {
|
|
startTime
|
|
shift {
|
|
date
|
|
location
|
|
locationAddress
|
|
cost
|
|
}
|
|
count
|
|
assigned
|
|
hours
|
|
|
|
role {
|
|
name
|
|
}
|
|
}
|
|
staff { id fullName email phone photoUrl }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# ==========================================================
|
|
# COMPLETED APPLICATIONS BY STAFF (same payload as
|
|
# getApplicationByStaffShiftAndRole)
|
|
# ==========================================================
|
|
query listCompletedApplicationsByStaffId(
|
|
$staffId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
applications(
|
|
where: {
|
|
staffId: { eq: $staffId }
|
|
status: { eq: COMPLETED }
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { appliedAt: DESC }
|
|
) {
|
|
id
|
|
shiftId
|
|
staffId
|
|
status
|
|
appliedAt
|
|
checkInTime
|
|
checkOutTime
|
|
origin
|
|
createdAt
|
|
|
|
shift {
|
|
id
|
|
title
|
|
date
|
|
startTime
|
|
endTime
|
|
location
|
|
status
|
|
description
|
|
durationDays
|
|
latitude
|
|
longitude
|
|
orderId
|
|
|
|
order {
|
|
id
|
|
eventName
|
|
orderType
|
|
startDate
|
|
endDate
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|