diff --git a/backend/dataconnect/connector/account/mutations.gql b/backend/dataconnect/connector/account/mutations.gql
new file mode 100644
index 00000000..2ff80700
--- /dev/null
+++ b/backend/dataconnect/connector/account/mutations.gql
@@ -0,0 +1,39 @@
+mutation createAccount(
+ $bank: String!
+ $type: AccountType!
+ $last4: String!
+ $isPrimary: Boolean
+ $ownerId: UUID!
+) @auth(level: USER) {
+ account_insert(
+ data: {
+ bank: $bank
+ type: $type
+ last4: $last4
+ isPrimary: $isPrimary
+ ownerId: $ownerId
+ }
+ )
+}
+
+mutation updateAccount(
+ $id: UUID!
+ $bank: String
+ $type: AccountType
+ $last4: String
+ $isPrimary: Boolean
+) @auth(level: USER) {
+ account_update(
+ id: $id
+ data: {
+ bank: $bank
+ type: $type
+ last4: $last4
+ isPrimary: $isPrimary
+ }
+ )
+}
+
+mutation deleteAccount($id: UUID!) @auth(level: USER) {
+ account_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/account/queries.gql b/backend/dataconnect/connector/account/queries.gql
new file mode 100644
index 00000000..7ad2d186
--- /dev/null
+++ b/backend/dataconnect/connector/account/queries.gql
@@ -0,0 +1,64 @@
+query listAccounts @auth(level: USER) {
+ accounts {
+ id
+ bank
+ type
+ last4
+ isPrimary
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getAccountById($id: UUID!) @auth(level: USER) {
+ account(id: $id) {
+ id
+ bank
+ type
+ last4
+ isPrimary
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getAccountsByOwnerId($ownerId: UUID!) @auth(level: USER) {
+ accounts(where: { ownerId: { eq: $ownerId } }) {
+ id
+ bank
+ type
+ last4
+ isPrimary
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterAccounts(
+ $bank: String
+ $type: AccountType
+ $isPrimary: Boolean
+ $ownerId: UUID
+) @auth(level: USER) {
+ accounts(
+ where: {
+ bank: { eq: $bank }
+ type: { eq: $type }
+ isPrimary: { eq: $isPrimary }
+ ownerId: { eq: $ownerId }
+ }
+ ) {
+ id
+ bank
+ type
+ last4
+ isPrimary
+ ownerId
+ }
+}
diff --git a/backend/dataconnect/connector/activityLog/mutations.gql b/backend/dataconnect/connector/activityLog/mutations.gql
new file mode 100644
index 00000000..772cac1d
--- /dev/null
+++ b/backend/dataconnect/connector/activityLog/mutations.gql
@@ -0,0 +1,96 @@
+mutation createActivityLog(
+ $userId: String!
+
+ $date: Timestamp!
+ $hourStart: String
+ $hourEnd: String
+ $totalhours: String
+ $iconType: ActivityIconType
+ $iconColor: String
+
+ $title: String!
+ $description: String!
+ $isRead: Boolean
+ $activityType: ActivityType!
+) @auth(level: USER) {
+ activityLog_insert(
+ data: {
+ userId: $userId
+
+ date: $date
+ hourStart: $hourStart
+ hourEnd: $hourEnd
+ totalhours: $totalhours
+ iconType: $iconType
+ iconColor: $iconColor
+
+ title: $title
+ description: $description
+ isRead: $isRead
+ activityType: $activityType
+ }
+ )
+}
+
+mutation updateActivityLog(
+ $id: UUID!
+
+ $userId: String
+
+ $date: Timestamp
+ $hourStart: String
+ $hourEnd: String
+ $totalhours: String
+ $iconType: ActivityIconType
+ $iconColor: String
+
+ $title: String
+ $description: String
+ $isRead: Boolean
+ $activityType: ActivityType
+) @auth(level: USER) {
+ activityLog_update(
+ id: $id
+ data: {
+ userId: $userId
+
+ date: $date
+ hourStart: $hourStart
+ hourEnd: $hourEnd
+ totalhours: $totalhours
+ iconType: $iconType
+ iconColor: $iconColor
+
+ title: $title
+ description: $description
+ isRead: $isRead
+ activityType: $activityType
+ }
+ )
+}
+
+# ----------------------------------------------------------
+# MARK AS READ (single)
+# ----------------------------------------------------------
+mutation markActivityLogAsRead($id: UUID!) @auth(level: USER) {
+ activityLog_update(
+ id: $id
+ data: { isRead: true }
+ )
+}
+
+# ----------------------------------------------------------
+# MARK MANY AS READ (correct op name in your DC)
+# ----------------------------------------------------------
+mutation markActivityLogsAsRead(
+ $ids: [UUID!]!
+) @auth(level: USER) {
+ activityLog_updateMany(
+ where: { id: { in: $ids } }
+ data: { isRead: true }
+ )
+}
+
+mutation deleteActivityLog($id: UUID!) @auth(level: USER) {
+ activityLog_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/activityLog/queries.gql b/backend/dataconnect/connector/activityLog/queries.gql
new file mode 100644
index 00000000..f0267068
--- /dev/null
+++ b/backend/dataconnect/connector/activityLog/queries.gql
@@ -0,0 +1,175 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listActivityLogs(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ activityLogs(offset: $offset, limit: $limit) {
+ id
+ userId
+
+ date
+ hourStart
+ hourEnd
+ totalhours
+ iconType
+ iconColor
+
+ title
+ description
+ isRead
+ activityType
+
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY ID
+# ----------------------------------------------------------
+query getActivityLogById($id: UUID!) @auth(level: USER) {
+ activityLog(id: $id) {
+ id
+ userId
+
+ date
+ hourStart
+ hourEnd
+ totalhours
+ iconType
+ iconColor
+
+ title
+ description
+ isRead
+ activityType
+
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY USER
+# ----------------------------------------------------------
+query listActivityLogsByUserId(
+ $userId: String!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ activityLogs(
+ where: { userId: { eq: $userId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ userId
+
+ date
+ hourStart
+ hourEnd
+ totalhours
+ iconType
+ iconColor
+
+ title
+ description
+ isRead
+ activityType
+
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+# ----------------------------------------------------------
+# LIST UNREAD BY USER (common for notifications UI)
+# ----------------------------------------------------------
+query listUnreadActivityLogsByUserId(
+ $userId: String!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ activityLogs(
+ where: {
+ userId: { eq: $userId }
+ isRead: { eq: false }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ userId
+
+ date
+ hourStart
+ hourEnd
+ totalhours
+ iconType
+ iconColor
+
+ title
+ description
+ isRead
+ activityType
+
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (user + date range + read status + type)
+# NOTE: Timestamp filter uses ge/le (NOT gte/lte)
+# ----------------------------------------------------------
+query filterActivityLogs(
+ $userId: String
+ $dateFrom: Timestamp
+ $dateTo: Timestamp
+ $isRead: Boolean
+ $activityType: ActivityType
+ $iconType: ActivityIconType
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ activityLogs(
+ where: {
+ userId: { eq: $userId }
+ date: { ge: $dateFrom, le: $dateTo }
+ isRead: { eq: $isRead }
+ activityType: { eq: $activityType }
+ iconType: { eq: $iconType }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ userId
+
+ date
+ hourStart
+ hourEnd
+ totalhours
+ iconType
+ iconColor
+
+ title
+ description
+ isRead
+ activityType
+
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
diff --git a/backend/dataconnect/connector/application/mutations.gql b/backend/dataconnect/connector/application/mutations.gql
new file mode 100644
index 00000000..c978383d
--- /dev/null
+++ b/backend/dataconnect/connector/application/mutations.gql
@@ -0,0 +1,47 @@
+mutation createApplication(
+ $shiftId: UUID!
+ $staffId: UUID!
+ $status: ApplicationStatus!
+ $checkInTime: Timestamp
+ $checkOutTime: Timestamp
+ $origin: ApplicationOrigin!
+ $roleId: UUID!
+) @auth(level: USER) {
+ application_insert(
+ data: {
+ shiftId: $shiftId
+ staffId: $staffId
+ status: $status
+ checkInTime: $checkInTime
+ checkOutTime: $checkOutTime
+ origin: $origin
+ roleId: $roleId
+ }
+ )
+}
+
+mutation updateApplicationStatus(
+ $id: UUID!
+ $shiftId: UUID
+ $staffId: UUID
+ $status: ApplicationStatus
+ $checkInTime: Timestamp
+ $checkOutTime: Timestamp
+ $roleId: UUID!
+) @auth(level: USER) {
+ application_update(
+ id: $id
+ data: {
+ shiftId: $shiftId
+ staffId: $staffId
+ status: $status
+ checkInTime: $checkInTime
+ checkOutTime: $checkOutTime
+ roleId: $roleId
+ }
+ )
+}
+
+mutation deleteApplication($id: UUID!) @auth(level: USER) {
+ application_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/application/queries.gql b/backend/dataconnect/connector/application/queries.gql
new file mode 100644
index 00000000..5e060ffd
--- /dev/null
+++ b/backend/dataconnect/connector/application/queries.gql
@@ -0,0 +1,304 @@
+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
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+ vendor {
+ id
+ companyName
+ }
+ }
+
+ }
+
+ shiftRole {
+ id
+ roleId
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ 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
+ 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
+ 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
+ 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
+) @auth(level: USER) {
+ applications(
+ where: { staffId: { eq: $staffId } }
+ 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
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+ vendor {
+ id
+ companyName
+ }
+ }
+
+ }
+
+ shiftRole {
+ id
+ roleId
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ totalValue
+ role {
+ id
+ name
+ costPerHour
+ }
+ }
+
+ }
+}
diff --git a/backend/dataconnect/connector/assignment/mutations.gql b/backend/dataconnect/connector/assignment/mutations.gql
new file mode 100644
index 00000000..69a14289
--- /dev/null
+++ b/backend/dataconnect/connector/assignment/mutations.gql
@@ -0,0 +1,71 @@
+mutation CreateAssignment(
+ $workforceId: UUID!
+ $title: String
+ $description: String
+ $instructions: String
+ $status: AssignmentStatus
+ $tipsAvailable: Boolean
+ $travelTime: Boolean
+ $mealProvided: Boolean
+ $parkingAvailable: Boolean
+ $gasCompensation: Boolean
+ $managers: [Any!]
+ $roleId: UUID!
+ $shiftId: UUID!
+) @auth(level: USER) {
+ assignment_insert(
+ data: {
+ workforceId: $workforceId
+ title: $title
+ description: $description
+ instructions: $instructions
+ status: $status
+ tipsAvailable: $tipsAvailable
+ travelTime: $travelTime
+ mealProvided: $mealProvided
+ parkingAvailable: $parkingAvailable
+ gasCompensation: $gasCompensation
+ managers: $managers
+ roleId: $roleId
+ shiftId: $shiftId
+ }
+ )
+}
+
+mutation UpdateAssignment(
+ $id: UUID!
+ $title: String
+ $description: String
+ $instructions: String
+ $status: AssignmentStatus
+ $tipsAvailable: Boolean
+ $travelTime: Boolean
+ $mealProvided: Boolean
+ $parkingAvailable: Boolean
+ $gasCompensation: Boolean
+ $managers: [Any!]
+ $roleId: UUID!
+ $shiftId: UUID!
+) @auth(level: USER) {
+ assignment_update(
+ id: $id
+ data: {
+ title: $title
+ description: $description
+ instructions: $instructions
+ status: $status
+ tipsAvailable: $tipsAvailable
+ travelTime: $travelTime
+ mealProvided: $mealProvided
+ parkingAvailable: $parkingAvailable
+ gasCompensation: $gasCompensation
+ managers: $managers
+ roleId: $roleId
+ shiftId: $shiftId
+ }
+ )
+}
+
+mutation DeleteAssignment($id: UUID!) @auth(level: USER) {
+ assignment_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/assignment/queries.gql b/backend/dataconnect/connector/assignment/queries.gql
new file mode 100644
index 00000000..c65a8559
--- /dev/null
+++ b/backend/dataconnect/connector/assignment/queries.gql
@@ -0,0 +1,278 @@
+# ------------------------------------------------------------
+# LIST ALL ASSIGNMENTS (admin/debug)
+# ------------------------------------------------------------
+query listAssignments(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ assignments(offset: $offset, limit: $limit) {
+ id
+ title
+ status
+ createdAt
+
+ workforce {
+ id
+ workforceNumber
+ staff { id fullName }
+ }
+
+ shiftRole {
+ id
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ totalValue
+ role { id name costPerHour }
+
+ shift {
+ id
+ title
+ date
+ location
+ locationAddress
+ latitude
+ longitude
+ status
+
+ order {
+ id
+ eventName
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# GET ASSIGNMENT BY ID
+# ------------------------------------------------------------
+query getAssignmentById($id: UUID!) @auth(level: USER) {
+ assignment(id: $id) {
+ id
+ title
+ description
+ instructions
+ status
+ tipsAvailable
+ travelTime
+ mealProvided
+ parkingAvailable
+ gasCompensation
+ managers
+ createdAt
+ updatedAt
+ createdBy
+
+ workforce {
+ id
+ workforceNumber
+ status
+ staff { id fullName }
+ }
+
+ shiftRole {
+ id
+ startTime
+ endTime
+ hours
+ totalValue
+ breakType
+ uniform
+ department
+ role { id name costPerHour }
+
+ shift {
+ id
+ title
+ date
+ location
+ locationAddress
+ latitude
+ longitude
+ status
+ managers
+
+ order {
+ id
+ eventName
+ orderType
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# MY ASSIGNMENTS (by workforceId) - Staff view
+# ------------------------------------------------------------
+query listAssignmentsByWorkforceId(
+ $workforceId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ assignments(
+ where: { workforceId: { eq: $workforceId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { createdAt: DESC }
+ ) {
+ id
+ title
+ status
+ createdAt
+
+ workforce {
+ id
+ workforceNumber
+ staff { id fullName }
+ }
+
+ shiftRole {
+ id
+ startTime
+ endTime
+ hours
+ totalValue
+ role { id name costPerHour }
+
+ shift {
+ id
+ title
+ date
+ location
+ status
+
+ order {
+ id
+ eventName
+ business { id businessName }
+ vendor { id companyName }
+ }
+ }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# ASSIGNMENTS FOR A VENDOR (Vendor dashboard)
+# Approach: filter by workforce.vendorId (relation)
+# If Data Connect can't filter nested, use 2-step:
+# 1) listWorkforceByVendorId => workforce ids
+# 2) assignments(where: { workforceId: { in: [...] } })
+# ------------------------------------------------------------
+query listAssignmentsByWorkforceIds(
+ $workforceIds: [UUID!]!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ assignments(
+ where: { workforceId: { in: $workforceIds } }
+ offset: $offset
+ limit: $limit
+ orderBy: { createdAt: DESC }
+ ) {
+ id
+ title
+ status
+ createdAt
+
+ workforce { id workforceNumber staff { id fullName } }
+
+ shiftRole {
+ id
+ role { id name }
+ shift {
+ id
+ title
+ date
+ order {
+ id
+ eventName
+ business { id businessName }
+ vendor { id companyName }
+ }
+ }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# ASSIGNMENTS BY SHIFT ROLE (useful for staffing)
+# ------------------------------------------------------------
+query listAssignmentsByShiftRole(
+ $shiftId: UUID!
+ $roleId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ assignments(
+ where: {
+ shiftId: { eq: $shiftId }
+ roleId: { eq: $roleId }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ title
+ status
+ createdAt
+ workforce { id workforceNumber staff { id fullName } }
+ }
+}
+
+# ------------------------------------------------------------
+
+# FILTER ASSIGNMENTS (status + date range)
+# Date range is based on Shift.date through the relation (NOT filterable directly).
+#
+# Since ShiftRole uses a composite key (shiftId + roleId),
+# Assignments must be filtered using BOTH fields.
+#
+# So the filtering flow is:
+# 1) Get Shifts in the date range => shiftIds
+# 2) Get ShiftRoles where shiftId IN shiftIds => (shiftId, roleId) pairs
+# 3) Get Assignments where:
+# - shiftId matches
+# - roleId matches
+# - status matches (optional)
+#
+# This query represents step 3.
+# ------------------------------------------------------------
+query filterAssignments(
+ $shiftIds: [UUID!]!
+ $roleIds: [UUID!]!
+ $status: AssignmentStatus
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ assignments(
+ where: {
+ shiftId: { in: $shiftIds }
+ roleId: { in: $roleIds }
+ status: { eq: $status }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ title
+ status
+ createdAt
+
+ workforce { id workforceNumber staff { id fullName } }
+
+ shiftRole {
+ id
+ role { id name }
+ shift { id title date location status }
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/attireOption/mutations.gql b/backend/dataconnect/connector/attireOption/mutations.gql
new file mode 100644
index 00000000..59f4f7f9
--- /dev/null
+++ b/backend/dataconnect/connector/attireOption/mutations.gql
@@ -0,0 +1,45 @@
+mutation createAttireOption(
+ $itemId: String!
+ $label: String!
+ $icon: String
+ $imageUrl: String
+ $isMandatory: Boolean
+ $vendorId: UUID
+) @auth(level: USER) {
+ attireOption_insert(
+ data: {
+ itemId: $itemId
+ label: $label
+ icon: $icon
+ imageUrl: $imageUrl
+ isMandatory: $isMandatory
+ vendorId: $vendorId
+ }
+ )
+}
+
+mutation updateAttireOption(
+ $id: UUID!
+ $itemId: String
+ $label: String
+ $icon: String
+ $imageUrl: String
+ $isMandatory: Boolean
+ $vendorId: UUID
+) @auth(level: USER) {
+ attireOption_update(
+ id: $id
+ data: {
+ itemId: $itemId
+ label: $label
+ icon: $icon
+ imageUrl: $imageUrl
+ isMandatory: $isMandatory
+ vendorId: $vendorId
+ }
+ )
+}
+
+mutation deleteAttireOption($id: UUID!) @auth(level: USER) {
+ attireOption_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/attireOption/queries.gql b/backend/dataconnect/connector/attireOption/queries.gql
new file mode 100644
index 00000000..76ce2817
--- /dev/null
+++ b/backend/dataconnect/connector/attireOption/queries.gql
@@ -0,0 +1,47 @@
+query listAttireOptions @auth(level: USER) {
+ attireOptions {
+ id
+ itemId
+ label
+ icon
+ imageUrl
+ isMandatory
+ vendorId
+ createdAt
+ }
+}
+
+query getAttireOptionById($id: UUID!) @auth(level: USER) {
+ attireOption(id: $id) {
+ id
+ itemId
+ label
+ icon
+ imageUrl
+ isMandatory
+ vendorId
+ createdAt
+ }
+}
+
+query filterAttireOptions(
+ $itemId: String
+ $isMandatory: Boolean
+ $vendorId: UUID
+) @auth(level: USER) {
+ attireOptions(
+ where: {
+ itemId: { eq: $itemId }
+ isMandatory: { eq: $isMandatory }
+ vendorId: { eq: $vendorId }
+ }
+ ) {
+ id
+ itemId
+ label
+ icon
+ imageUrl
+ isMandatory
+ vendorId
+ }
+}
diff --git a/backend/dataconnect/connector/benefitsData/mutations.gql b/backend/dataconnect/connector/benefitsData/mutations.gql
new file mode 100644
index 00000000..bd554b01
--- /dev/null
+++ b/backend/dataconnect/connector/benefitsData/mutations.gql
@@ -0,0 +1,36 @@
+
+mutation createBenefitsData(
+ $vendorBenefitPlanId: UUID!
+ $staffId: UUID!
+ $current: Int!
+) @auth(level: USER) {
+ benefitsData_insert(
+ data: {
+ vendorBenefitPlanId: $vendorBenefitPlanId
+ staffId: $staffId
+ current: $current
+ }
+ )
+}
+
+mutation updateBenefitsData(
+ $staffId: UUID!
+ $vendorBenefitPlanId: UUID!
+ $current: Int
+) @auth(level: USER) {
+ benefitsData_update(
+ key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }
+ data: {
+ current: $current
+ }
+ )
+}
+
+mutation deleteBenefitsData(
+ $staffId: UUID!
+ $vendorBenefitPlanId: UUID!
+) @auth(level: USER) {
+ benefitsData_delete(
+ key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }
+ )
+}
diff --git a/backend/dataconnect/connector/benefitsData/queries.gql b/backend/dataconnect/connector/benefitsData/queries.gql
new file mode 100644
index 00000000..2bc60a37
--- /dev/null
+++ b/backend/dataconnect/connector/benefitsData/queries.gql
@@ -0,0 +1,165 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listBenefitsData(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ benefitsDatas(offset: $offset, limit: $limit) {
+ id
+ vendorBenefitPlanId
+ current
+ staffId
+
+ staff {
+ id
+ fullName
+ }
+
+ vendorBenefitPlan {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY KEY (staffId + vendorBenefitPlanId) ✅ (replaces getById in practice)
+# ----------------------------------------------------------
+query getBenefitsDataByKey(
+ $staffId: UUID!
+ $vendorBenefitPlanId: UUID!
+) @auth(level: USER) {
+ benefitsData(key: { staffId: $staffId, vendorBenefitPlanId: $vendorBenefitPlanId }) {
+ id
+ vendorBenefitPlanId
+ current
+ staffId
+
+ staff {
+ id
+ fullName
+ }
+
+ vendorBenefitPlan {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY STAFF
+# ----------------------------------------------------------
+query listBenefitsDataByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ benefitsDatas(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorBenefitPlanId
+ current
+ staffId
+
+ staff {
+ id
+ fullName
+ }
+
+ vendorBenefitPlan {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY VENDOR BENEFIT PLAN
+# ----------------------------------------------------------
+query listBenefitsDataByVendorBenefitPlanId(
+ $vendorBenefitPlanId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ benefitsDatas(
+ where: { vendorBenefitPlanId: { eq: $vendorBenefitPlanId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorBenefitPlanId
+ current
+ staffId
+
+ staff {
+ id
+ fullName
+ }
+
+ vendorBenefitPlan {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY VENDOR (2-step helper: planIds -> benefitsDatas IN)
+# ----------------------------------------------------------
+query listBenefitsDataByVendorBenefitPlanIds(
+ $vendorBenefitPlanIds: [UUID!]!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ benefitsDatas(
+ where: { vendorBenefitPlanId: { in: $vendorBenefitPlanIds } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorBenefitPlanId
+ current
+ staffId
+
+ staff {
+ id
+ fullName
+ }
+
+ vendorBenefitPlan {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/business/mutations.gql b/backend/dataconnect/connector/business/mutations.gql
new file mode 100644
index 00000000..437527d6
--- /dev/null
+++ b/backend/dataconnect/connector/business/mutations.gql
@@ -0,0 +1,75 @@
+mutation createBusiness(
+ $businessName: String!,
+ $contactName: String,
+ $userId: String!,
+ $companyLogoUrl: String,
+ $phone: String,
+ $email: String,
+ $hubBuilding: String,
+ $address: String,
+ $city: String,
+ $area: BusinessArea,
+ $sector: BusinessSector,
+ $rateGroup: BusinessRateGroup!,
+ $status: BusinessStatus!,
+ $notes: String
+) @auth(level: USER) {
+ business_insert(
+ data: {
+ businessName: $businessName,
+ contactName: $contactName,
+ userId: $userId,
+ companyLogoUrl: $companyLogoUrl,
+ phone: $phone,
+ email: $email,
+ hubBuilding: $hubBuilding,
+ address: $address,
+ city: $city,
+ area: $area,
+ sector: $sector,
+ rateGroup: $rateGroup,
+ status: $status,
+ notes: $notes
+ }
+ )
+}
+
+mutation updateBusiness(
+ $id: UUID!,
+ $businessName: String,
+ $contactName: String,
+ $companyLogoUrl: String,
+ $phone: String,
+ $email: String,
+ $hubBuilding: String,
+ $address: String,
+ $city: String,
+ $area: BusinessArea,
+ $sector: BusinessSector,
+ $rateGroup: BusinessRateGroup,
+ $status: BusinessStatus,
+ $notes: String
+) @auth(level: USER) {
+ business_update(
+ id: $id,
+ data: {
+ businessName: $businessName,
+ contactName: $contactName,
+ companyLogoUrl: $companyLogoUrl,
+ phone: $phone,
+ email: $email,
+ hubBuilding: $hubBuilding,
+ address: $address,
+ city: $city,
+ area: $area,
+ sector: $sector,
+ rateGroup: $rateGroup,
+ status: $status,
+ notes: $notes
+ }
+ )
+}
+
+mutation deleteBusiness($id: UUID!) @auth(level: USER) {
+ business_delete(id: $id)
+}
\ No newline at end of file
diff --git a/backend/dataconnect/connector/business/queries.gql b/backend/dataconnect/connector/business/queries.gql
new file mode 100644
index 00000000..8484fce0
--- /dev/null
+++ b/backend/dataconnect/connector/business/queries.gql
@@ -0,0 +1,65 @@
+query listBusinesses @auth(level: USER) {
+ businesses {
+ id
+ businessName
+ contactName
+ userId
+ companyLogoUrl
+ phone
+ email
+ hubBuilding
+ address
+ city
+ area
+ sector
+ rateGroup
+ status
+ notes
+ createdAt
+ updatedAt
+ }
+}
+
+query getBusinessesByUserId($userId: String!) @auth(level: USER) {
+ businesses(where: { userId: { eq: $userId } }) {
+ id
+ businessName
+ contactName
+ userId
+ companyLogoUrl
+ phone
+ email
+ hubBuilding
+ address
+ city
+ area
+ sector
+ rateGroup
+ status
+ notes
+ createdAt
+ updatedAt
+ }
+}
+
+query getBusinessById($id: UUID!) @auth(level: USER) {
+ business(id: $id) {
+ id
+ businessName
+ contactName
+ userId
+ companyLogoUrl
+ phone
+ email
+ hubBuilding
+ address
+ city
+ area
+ sector
+ rateGroup
+ status
+ notes
+ createdAt
+ updatedAt
+ }
+}
\ No newline at end of file
diff --git a/backend/dataconnect/connector/category/mutations.gql b/backend/dataconnect/connector/category/mutations.gql
new file mode 100644
index 00000000..f143f01f
--- /dev/null
+++ b/backend/dataconnect/connector/category/mutations.gql
@@ -0,0 +1,34 @@
+mutation createCategory(
+ $categoryId: String!
+ $label: String!
+ $icon: String
+) @auth(level: USER) {
+ category_insert(
+ data: {
+ categoryId: $categoryId
+ label: $label
+ icon: $icon
+ }
+ )
+}
+
+mutation updateCategory(
+ $id: UUID!
+ $categoryId: String
+ $label: String
+ $icon: String
+) @auth(level: USER) {
+ category_update(
+ id: $id
+ data: {
+ categoryId: $categoryId
+ label: $label
+ icon: $icon
+ }
+ )
+}
+
+
+mutation deleteCategory($id: UUID!) @auth(level: USER) {
+ category_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/category/queries.gql b/backend/dataconnect/connector/category/queries.gql
new file mode 100644
index 00000000..3a4b2d02
--- /dev/null
+++ b/backend/dataconnect/connector/category/queries.gql
@@ -0,0 +1,43 @@
+query listCategories @auth(level: USER) {
+ categories {
+ id
+ categoryId
+ label
+ icon
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getCategoryById($id: UUID!) @auth(level: USER) {
+ category(id: $id) {
+ id
+ categoryId
+ label
+ icon
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterCategories(
+ $categoryId: String
+ $label: String
+) @auth(level: USER) {
+ categories(
+ where: {
+ categoryId: { eq: $categoryId }
+ label: { eq: $label }
+ }
+ ) {
+ id
+ categoryId
+ label
+ icon
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
diff --git a/backend/dataconnect/connector/certificate/mutations.gql b/backend/dataconnect/connector/certificate/mutations.gql
new file mode 100644
index 00000000..6fc8128a
--- /dev/null
+++ b/backend/dataconnect/connector/certificate/mutations.gql
@@ -0,0 +1,65 @@
+mutation CreateCertificate(
+ $name: String!
+ $description: String
+ $expiry: Timestamp
+ $status: CertificateStatus!
+ $fileUrl: String
+ $icon: String
+ $certificationType: ComplianceType
+ $issuer: String
+ $staffId: UUID!
+ $validationStatus: ValidationStatus
+ $certificateNumber: String
+) @auth(level: USER) {
+ certificate_insert(
+ data: {
+ name: $name
+ description: $description
+ expiry: $expiry
+ status: $status
+ fileUrl: $fileUrl
+ icon: $icon
+ staffId: $staffId
+ certificationType: $certificationType
+ issuer: $issuer
+ validationStatus: $validationStatus
+ certificateNumber: $certificateNumber
+ }
+ )
+}
+
+mutation UpdateCertificate(
+ $id: UUID!
+ $name: String
+ $description: String
+ $expiry: Timestamp
+ $status: CertificateStatus
+ $fileUrl: String
+ $icon: String
+ $staffId: UUID
+ $certificationType: ComplianceType
+ $issuer: String
+ $validationStatus: ValidationStatus
+ $certificateNumber: String
+) @auth(level: USER) {
+ certificate_update(
+ id: $id
+ data: {
+ name: $name
+ description: $description
+ expiry: $expiry
+ status: $status
+ fileUrl: $fileUrl
+ icon: $icon
+ staffId: $staffId
+ certificationType: $certificationType
+ issuer: $issuer
+ validationStatus: $validationStatus
+ certificateNumber: $certificateNumber
+ }
+ )
+}
+
+mutation DeleteCertificate($id: UUID!) @auth(level: USER) {
+ certificate_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/certificate/queries.gql b/backend/dataconnect/connector/certificate/queries.gql
new file mode 100644
index 00000000..f154e34b
--- /dev/null
+++ b/backend/dataconnect/connector/certificate/queries.gql
@@ -0,0 +1,72 @@
+query listCertificates @auth(level: USER) {
+ certificates {
+ id
+ name
+ description
+ expiry
+ status
+ fileUrl
+ icon
+ staffId
+ certificationType
+ issuer
+ validationStatus
+ certificateNumber
+ createdAt
+
+ staff {
+ id
+ fullName
+ }
+
+ }
+}
+
+query getCertificateById($id: UUID!) @auth(level: USER) {
+ certificate(id: $id) {
+ id
+ name
+ description
+ expiry
+ status
+ fileUrl
+ icon
+ certificationType
+ issuer
+ staffId
+ validationStatus
+ certificateNumber
+ updatedAt
+
+ staff {
+ id
+ fullName
+ }
+
+ }
+}
+
+query listCertificatesByStaffId($staffId: UUID!) @auth(level: USER) {
+ certificates(where: { staffId: { eq: $staffId } }) {
+ id
+ name
+ description
+ expiry
+ status
+ fileUrl
+ icon
+ staffId
+ certificationType
+ issuer
+ validationStatus
+ certificateNumber
+ createdAt
+
+ staff {
+ id
+ fullName
+ }
+
+ }
+}
+
diff --git a/backend/dataconnect/connector/clientFeedback/mutations.gql b/backend/dataconnect/connector/clientFeedback/mutations.gql
new file mode 100644
index 00000000..c9c2e63b
--- /dev/null
+++ b/backend/dataconnect/connector/clientFeedback/mutations.gql
@@ -0,0 +1,43 @@
+mutation createClientFeedback(
+ $businessId: UUID!
+ $vendorId: UUID!
+ $rating: Int
+ $comment: String
+ $date: Timestamp
+ $createdBy: String
+) @auth(level: USER) {
+ clientFeedback_insert(
+ data: {
+ businessId: $businessId
+ vendorId: $vendorId
+ rating: $rating
+ comment: $comment
+ date: $date
+ }
+ )
+}
+
+mutation updateClientFeedback(
+ $id: UUID!
+ $businessId: UUID
+ $vendorId: UUID
+ $rating: Int
+ $comment: String
+ $date: Timestamp
+ $createdBy: String
+) @auth(level: USER) {
+ clientFeedback_update(
+ id: $id
+ data: {
+ businessId: $businessId
+ vendorId: $vendorId
+ rating: $rating
+ comment: $comment
+ date: $date
+ }
+ )
+}
+
+mutation deleteClientFeedback($id: UUID!) @auth(level: USER) {
+ clientFeedback_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/clientFeedback/queries.gql b/backend/dataconnect/connector/clientFeedback/queries.gql
new file mode 100644
index 00000000..9a8702ba
--- /dev/null
+++ b/backend/dataconnect/connector/clientFeedback/queries.gql
@@ -0,0 +1,185 @@
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listClientFeedbacks(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ clientFeedbacks(offset: $offset, limit: $limit) {
+ id
+ businessId
+ vendorId
+ rating
+ comment
+ date
+ createdAt
+
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY ID
+# ----------------------------------------------------------
+query getClientFeedbackById($id: UUID!) @auth(level: USER) {
+ clientFeedback(id: $id) {
+ id
+ businessId
+ vendorId
+ rating
+ comment
+ date
+ createdAt
+
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY BUSINESS
+# ----------------------------------------------------------
+query listClientFeedbacksByBusinessId(
+ $businessId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ clientFeedbacks(
+ where: { businessId: { eq: $businessId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ businessId
+ vendorId
+ rating
+ comment
+ date
+ createdAt
+
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY VENDOR
+# ----------------------------------------------------------
+query listClientFeedbacksByVendorId(
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ clientFeedbacks(
+ where: { vendorId: { eq: $vendorId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ businessId
+ vendorId
+ rating
+ comment
+ date
+ createdAt
+
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY BUSINESS + VENDOR (pair)
+# ----------------------------------------------------------
+query listClientFeedbacksByBusinessAndVendor(
+ $businessId: UUID!
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ clientFeedbacks(
+ where: {
+ businessId: { eq: $businessId }
+ vendorId: { eq: $vendorId }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ businessId
+ vendorId
+ rating
+ comment
+ date
+ createdAt
+
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (rating + date range)
+# NOTE: using Timestamp ops: ge/le
+# ----------------------------------------------------------
+query filterClientFeedbacks(
+ $businessId: UUID
+ $vendorId: UUID
+ $ratingMin: Int
+ $ratingMax: Int
+ $dateFrom: Timestamp
+ $dateTo: Timestamp
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ clientFeedbacks(
+ where: {
+ businessId: { eq: $businessId }
+ vendorId: { eq: $vendorId }
+ rating: { ge: $ratingMin, le: $ratingMax }
+ date: { ge: $dateFrom, le: $dateTo }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { date: DESC }
+ ) {
+ id
+ businessId
+ vendorId
+ rating
+ comment
+ date
+
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
+
+# ----------------------------------------------------------
+# QUICK KPI: average rating for a vendor (client-side aggregate)
+# You fetch rows; Flutter/web computes avg.
+# ----------------------------------------------------------
+query listClientFeedbackRatingsByVendorId(
+ $vendorId: UUID!
+ $dateFrom: Timestamp
+ $dateTo: Timestamp
+) @auth(level: USER) {
+ clientFeedbacks(
+ where: {
+ vendorId: { eq: $vendorId }
+ date: { ge: $dateFrom, le: $dateTo }
+ }
+ orderBy: { date: DESC }
+ ) {
+ id
+ rating
+ comment
+ date
+ business { id businessName }
+ vendor { id companyName }
+ }
+}
diff --git a/backend/dataconnect/connector/connector.yaml b/backend/dataconnect/connector/connector.yaml
new file mode 100644
index 00000000..63b999ce
--- /dev/null
+++ b/backend/dataconnect/connector/connector.yaml
@@ -0,0 +1,7 @@
+connectorId: example
+generate:
+ dartSdk:
+ - outputDir: ../../mobile/staff/staff_app_mvp/lib/dataconnect_generated
+ package: dataconnect_generated/generated.dart
+ - outputDir: ../../mobile/client/client_app_mvp/lib/dataconnect_generated
+ package: dataconnect_generated/generated.dart
diff --git a/backend/dataconnect/connector/conversation/mutations.gql b/backend/dataconnect/connector/conversation/mutations.gql
new file mode 100644
index 00000000..304aa37f
--- /dev/null
+++ b/backend/dataconnect/connector/conversation/mutations.gql
@@ -0,0 +1,69 @@
+
+mutation createConversation(
+ $subject: String
+ $status: ConversationStatus
+ $conversationType: ConversationType
+ $isGroup: Boolean
+ $groupName: String
+ $lastMessage: String
+ $lastMessageAt: Timestamp
+) @auth(level: USER) {
+ conversation_insert(
+ data: {
+ subject: $subject
+ status: $status
+ conversationType: $conversationType
+ isGroup: $isGroup
+ groupName: $groupName
+ lastMessage: $lastMessage
+ lastMessageAt: $lastMessageAt
+ }
+ )
+}
+
+mutation updateConversation(
+ $id: UUID!
+
+ $subject: String
+ $status: ConversationStatus
+ $conversationType: ConversationType
+ $isGroup: Boolean
+ $groupName: String
+ $lastMessage: String
+ $lastMessageAt: Timestamp
+
+) @auth(level: USER) {
+ conversation_update(
+ id: $id
+ data: {
+ subject: $subject
+ status: $status
+ conversationType: $conversationType
+ isGroup: $isGroup
+ groupName: $groupName
+ lastMessage: $lastMessage
+ lastMessageAt: $lastMessageAt
+ }
+ )
+}
+
+# ----------------------------------------------------------
+# UPDATE LAST MESSAGE
+# ----------------------------------------------------------
+mutation updateConversationLastMessage(
+ $id: UUID!
+ $lastMessage: String
+ $lastMessageAt: Timestamp
+) @auth(level: USER) {
+ conversation_update(
+ id: $id
+ data: {
+ lastMessage: $lastMessage
+ lastMessageAt: $lastMessageAt
+ }
+ )
+}
+
+mutation deleteConversation($id: UUID!) @auth(level: USER) {
+ conversation_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/conversation/queries.gql b/backend/dataconnect/connector/conversation/queries.gql
new file mode 100644
index 00000000..e45cf6b6
--- /dev/null
+++ b/backend/dataconnect/connector/conversation/queries.gql
@@ -0,0 +1,125 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listConversations(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ conversations(offset: $offset, limit: $limit, orderBy: { updatedAt: DESC }) {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY ID
+# ----------------------------------------------------------
+query getConversationById($id: UUID!) @auth(level: USER) {
+ conversation(id: $id) {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY TYPE (CLIENT_VENDOR / GROUP_STAFF)
+# ----------------------------------------------------------
+query listConversationsByType(
+ $conversationType: ConversationType!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ conversations(
+ where: { conversationType: { eq: $conversationType } }
+ offset: $offset
+ limit: $limit
+ orderBy: { lastMessageAt: DESC }
+ ) {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY STATUS (ACTIVE)
+# ----------------------------------------------------------
+query listConversationsByStatus(
+ $status: ConversationStatus!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ conversations(
+ where: { status: { eq: $status } }
+ offset: $offset
+ limit: $limit
+ orderBy: { lastMessageAt: DESC }
+ ) {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (dashboard/debug)
+# Supports searching by multiple optional fields
+# ----------------------------------------------------------
+query filterConversations(
+ $status: ConversationStatus
+ $conversationType: ConversationType
+ $isGroup: Boolean
+ $lastMessageAfter: Timestamp
+ $lastMessageBefore: Timestamp
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ conversations(
+ where: {
+ status: { eq: $status }
+ conversationType: { eq: $conversationType }
+ isGroup: { eq: $isGroup }
+ lastMessageAt: { ge: $lastMessageAfter, le: $lastMessageBefore }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { lastMessageAt: DESC }
+ ) {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+}
diff --git a/backend/dataconnect/connector/course/mutations.gql b/backend/dataconnect/connector/course/mutations.gql
new file mode 100644
index 00000000..71423710
--- /dev/null
+++ b/backend/dataconnect/connector/course/mutations.gql
@@ -0,0 +1,53 @@
+mutation createCourse(
+ $title: String
+ $description: String
+ $thumbnailUrl: String
+ $durationMinutes: Int
+ $xpReward: Int
+ $categoryId: UUID!
+ $levelRequired: String
+ $isCertification: Boolean
+) @auth(level: USER) {
+ course_insert(
+ data: {
+ title: $title
+ description: $description
+ thumbnailUrl: $thumbnailUrl
+ durationMinutes: $durationMinutes
+ xpReward: $xpReward
+ categoryId: $categoryId
+ levelRequired: $levelRequired
+ isCertification: $isCertification
+ }
+ )
+}
+
+mutation updateCourse(
+ $id: UUID!
+ $title: String
+ $description: String
+ $thumbnailUrl: String
+ $durationMinutes: Int
+ $xpReward: Int
+ $categoryId: UUID!
+ $levelRequired: String
+ $isCertification: Boolean
+) @auth(level: USER) {
+ course_update(
+ id: $id
+ data: {
+ title: $title
+ description: $description
+ thumbnailUrl: $thumbnailUrl
+ durationMinutes: $durationMinutes
+ xpReward: $xpReward
+ categoryId: $categoryId
+ levelRequired: $levelRequired
+ isCertification: $isCertification
+ }
+ )
+}
+
+mutation deleteCourse($id: UUID!) @auth(level: USER) {
+ course_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/course/queries.gql b/backend/dataconnect/connector/course/queries.gql
new file mode 100644
index 00000000..2e6d8552
--- /dev/null
+++ b/backend/dataconnect/connector/course/queries.gql
@@ -0,0 +1,68 @@
+query listCourses @auth(level: USER) {
+ courses {
+ id
+ title
+ description
+ thumbnailUrl
+ durationMinutes
+ xpReward
+ categoryId
+ levelRequired
+ isCertification
+ createdAt
+
+ category{
+ id
+ label
+ }
+
+ }
+}
+
+query getCourseById($id: UUID!) @auth(level: USER) {
+ course(id: $id) {
+ id
+ title
+ description
+ thumbnailUrl
+ durationMinutes
+ xpReward
+ categoryId
+ levelRequired
+ isCertification
+ createdAt
+
+ category{
+ id
+ label
+ }
+
+ }
+}
+
+query filterCourses(
+ $categoryId: UUID
+ $isCertification: Boolean
+ $levelRequired: String
+ $completed: Boolean
+) @auth(level: USER) {
+ courses(
+ where: {
+ categoryId: { eq: $categoryId }
+ isCertification: { eq: $isCertification }
+ levelRequired: { eq: $levelRequired }
+ }
+ ) {
+ id
+ title
+ categoryId
+ levelRequired
+ isCertification
+
+ category{
+ id
+ label
+ }
+
+ }
+}
diff --git a/backend/dataconnect/connector/customRateCard/mutations.gql b/backend/dataconnect/connector/customRateCard/mutations.gql
new file mode 100644
index 00000000..4b212962
--- /dev/null
+++ b/backend/dataconnect/connector/customRateCard/mutations.gql
@@ -0,0 +1,37 @@
+mutation createCustomRateCard(
+ $name: String!,
+ $baseBook: String,
+ $discount: Float,
+ $isDefault: Boolean
+) @auth(level: USER) {
+ customRateCard_insert(
+ data: {
+ name: $name,
+ baseBook: $baseBook,
+ discount: $discount,
+ isDefault: $isDefault
+ }
+ )
+}
+
+mutation updateCustomRateCard(
+ $id: UUID!,
+ $name: String,
+ $baseBook: String,
+ $discount: Float,
+ $isDefault: Boolean
+) @auth(level: USER) {
+ customRateCard_update(
+ id: $id,
+ data: {
+ name: $name,
+ baseBook: $baseBook,
+ discount: $discount,
+ isDefault: $isDefault
+ }
+ )
+}
+
+mutation deleteCustomRateCard($id: UUID!) @auth(level: USER) {
+ customRateCard_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/customRateCard/queries.gql b/backend/dataconnect/connector/customRateCard/queries.gql
new file mode 100644
index 00000000..e110c349
--- /dev/null
+++ b/backend/dataconnect/connector/customRateCard/queries.gql
@@ -0,0 +1,23 @@
+query listCustomRateCards @auth(level: USER) {
+ customRateCards {
+ id
+ name
+ baseBook
+ discount
+ isDefault
+ createdAt
+ updatedAt
+ }
+}
+
+query getCustomRateCardById($id: UUID!) @auth(level: USER) {
+ customRateCard(id: $id) {
+ id
+ name
+ baseBook
+ discount
+ isDefault
+ createdAt
+ updatedAt
+ }
+}
diff --git a/backend/dataconnect/connector/document/mutations.gql b/backend/dataconnect/connector/document/mutations.gql
new file mode 100644
index 00000000..74055a4e
--- /dev/null
+++ b/backend/dataconnect/connector/document/mutations.gql
@@ -0,0 +1,33 @@
+mutation createDocument(
+ $documentType: DocumentType!
+ $name: String!
+ $description: String
+) @auth(level: USER) {
+ document_insert(
+ data: {
+ documentType: $documentType
+ name: $name
+ description: $description
+ }
+ )
+}
+
+mutation updateDocument(
+ $id: UUID!
+ $documentType: DocumentType
+ $name: String
+ $description: String
+) @auth(level: USER) {
+ document_update(
+ id: $id
+ data: {
+ documentType: $documentType
+ name: $name
+ description: $description
+ }
+ )
+}
+
+mutation deleteDocument($id: UUID!) @auth(level: USER) {
+ document_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/document/queries.gql b/backend/dataconnect/connector/document/queries.gql
new file mode 100644
index 00000000..b44c1ce3
--- /dev/null
+++ b/backend/dataconnect/connector/document/queries.gql
@@ -0,0 +1,35 @@
+query listDocuments @auth(level: USER) {
+ documents {
+ id
+ documentType
+ name
+ description
+ createdAt
+ }
+}
+
+query getDocumentById($id: UUID!) @auth(level: USER) {
+ document(id: $id) {
+ id
+ documentType
+ name
+ description
+ createdAt
+ }
+}
+
+query filterDocuments(
+ $documentType: DocumentType
+) @auth(level: USER) {
+ documents(
+ where: {
+ documentType: { eq: $documentType }
+ }
+ ) {
+ id
+ documentType
+ name
+ description
+ createdAt
+ }
+}
diff --git a/backend/dataconnect/connector/emergencyContact/mutations.gql b/backend/dataconnect/connector/emergencyContact/mutations.gql
new file mode 100644
index 00000000..9148f685
--- /dev/null
+++ b/backend/dataconnect/connector/emergencyContact/mutations.gql
@@ -0,0 +1,35 @@
+mutation createEmergencyContact(
+ $name: String!
+ $phone: String!
+ $relationship: RelationshipType!
+ $staffId: UUID!
+) @auth(level: USER) {
+ emergencyContact_insert(
+ data: {
+ name: $name
+ phone: $phone
+ relationship: $relationship
+ staffId: $staffId
+ }
+ )
+}
+
+mutation updateEmergencyContact(
+ $id: UUID!
+ $name: String
+ $phone: String
+ $relationship: RelationshipType
+) @auth(level: USER) {
+ emergencyContact_update(
+ id: $id
+ data: {
+ name: $name
+ phone: $phone
+ relationship: $relationship
+ }
+ )
+}
+
+mutation deleteEmergencyContact($id: UUID!) @auth(level: USER) {
+ emergencyContact_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/emergencyContact/queries.gql b/backend/dataconnect/connector/emergencyContact/queries.gql
new file mode 100644
index 00000000..65777051
--- /dev/null
+++ b/backend/dataconnect/connector/emergencyContact/queries.gql
@@ -0,0 +1,38 @@
+query listEmergencyContacts @auth(level: USER) {
+ emergencyContacts {
+ id
+ name
+ phone
+ relationship
+ staffId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getEmergencyContactById($id: UUID!) @auth(level: USER) {
+ emergencyContact(id: $id) {
+ id
+ name
+ phone
+ relationship
+ staffId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getEmergencyContactsByStaffId($staffId: UUID!) @auth(level: USER) {
+ emergencyContacts(where: { staffId: { eq: $staffId } }) {
+ id
+ name
+ phone
+ relationship
+ staffId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
diff --git a/backend/dataconnect/connector/faqData/mutations.gql b/backend/dataconnect/connector/faqData/mutations.gql
new file mode 100644
index 00000000..720be3c3
--- /dev/null
+++ b/backend/dataconnect/connector/faqData/mutations.gql
@@ -0,0 +1,29 @@
+mutation createFaqData(
+ $category: String!
+ $questions: [Any!]
+) @auth(level: USER) {
+ faqData_insert(
+ data: {
+ category: $category
+ questions: $questions
+ }
+ )
+}
+
+mutation updateFaqData(
+ $id: UUID!
+ $category: String
+ $questions: [Any!]
+) @auth(level: USER) {
+ faqData_update(
+ id: $id
+ data: {
+ category: $category
+ questions: $questions
+ }
+ )
+}
+
+mutation deleteFaqData($id: UUID!) @auth(level: USER) {
+ faqData_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/faqData/queries.gql b/backend/dataconnect/connector/faqData/queries.gql
new file mode 100644
index 00000000..3a3c77d3
--- /dev/null
+++ b/backend/dataconnect/connector/faqData/queries.gql
@@ -0,0 +1,29 @@
+query listFaqDatas @auth(level: USER) {
+ faqDatas {
+ id
+ category
+ questions
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getFaqDataById($id: UUID!) @auth(level: USER) {
+ faqData(id: $id) {
+ id
+ category
+ questions
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterFaqDatas($category: String) @auth(level: USER) {
+ faqDatas(where: { category: { eq: $category } }) {
+ id
+ category
+ questions
+ }
+}
diff --git a/backend/dataconnect/connector/hub/mutations.gql b/backend/dataconnect/connector/hub/mutations.gql
new file mode 100644
index 00000000..bf7b0c18
--- /dev/null
+++ b/backend/dataconnect/connector/hub/mutations.gql
@@ -0,0 +1,41 @@
+mutation createHub(
+ $name: String!
+ $locationName: String
+ $address: String
+ $nfcTagId: String
+ $ownerId: UUID!
+) @auth(level: USER) {
+ hub_insert(
+ data: {
+ name: $name
+ locationName: $locationName
+ address: $address
+ nfcTagId: $nfcTagId
+ ownerId: $ownerId
+ }
+ )
+}
+
+mutation updateHub(
+ $id: UUID!
+ $name: String
+ $locationName: String
+ $address: String
+ $nfcTagId: String
+ $ownerId: UUID
+) @auth(level: USER) {
+ hub_update(
+ id: $id
+ data: {
+ name: $name
+ locationName: $locationName
+ address: $address
+ nfcTagId: $nfcTagId
+ ownerId: $ownerId
+ }
+ )
+}
+
+mutation deleteHub($id: UUID!) @auth(level: USER) {
+ hub_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/hub/queries.gql b/backend/dataconnect/connector/hub/queries.gql
new file mode 100644
index 00000000..dc2a69c9
--- /dev/null
+++ b/backend/dataconnect/connector/hub/queries.gql
@@ -0,0 +1,62 @@
+query listHubs @auth(level: USER) {
+ hubs {
+ id
+ name
+ locationName
+ address
+ nfcTagId
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getHubById($id: UUID!) @auth(level: USER) {
+ hub(id: $id) {
+ id
+ name
+ locationName
+ address
+ nfcTagId
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getHubsByOwnerId($ownerId: UUID!) @auth(level: USER) {
+ hubs(where: { ownerId: { eq: $ownerId } }) {
+ id
+ name
+ locationName
+ address
+ nfcTagId
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterHubs(
+ $ownerId: UUID
+ $name: String
+ $nfcTagId: String
+) @auth(level: USER) {
+ hubs(
+ where: {
+ ownerId: { eq: $ownerId }
+ name: { eq: $name }
+ nfcTagId: { eq: $nfcTagId }
+ }
+ ) {
+ id
+ name
+ locationName
+ address
+ nfcTagId
+ ownerId
+ }
+}
diff --git a/backend/dataconnect/connector/invoice/mutations.gql b/backend/dataconnect/connector/invoice/mutations.gql
new file mode 100644
index 00000000..53af2552
--- /dev/null
+++ b/backend/dataconnect/connector/invoice/mutations.gql
@@ -0,0 +1,123 @@
+
+mutation createInvoice(
+ $status: InvoiceStatus!
+
+ $vendorId: UUID!
+ $businessId: UUID!
+ $orderId: UUID!
+
+ $paymentTerms: InovicePaymentTerms
+ $invoiceNumber: String!
+ $issueDate: Timestamp!
+ $dueDate: Timestamp!
+ $hub: String
+ $managerName: String
+ $vendorNumber: String
+ $roles: Any
+ $charges: Any
+ $otherCharges: Float
+ $subtotal: Float
+ $amount: Float!
+ $notes: String
+
+ $staffCount: Int
+ $chargesCount: Int
+
+) @auth(level: USER) {
+ invoice_insert(
+ data: {
+ status: $status
+
+ vendorId: $vendorId
+ businessId: $businessId
+ orderId: $orderId
+
+ paymentTerms: $paymentTerms
+ invoiceNumber: $invoiceNumber
+ issueDate: $issueDate
+ dueDate: $dueDate
+ hub: $hub
+ managerName: $managerName
+ vendorNumber: $vendorNumber
+ roles: $roles
+ charges: $charges
+ otherCharges: $otherCharges
+ subtotal: $subtotal
+ amount: $amount
+ notes: $notes
+
+ staffCount: $staffCount
+ chargesCount: $chargesCount
+
+ }
+ )
+}
+
+mutation updateInvoice(
+ $id: UUID!
+
+ $status: InvoiceStatus
+
+ $vendorId: UUID
+ $businessId: UUID
+ $orderId: UUID
+
+ $paymentTerms: InovicePaymentTerms
+ $invoiceNumber: String
+ $issueDate: Timestamp
+ $dueDate: Timestamp
+ $hub: String
+ $managerName: String
+ $vendorNumber: String
+ $roles: Any
+ $charges: Any
+ $otherCharges: Float
+ $subtotal: Float
+ $amount: Float
+ $notes: String
+
+ $staffCount: Int
+ $chargesCount: Int
+
+
+ $disputedItems: Any
+ $disputeReason: String
+ $disputeDetails: String
+) @auth(level: USER) {
+ invoice_update(
+ id: $id
+ data: {
+ status: $status
+
+ vendorId: $vendorId
+ businessId: $businessId
+ orderId: $orderId
+
+ paymentTerms: $paymentTerms
+ invoiceNumber: $invoiceNumber
+ issueDate: $issueDate
+ dueDate: $dueDate
+ hub: $hub
+ managerName: $managerName
+ vendorNumber: $vendorNumber
+ roles: $roles
+ charges: $charges
+ otherCharges: $otherCharges
+ subtotal: $subtotal
+ amount: $amount
+ notes: $notes
+
+ staffCount: $staffCount
+ chargesCount: $chargesCount
+
+ disputedItems: $disputedItems
+ disputeReason: $disputeReason
+ disputeDetails: $disputeDetails
+
+ }
+ )
+}
+
+mutation deleteInvoice($id: UUID!) @auth(level: USER) {
+ invoice_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/invoice/queries.gql b/backend/dataconnect/connector/invoice/queries.gql
new file mode 100644
index 00000000..deaf4c3a
--- /dev/null
+++ b/backend/dataconnect/connector/invoice/queries.gql
@@ -0,0 +1,520 @@
+
+# ------------------------------------------------------------
+# LIST ALL INVOICES (admin/debug)
+# ------------------------------------------------------------
+query listInvoices(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(offset: $offset, limit: $limit) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# GET INVOICE BY ID
+# ------------------------------------------------------------
+query getInvoiceById($id: UUID!) @auth(level: USER) {
+ invoice(id: $id) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST INVOICES BY VENDOR
+# ------------------------------------------------------------
+query listInvoicesByVendorId(
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(
+ where: { vendorId: { eq: $vendorId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { issueDate: DESC }
+ ) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST INVOICES BY BUSINESS
+# ------------------------------------------------------------
+query listInvoicesByBusinessId(
+ $businessId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(
+ where: { businessId: { eq: $businessId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { issueDate: DESC }
+ ) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST INVOICES BY ORDER
+# ------------------------------------------------------------
+query listInvoicesByOrderId(
+ $orderId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(
+ where: { orderId: { eq: $orderId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { issueDate: DESC }
+ ) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST INVOICES BY STATUS
+# ------------------------------------------------------------
+query listInvoicesByStatus(
+ $status: InvoiceStatus!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(
+ where: { status: { eq: $status } }
+ offset: $offset
+ limit: $limit
+ orderBy: { dueDate: ASC }
+ ) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# FILTER INVOICES (multi filters)
+# NOTE: Timestamp filters use ge/le (NOT gte/lte)
+# ------------------------------------------------------------
+query filterInvoices(
+ $vendorId: UUID
+ $businessId: UUID
+ $orderId: UUID
+ $status: InvoiceStatus
+
+ $issueDateFrom: Timestamp
+ $issueDateTo: Timestamp
+
+ $dueDateFrom: Timestamp
+ $dueDateTo: Timestamp
+
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(
+ where: {
+ vendorId: { eq: $vendorId }
+ businessId: { eq: $businessId }
+ orderId: { eq: $orderId }
+ status: { eq: $status }
+
+ issueDate: { ge: $issueDateFrom, le: $issueDateTo }
+ dueDate: { ge: $dueDateFrom, le: $dueDateTo }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { issueDate: DESC }
+ ) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# OVERDUE INVOICES (dueDate < now and not PAID)
+# NOTE: request.time works in @default; for filters, pass $now from client
+# ------------------------------------------------------------
+query listOverdueInvoices(
+ $now: Timestamp!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoices(
+ where: {
+ dueDate: { lt: $now }
+ status: { ne: PAID }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { dueDate: ASC }
+ ) {
+ id
+ status
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+
+ staffCount
+ chargesCount
+
+ disputedItems
+ disputeReason
+ disputeDetails
+
+ vendor {
+ companyName
+ address
+ email
+ phone
+ }
+
+ business {
+ businessName
+ address
+ phone
+ email
+ }
+ order {
+ eventName
+ hub
+ deparment
+ poReference
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/invoiceTemplate/mutations.gql b/backend/dataconnect/connector/invoiceTemplate/mutations.gql
new file mode 100644
index 00000000..3bf87c49
--- /dev/null
+++ b/backend/dataconnect/connector/invoiceTemplate/mutations.gql
@@ -0,0 +1,115 @@
+
+mutation createInvoiceTemplate(
+ $name: String!
+ $ownerId: UUID!
+
+ $vendorId: UUID
+ $businessId: UUID
+ $orderId: UUID
+
+ $paymentTerms: InovicePaymentTermsTemp
+ $invoiceNumber: String
+ $issueDate: Timestamp
+ $dueDate: Timestamp
+ $hub: String
+ $managerName: String
+ $vendorNumber: String
+ $roles: Any
+ $charges: Any
+ $otherCharges: Float
+ $subtotal: Float
+ $amount: Float
+ $notes: String
+
+ $staffCount: Int
+ $chargesCount: Int
+) @auth(level: USER) {
+ invoiceTemplate_insert(
+ data: {
+ name: $name
+ ownerId: $ownerId
+
+ vendorId: $vendorId
+ businessId: $businessId
+ orderId: $orderId
+
+ paymentTerms: $paymentTerms
+ invoiceNumber: $invoiceNumber
+ issueDate: $issueDate
+ dueDate: $dueDate
+ hub: $hub
+ managerName: $managerName
+ vendorNumber: $vendorNumber
+ roles: $roles
+ charges: $charges
+ otherCharges: $otherCharges
+ subtotal: $subtotal
+ amount: $amount
+ notes: $notes
+
+ staffCount: $staffCount
+ chargesCount: $chargesCount
+ }
+ )
+}
+
+mutation updateInvoiceTemplate(
+ $id: UUID!
+
+ $name: String
+ $ownerId: UUID
+
+ $vendorId: UUID
+ $businessId: UUID
+ $orderId: UUID
+
+ $paymentTerms: InovicePaymentTermsTemp
+ $invoiceNumber: String
+ $issueDate: Timestamp
+ $dueDate: Timestamp
+ $hub: String
+ $managerName: String
+ $vendorNumber: String
+ $roles: Any
+ $charges: Any
+ $otherCharges: Float
+ $subtotal: Float
+ $amount: Float
+ $notes: String
+
+ $staffCount: Int
+ $chargesCount: Int
+) @auth(level: USER) {
+ invoiceTemplate_update(
+ id: $id
+ data: {
+ name: $name
+ ownerId: $ownerId
+
+ vendorId: $vendorId
+ businessId: $businessId
+ orderId: $orderId
+
+ paymentTerms: $paymentTerms
+ invoiceNumber: $invoiceNumber
+ issueDate: $issueDate
+ dueDate: $dueDate
+ hub: $hub
+ managerName: $managerName
+ vendorNumber: $vendorNumber
+ roles: $roles
+ charges: $charges
+ otherCharges: $otherCharges
+ subtotal: $subtotal
+ amount: $amount
+ notes: $notes
+
+ staffCount: $staffCount
+ chargesCount: $chargesCount
+ }
+ )
+}
+
+mutation deleteInvoiceTemplate($id: UUID!) @auth(level: USER) {
+ invoiceTemplate_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/invoiceTemplate/queries.gql b/backend/dataconnect/connector/invoiceTemplate/queries.gql
new file mode 100644
index 00000000..907ad1d2
--- /dev/null
+++ b/backend/dataconnect/connector/invoiceTemplate/queries.gql
@@ -0,0 +1,325 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listInvoiceTemplates(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoiceTemplates(offset: $offset, limit: $limit) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY ID
+# ----------------------------------------------------------
+query getInvoiceTemplateById($id: UUID!) @auth(level: USER) {
+ invoiceTemplate(id: $id) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY OWNER (my templates)
+# ----------------------------------------------------------
+query listInvoiceTemplatesByOwnerId(
+ $ownerId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoiceTemplates(
+ where: { ownerId: { eq: $ownerId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY VENDOR (templates tied to a vendor)
+# ----------------------------------------------------------
+query listInvoiceTemplatesByVendorId(
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoiceTemplates(
+ where: { vendorId: { eq: $vendorId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY BUSINESS (templates tied to a business)
+# ----------------------------------------------------------
+query listInvoiceTemplatesByBusinessId(
+ $businessId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoiceTemplates(
+ where: { businessId: { eq: $businessId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY ORDER (templates tied to a specific order)
+# ----------------------------------------------------------
+query listInvoiceTemplatesByOrderId(
+ $orderId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoiceTemplates(
+ where: { orderId: { eq: $orderId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
+
+# ----------------------------------------------------------
+# SEARCH (by name) within an owner
+# ----------------------------------------------------------
+query searchInvoiceTemplatesByOwnerAndName(
+ $ownerId: UUID!
+ $name: String!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ invoiceTemplates(
+ where: {
+ ownerId: { eq: $ownerId }
+ name: { eq: $name }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ name
+ ownerId
+
+ vendorId
+ businessId
+ orderId
+
+ paymentTerms
+ invoiceNumber
+ issueDate
+ dueDate
+ hub
+ managerName
+ vendorNumber
+ roles
+ charges
+ otherCharges
+ subtotal
+ amount
+ notes
+ staffCount
+ chargesCount
+
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor { id companyName }
+ business { id businessName email contactName }
+ order { id eventName status orderType }
+ }
+}
diff --git a/backend/dataconnect/connector/level/mutations.gql b/backend/dataconnect/connector/level/mutations.gql
new file mode 100644
index 00000000..4c5b978c
--- /dev/null
+++ b/backend/dataconnect/connector/level/mutations.gql
@@ -0,0 +1,37 @@
+mutation createLevel(
+ $name: String!
+ $xpRequired: Int!
+ $icon: String
+ $colors: Any
+) @auth(level: USER) {
+ level_insert(
+ data: {
+ name: $name
+ xpRequired: $xpRequired
+ icon: $icon
+ colors: $colors
+ }
+ )
+}
+
+mutation updateLevel(
+ $id: UUID!
+ $name: String
+ $xpRequired: Int
+ $icon: String
+ $colors: Any
+) @auth(level: USER) {
+ level_update(
+ id: $id
+ data: {
+ name: $name
+ xpRequired: $xpRequired
+ icon: $icon
+ colors: $colors
+ }
+ )
+}
+
+mutation deleteLevel($id: UUID!) @auth(level: USER) {
+ level_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/level/queries.gql b/backend/dataconnect/connector/level/queries.gql
new file mode 100644
index 00000000..42026e24
--- /dev/null
+++ b/backend/dataconnect/connector/level/queries.gql
@@ -0,0 +1,44 @@
+query listLevels @auth(level: USER) {
+ levels {
+ id
+ name
+ xpRequired
+ icon
+ colors
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getLevelById($id: UUID!) @auth(level: USER) {
+ level(id: $id) {
+ id
+ name
+ xpRequired
+ icon
+ colors
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterLevels(
+ $name: String
+ $xpRequired: Int
+) @auth(level: USER) {
+ levels(
+ where: {
+ name: { eq: $name }
+ xpRequired: { eq: $xpRequired }
+ }
+ ) {
+ id
+ name
+ xpRequired
+ icon
+ colors
+ }
+}
+
diff --git a/backend/dataconnect/connector/memberTask/mutations.gql b/backend/dataconnect/connector/memberTask/mutations.gql
new file mode 100644
index 00000000..d8690742
--- /dev/null
+++ b/backend/dataconnect/connector/memberTask/mutations.gql
@@ -0,0 +1,21 @@
+
+mutation createMemberTask(
+ $teamMemberId: UUID!
+ $taskId: UUID!
+) @auth(level: USER) {
+ memberTask_insert(
+ data: {
+ teamMemberId: $teamMemberId
+ taskId: $taskId
+ }
+ )
+}
+
+mutation deleteMemberTask(
+ $teamMemberId: UUID!
+ $taskId: UUID!
+) @auth(level: USER) {
+ memberTask_delete(
+ key: { teamMemberId: $teamMemberId, taskId: $taskId }
+ )
+}
diff --git a/backend/dataconnect/connector/memberTask/queries.gql b/backend/dataconnect/connector/memberTask/queries.gql
new file mode 100644
index 00000000..0213ea2c
--- /dev/null
+++ b/backend/dataconnect/connector/memberTask/queries.gql
@@ -0,0 +1,77 @@
+
+query getMyTasks($teamMemberId: UUID!) @auth(level: USER) {
+ memberTasks(where: { teamMemberId: { eq: $teamMemberId } }) {
+ id
+ task {
+ id
+ taskName
+ description
+ status
+ dueDate
+ progress
+ priority
+ }
+
+ teamMember{
+
+ user {
+ fullName
+ email
+ }
+
+ }
+
+ }
+}
+
+#before named getMemberTaskByIdKey
+query getMemberTaskByIdKey(
+ $teamMemberId: UUID!
+ $taskId: UUID!
+) @auth(level: USER) {
+ memberTask(key: { teamMemberId: $teamMemberId, taskId: $taskId }) {
+ id
+ task {
+ id
+ taskName
+ description
+ status
+ dueDate
+ progress
+ priority
+ }
+
+ teamMember{
+
+ user {
+ fullName
+ email
+ }
+
+ }
+ }
+}
+
+query getMemberTasksByTaskId($taskId: UUID!) @auth(level: USER) {
+ memberTasks(where: { taskId: { eq: $taskId } }) {
+ id
+ task {
+ id
+ taskName
+ description
+ status
+ dueDate
+ progress
+ priority
+ }
+
+ teamMember{
+
+ user {
+ fullName
+ email
+ }
+
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/message/mutations.gql b/backend/dataconnect/connector/message/mutations.gql
new file mode 100644
index 00000000..883c06cf
--- /dev/null
+++ b/backend/dataconnect/connector/message/mutations.gql
@@ -0,0 +1,37 @@
+mutation createMessage(
+ $conversationId: UUID!,
+ $senderId: String!,
+ $content: String!,
+ $isSystem: Boolean
+) @auth(level: USER) {
+ message_insert(
+ data: {
+ conversationId: $conversationId,
+ senderId: $senderId,
+ content: $content,
+ isSystem: $isSystem
+ }
+ )
+}
+
+mutation updateMessage(
+ $id: UUID!,
+ $conversationId: UUID,
+ $senderId: String,
+ $content: String,
+ $isSystem: Boolean
+) @auth(level: USER) {
+ message_update(
+ id: $id,
+ data: {
+ conversationId: $conversationId,
+ senderId: $senderId,
+ content: $content,
+ isSystem: $isSystem
+ }
+ )
+}
+
+mutation deleteMessage($id: UUID!) @auth(level: USER) {
+ message_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/message/queries.gql b/backend/dataconnect/connector/message/queries.gql
new file mode 100644
index 00000000..770bdafe
--- /dev/null
+++ b/backend/dataconnect/connector/message/queries.gql
@@ -0,0 +1,41 @@
+query listMessages @auth(level: USER) {
+ messages {
+ id
+ conversationId
+ senderId
+ content
+ isSystem
+ createdAt
+ user{
+ fullName
+ }
+ }
+}
+
+query getMessageById($id: UUID!) @auth(level: USER) {
+ message(id: $id) {
+ id
+ conversationId
+ senderId
+ content
+ isSystem
+ createdAt
+ user{
+ fullName
+ }
+ }
+}
+
+query getMessagesByConversationId($conversationId: UUID!) @auth(level: USER) {
+ messages(where: { conversationId: { eq: $conversationId } }) {
+ id
+ conversationId
+ senderId
+ content
+ isSystem
+ createdAt
+ user{
+ fullName
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/order/mutations.gql b/backend/dataconnect/connector/order/mutations.gql
new file mode 100644
index 00000000..4016d2ab
--- /dev/null
+++ b/backend/dataconnect/connector/order/mutations.gql
@@ -0,0 +1,98 @@
+mutation createOrder(
+ $vendorId: UUID!
+ $businessId: UUID!
+ $orderType: OrderType!
+ $location: String
+ $status: OrderStatus
+ $date: Timestamp
+ $startDate: Timestamp
+ $endDate: Timestamp
+ $duration: OrderDuration
+ $lunchBreak: Int
+ $total: Float
+ $eventName: String
+ $assignedStaff: Any
+ $shifts: Any
+ $requested: Int
+ $hub: String
+ $recurringDays: Any
+ $permanentStartDate: Timestamp
+ $permanentDays: Any
+ $notes: String
+ $detectedConflicts: Any
+ $poReference: String
+) @auth(level: USER) {
+ order_insert(
+ data: {
+ vendorId: $vendorId
+ businessId: $businessId
+ orderType: $orderType
+ location: $location
+ status: $status
+ date: $date
+ startDate: $startDate
+ endDate: $endDate
+ duration: $duration
+ lunchBreak: $lunchBreak
+ total: $total
+ eventName: $eventName
+ assignedStaff: $assignedStaff
+ shifts: $shifts
+ requested: $requested
+ hub: $hub
+ recurringDays: $recurringDays
+ permanentDays: $permanentDays
+ notes: $notes
+ detectedConflicts: $detectedConflicts
+ poReference: $poReference
+ }
+ )
+}
+
+mutation updateOrder(
+ $id: UUID!
+ $vendorId: UUID
+ $businessId: UUID
+ $location: String
+ $status: OrderStatus
+ $startDate: Timestamp
+ $endDate: Timestamp
+ $total: Float
+ $eventName: String
+ $assignedStaff: Any
+ $shifts: Any
+ $requested: Int
+ $hub: String
+ $recurringDays: Any
+ $permanentDays: Any
+ $notes: String
+ $detectedConflicts: Any
+ $poReference: String
+) @auth(level: USER) {
+ order_update(
+ id: $id
+ data: {
+ vendorId: $vendorId
+ businessId: $businessId
+ location: $location
+ status: $status
+ startDate: $startDate
+ endDate: $endDate
+ total: $total
+ eventName: $eventName
+ assignedStaff: $assignedStaff
+ shifts: $shifts
+ requested: $requested
+ hub: $hub
+ recurringDays: $recurringDays
+ permanentDays: $permanentDays
+ notes: $notes
+ detectedConflicts: $detectedConflicts
+ poReference: $poReference
+ }
+ )
+}
+
+mutation deleteOrder($id: UUID!) @auth(level: USER) {
+ order_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/order/queries.gql b/backend/dataconnect/connector/order/queries.gql
new file mode 100644
index 00000000..cad68e39
--- /dev/null
+++ b/backend/dataconnect/connector/order/queries.gql
@@ -0,0 +1,352 @@
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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
+ hub
+ recurringDays
+ permanentDays
+ poReference
+ detectedConflicts
+ notes
+ createdAt
+
+ business {
+ id
+ businessName
+ email
+ contactName
+ }
+
+ vendor {
+ id
+ companyName
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/recentPayment/mutations.gql b/backend/dataconnect/connector/recentPayment/mutations.gql
new file mode 100644
index 00000000..109e4ee2
--- /dev/null
+++ b/backend/dataconnect/connector/recentPayment/mutations.gql
@@ -0,0 +1,41 @@
+mutation createRecentPayment(
+ $workedTime: String
+ $status: RecentPaymentStatus
+ $staffId: UUID!
+ $applicationId: UUID!
+ $invoiceId: UUID!
+) @auth(level: USER) {
+ recentPayment_insert(
+ data: {
+ workedTime: $workedTime
+ status: $status
+ staffId: $staffId
+ applicationId: $applicationId
+ invoiceId: $invoiceId
+ }
+ )
+}
+
+mutation updateRecentPayment(
+ $id: UUID!
+ $workedTime: String
+ $status: RecentPaymentStatus
+ $staffId: UUID
+ $applicationId: UUID
+ $invoiceId: UUID
+) @auth(level: USER) {
+ recentPayment_update(
+ id: $id
+ data: {
+ workedTime: $workedTime
+ status: $status
+ staffId: $staffId
+ applicationId: $applicationId
+ invoiceId: $invoiceId
+ }
+ )
+}
+
+mutation deleteRecentPayment($id: UUID!) @auth(level: USER) {
+ recentPayment_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/recentPayment/queries.gql b/backend/dataconnect/connector/recentPayment/queries.gql
new file mode 100644
index 00000000..2e4487f5
--- /dev/null
+++ b/backend/dataconnect/connector/recentPayment/queries.gql
@@ -0,0 +1,417 @@
+# ------------------------------------------------------------
+# LIST ALL (admin/debug)
+# ------------------------------------------------------------
+query listRecentPayments(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ recentPayments(offset: $offset, limit: $limit) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ checkInTime
+ checkOutTime
+
+ shiftRole {
+ hours
+ totalValue
+ startTime
+ endTime
+
+ role {
+ name
+ costPerHour
+ }
+
+ shift {
+ title
+ date
+ location
+ locationAddress
+ description
+ }
+ }
+ }
+
+ invoice {
+ status
+ invoiceNumber
+ issueDate
+
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# GET BY ID
+# ------------------------------------------------------------
+query getRecentPaymentById($id: UUID!) @auth(level: USER) {
+ recentPayment(id: $id) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ checkInTime
+ checkOutTime
+
+ shiftRole {
+ hours
+ totalValue
+ startTime
+ endTime
+
+ role {
+ name
+ costPerHour
+ }
+
+ shift {
+ title
+ date
+ location
+ locationAddress
+ description
+ }
+ }
+ }
+
+ invoice {
+ status
+ invoiceNumber
+ issueDate
+
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST BY STAFF (Staff view)
+# ------------------------------------------------------------
+query listRecentPaymentsByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ recentPayments(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { createdAt: DESC }
+ ) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ id
+ status
+ shiftRole {
+ startTime
+ endTime
+ hours
+ totalValue
+
+ role { id name costPerHour }
+
+ shift {
+ id
+ title
+ date
+ locationAddress
+ }
+ }
+ }
+
+ invoice {
+ id
+ invoiceNumber
+ status
+ issueDate
+ dueDate
+ amount
+
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName location }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST BY APPLICATION (debug / trace)
+# ------------------------------------------------------------
+query listRecentPaymentsByApplicationId(
+ $applicationId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ recentPayments(
+ where: { applicationId: { eq: $applicationId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ id
+ status
+ shiftRole {
+ hours
+ totalValue
+ role { id name costPerHour }
+ shift { id title date locationAddress }
+ }
+ }
+
+ invoice {
+ id
+ invoiceNumber
+ status
+ amount
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName location }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST BY INVOICE (Vendor/Business can see all payments for invoice)
+# ------------------------------------------------------------
+query listRecentPaymentsByInvoiceId(
+ $invoiceId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ recentPayments(
+ where: { invoiceId: { eq: $invoiceId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ id
+ staffId
+ shiftRole {
+ hours
+ totalValue
+ role { id name costPerHour }
+ shift { id title date locationAddress }
+ }
+ }
+
+ invoice {
+ id
+ invoiceNumber
+ status
+ amount
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName location }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# FILTER BY STATUS (common)
+# ------------------------------------------------------------
+query listRecentPaymentsByStatus(
+ $status: RecentPaymentStatus!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ recentPayments(
+ where: { status: { eq: $status } }
+ offset: $offset
+ limit: $limit
+ orderBy: { createdAt: DESC }
+ ) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ id
+ shiftRole {
+ hours
+ totalValue
+ role { id name costPerHour }
+ shift { id title date locationAddress }
+ }
+ }
+
+ invoice {
+ id
+ invoiceNumber
+ status
+ amount
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName location }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# BY BUSINESS (2-step)
+# Step 2: pass invoiceIds (from query: listInvoicesByBusinessId)
+# ------------------------------------------------------------
+query listRecentPaymentsByInvoiceIds(
+ $invoiceIds: [UUID!]!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ recentPayments(
+ where: { invoiceId: { in: $invoiceIds } }
+ offset: $offset
+ limit: $limit
+ orderBy: { createdAt: DESC }
+ ) {
+ id
+ workedTime
+ status
+ staffId
+ applicationId
+ invoiceId
+ createdAt
+ updatedAt
+ createdBy
+
+ application {
+ id
+ shiftRole {
+ hours
+ totalValue
+ role { id name costPerHour }
+ shift { id title date locationAddress }
+ }
+ }
+
+ invoice {
+ id
+ invoiceNumber
+ status
+ amount
+ business { id businessName }
+ vendor { id companyName }
+ order { id eventName location }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# 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 }
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/reports/queries.gql b/backend/dataconnect/connector/reports/queries.gql
new file mode 100644
index 00000000..10bceae5
--- /dev/null
+++ b/backend/dataconnect/connector/reports/queries.gql
@@ -0,0 +1,455 @@
+# ==========================================================
+# Reports Connector - For MVP
+# ==========================================================
+# This file exposes SOURCE-DATA queries for all report screens.
+# All aggregation (group by day/week, percentages, averages)
+# is intentionally done on the client (Flutter).
+#
+# Entities used:
+# - Shift
+# - Application
+# - Staff
+# - Invoice
+# - TimeSheet
+#
+# NOTE:
+# Data Connect does NOT support custom root resolvers.
+# These queries return raw rows from @table entities.
+# ==========================================================
+
+
+# ==========================================================
+# 1) COVERAGE REPORT (Next 7 days)
+# ==========================================================
+# Coverage definition:
+# - Needed: sum(Shift.workersNeeded) grouped by date
+# - Confirmed: count(Application) where status IN (...)
+#
+# Client groups by Shift.date and calculates:
+# coveragePercentage = confirmed / needed * 100
+# ==========================================================
+
+query listShiftsForCoverage(
+ $businessId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { businessId: { eq: $businessId } }
+ date: { ge: $startDate, le: $endDate }
+ }
+ orderBy: { date: ASC }
+ ) {
+ id
+ date
+ workersNeeded
+ filled
+ status
+ }
+}
+
+#I comment here because I have an error en sdk
+query listApplicationsForCoverage(
+ $shiftIds: [UUID!]!
+ #$statuses: [ApplicationStatus!]!
+) @auth(level: USER) {
+ applications(
+ where: {
+ shiftId: { in: $shiftIds }
+ #status: { in: $statuses }
+ }
+ ) {
+ id
+ shiftId
+ staffId
+ status
+ }
+}
+
+
+# ==========================================================
+# 2) DAILY OPS REPORT (Single day)
+# ==========================================================
+# Metrics derived on client:
+# - scheduledShifts = shifts.length
+# - workersConfirmed = confirmedApps / totalNeeded
+# - inProgressShifts = status == IN_PROGRESS
+# - completedShifts = status == COMPLETED
+# ==========================================================
+
+query listShiftsForDailyOpsByBusiness(
+ $businessId: UUID!
+ $date: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { businessId: { eq: $businessId } }
+ date: { eq: $date }
+ }
+ orderBy: { startTime: ASC }
+ ) {
+ id
+ title
+ location
+ startTime
+ endTime
+ workersNeeded
+ filled
+ status
+ }
+}
+
+query listShiftsForDailyOpsByVendor(
+ $vendorId: UUID!
+ $date: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { vendorId: { eq: $vendorId } }
+ date: { eq: $date }
+ }
+ orderBy: { startTime: ASC }
+ ) {
+ id
+ title
+ location
+ startTime
+ endTime
+ workersNeeded
+ filled
+ status
+ }
+}
+
+query listApplicationsForDailyOps(
+ $shiftIds: [UUID!]!
+) @auth(level: USER) {
+ applications(where: { shiftId: { in: $shiftIds } }) {
+ id
+ shiftId
+ staffId
+ status
+ checkInTime
+ checkOutTime
+ }
+}
+
+
+# ==========================================================
+# 3) FORECAST REPORT (Next N weeks)
+# ==========================================================
+# Projected spend formula (client):
+# projectedCost = workersNeeded * hours * hourlyRate
+# ==========================================================
+
+query listShiftsForForecastByBusiness(
+ $businessId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { businessId: { eq: $businessId } }
+ date: { ge: $startDate, le: $endDate }
+ }
+ orderBy: { date: ASC }
+ ) {
+ id
+ date
+ workersNeeded
+ hours
+ cost
+ status
+ }
+}
+
+query listShiftsForForecastByVendor(
+ $vendorId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { vendorId: { eq: $vendorId } }
+ date: { ge: $startDate, le: $endDate }
+ }
+ orderBy: { date: ASC }
+ ) {
+ id
+ date
+ workersNeeded
+ hours
+ cost
+ status
+ }
+}
+
+# ==========================================================
+# 4) NO-SHOW REPORT (Historical range)
+# ==========================================================
+# Now fully supported because ApplicationStatus includes NO_SHOW.
+#
+# Metrics:
+# - totalNoShows = count(status == NO_SHOW)
+# - noShowRate = noShows / totalApplications
+# - breakdown by staff
+# ==========================================================
+
+query listShiftsForNoShowRangeByBusiness(
+ $businessId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { businessId: { eq: $businessId } }
+ date: { ge: $startDate, le: $endDate }
+ }
+ ) {
+ id
+ date
+ }
+}
+
+query listShiftsForNoShowRangeByVendor(
+ $vendorId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { vendorId: { eq: $vendorId } }
+ date: { ge: $startDate, le: $endDate }
+ }
+ ) {
+ id
+ date
+ }
+}
+
+
+query listApplicationsForNoShowRange(
+ $shiftIds: [UUID!]!
+) @auth(level: USER) {
+ applications(where: { shiftId: { in: $shiftIds } }) {
+ id
+ shiftId
+ staffId
+ status
+ }
+}
+
+query listStaffForNoShowReport(
+ $staffIds: [UUID!]!
+) @auth(level: USER) {
+ staffs(where: { id: { in: $staffIds } }) {
+ id
+ fullName
+ noShowCount
+ reliabilityScore
+ }
+}
+
+
+# ==========================================================
+# 5) SPEND REPORT (Financial)
+# ==========================================================
+# Uses Invoice as source of truth for money.
+# Filter is now based on:
+# - businessId (business dashboard)
+# - vendorId (vendor dashboard)
+# since Invoice no longer has ownerId.
+# ==========================================================
+
+query listInvoicesForSpendByBusiness(
+ $businessId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ invoices(
+ where: {
+ businessId: { eq: $businessId }
+ issueDate: { ge: $startDate, le: $endDate }
+ }
+ orderBy: { issueDate: ASC }
+ ) {
+ id
+ issueDate
+ dueDate
+ amount
+ status
+ invoiceNumber
+
+ vendor { id companyName }
+ business { id businessName }
+ order { id eventName }
+ }
+}
+
+query listInvoicesForSpendByVendor(
+ $vendorId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ invoices(
+ where: {
+ vendorId: { eq: $vendorId }
+ issueDate: { ge: $startDate, le: $endDate }
+ }
+ orderBy: { issueDate: ASC }
+ ) {
+ id
+ issueDate
+ dueDate
+ amount
+ status
+ invoiceNumber
+
+ vendor { id companyName }
+ business { id businessName }
+ order { id eventName }
+ }
+}
+
+# Optional: Spend by Order (if you need it)
+query listInvoicesForSpendByOrder(
+ $orderId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ invoices(
+ where: {
+ orderId: { eq: $orderId }
+ issueDate: { ge: $startDate, le: $endDate }
+ }
+ orderBy: { issueDate: ASC }
+ ) {
+ id
+ issueDate
+ dueDate
+ amount
+ status
+ invoiceNumber
+
+ vendor { id companyName }
+ business { id businessName }
+ order { id eventName }
+ }
+}
+
+query listTimesheetsForSpend(
+ $startTime: Timestamp!
+ $endTime: Timestamp!
+) @auth(level: USER) {
+ shiftRoles(
+ where: {
+ shift: {
+ date: { ge: $startTime, le: $endTime }
+ }
+ }
+ ) {
+ id
+ hours
+ totalValue
+
+ shift{
+ title
+ location
+ status
+ date
+
+ order{
+ business{
+ businessName
+ }
+ }
+ }
+
+ role{
+ costPerHour
+ }
+
+ }
+}
+
+
+# ==========================================================
+# 6) PERFORMANCE REPORT (Historical KPIs)
+# ==========================================================
+# Metrics derivable:
+# - fillRate
+# - completionRate
+# - onTimeRate
+# - avgFillTimeHours (NOW POSSIBLE 🎉)
+#
+# avgFillTimeHours formula:
+# (filledAt - createdAt) averaged across FILLED shifts
+# ==========================================================
+
+query listShiftsForPerformanceByBusiness(
+ $businessId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { businessId: { eq: $businessId } }
+ date: { ge: $startDate, le: $endDate }
+ filledAt: { isNull: false }
+ }
+ ) {
+ id
+ workersNeeded
+ filled
+ status
+ createdAt
+ filledAt
+ }
+}
+
+query listShiftsForPerformanceByVendor(
+ $vendorId: UUID!
+ $startDate: Timestamp!
+ $endDate: Timestamp!
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { vendorId: { eq: $vendorId } }
+ date: { ge: $startDate, le: $endDate }
+ filledAt: { isNull: false }
+ }
+ ) {
+ id
+ workersNeeded
+ filled
+ status
+ createdAt
+ filledAt
+ }
+}
+
+query listApplicationsForPerformance(
+ $shiftIds: [UUID!]!
+) @auth(level: USER) {
+ applications(where: { shiftId: { in: $shiftIds } }) {
+ id
+ shiftId
+ staffId
+ status
+ checkInTime
+ checkOutTime
+ }
+}
+
+query listStaffForPerformance(
+ $staffIds: [UUID!]!
+) @auth(level: USER) {
+ staffs(where: { id: { in: $staffIds } }) {
+ id
+ averageRating
+ onTimeRate
+ noShowCount
+ reliabilityScore
+ }
+}
diff --git a/backend/dataconnect/connector/role/mutations.gql b/backend/dataconnect/connector/role/mutations.gql
new file mode 100644
index 00000000..f13bba25
--- /dev/null
+++ b/backend/dataconnect/connector/role/mutations.gql
@@ -0,0 +1,36 @@
+mutation createRole(
+ $name: String!
+ $costPerHour: Float!
+ $vendorId: UUID!
+ $roleCategoryId: UUID!
+) @auth(level: USER) {
+ role_insert(
+ data: {
+ name: $name
+ costPerHour: $costPerHour
+ vendorId: $vendorId
+ roleCategoryId: $roleCategoryId
+ }
+ )
+}
+
+
+mutation updateRole(
+ $id: UUID!
+ $name: String
+ $costPerHour: Float
+ $roleCategoryId: UUID!
+) @auth(level: USER) {
+ role_update(
+ id: $id
+ data: {
+ name: $name
+ costPerHour: $costPerHour
+ roleCategoryId: $roleCategoryId
+ }
+ )
+}
+
+mutation deleteRole($id: UUID!) @auth(level: USER) {
+ role_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/role/queries.gql b/backend/dataconnect/connector/role/queries.gql
new file mode 100644
index 00000000..3cd66ace
--- /dev/null
+++ b/backend/dataconnect/connector/role/queries.gql
@@ -0,0 +1,43 @@
+query listRoles @auth(level: USER) {
+ roles {
+ id
+ name
+ costPerHour
+ vendorId
+ roleCategoryId
+ createdAt
+ }
+}
+
+query getRoleById($id: UUID!) @auth(level: USER) {
+ role(id: $id) {
+ id
+ name
+ costPerHour
+ vendorId
+ roleCategoryId
+ createdAt
+ }
+}
+
+query listRolesByVendorId($vendorId: UUID!) @auth(level: USER) {
+ roles(where: { vendorId: { eq: $vendorId } }) {
+ id
+ name
+ costPerHour
+ vendorId
+ roleCategoryId
+ createdAt
+ }
+}
+
+query listRolesByroleCategoryId($roleCategoryId: UUID!) @auth(level: USER) {
+ roles(where: { roleCategoryId: { eq: $roleCategoryId } }) {
+ id
+ name
+ costPerHour
+ vendorId
+ roleCategoryId
+ createdAt
+ }
+}
diff --git a/backend/dataconnect/connector/roleCategory/mutations.gql b/backend/dataconnect/connector/roleCategory/mutations.gql
new file mode 100644
index 00000000..d09d9c03
--- /dev/null
+++ b/backend/dataconnect/connector/roleCategory/mutations.gql
@@ -0,0 +1,29 @@
+mutation createRoleCategory(
+ $roleName: String!,
+ $category: RoleCategoryType!
+) @auth(level: USER) {
+ roleCategory_insert(
+ data: {
+ roleName: $roleName,
+ category: $category
+ }
+ )
+}
+
+mutation updateRoleCategory(
+ $id: UUID!,
+ $roleName: String,
+ $category: RoleCategoryType
+) @auth(level: USER) {
+ roleCategory_update(
+ id: $id,
+ data: {
+ roleName: $roleName,
+ category: $category
+ }
+ )
+}
+
+mutation deleteRoleCategory($id: UUID!) @auth(level: USER) {
+ roleCategory_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/roleCategory/queries.gql b/backend/dataconnect/connector/roleCategory/queries.gql
new file mode 100644
index 00000000..10e2a84a
--- /dev/null
+++ b/backend/dataconnect/connector/roleCategory/queries.gql
@@ -0,0 +1,27 @@
+query listRoleCategories @auth(level: USER) {
+ roleCategories {
+ id
+ roleName
+ category
+ createdAt
+ updatedAt
+ }
+}
+
+query getRoleCategoryById($id: UUID!) @auth(level: USER) {
+ roleCategory(id: $id) {
+ id
+ roleName
+ category
+ createdAt
+ updatedAt
+ }
+}
+
+query getRoleCategoriesByCategory($category: RoleCategoryType!) @auth(level: USER) {
+ roleCategories(where: { category: { eq: $category } }) {
+ id
+ roleName
+ category
+ }
+}
diff --git a/backend/dataconnect/connector/shift/mutations.gql b/backend/dataconnect/connector/shift/mutations.gql
new file mode 100644
index 00000000..3d275639
--- /dev/null
+++ b/backend/dataconnect/connector/shift/mutations.gql
@@ -0,0 +1,114 @@
+
+mutation createShift(
+ $title: String!
+ $orderId: UUID!
+
+ $date: Timestamp
+ $startTime: Timestamp
+ $endTime: Timestamp
+ $hours: Float
+ $cost: Float
+
+ $location: String
+ $locationAddress: String
+ $latitude: Float
+ $longitude: Float
+ $description: String
+
+ $status: ShiftStatus
+ $workersNeeded: Int
+ $filled: Int
+ $filledAt: Timestamp
+
+ $managers: [Any!]
+ $durationDays: Int
+
+ $createdBy: String
+) @auth(level: USER) {
+ shift_insert(
+ data: {
+ title: $title
+ orderId: $orderId
+
+ date: $date
+ startTime: $startTime
+ endTime: $endTime
+ hours: $hours
+ cost: $cost
+
+ location: $location
+ locationAddress: $locationAddress
+ latitude: $latitude
+ longitude: $longitude
+ description: $description
+
+ status: $status
+ workersNeeded: $workersNeeded
+ filled: $filled
+ filledAt: $filledAt
+
+ managers: $managers
+ durationDays: $durationDays
+ }
+ )
+}
+
+mutation updateShift(
+ $id: UUID!
+ $title: String
+ $orderId: UUID
+
+ $date: Timestamp
+ $startTime: Timestamp
+ $endTime: Timestamp
+ $hours: Float
+ $cost: Float
+
+ $location: String
+ $locationAddress: String
+ $latitude: Float
+ $longitude: Float
+ $description: String
+
+ $status: ShiftStatus
+ $workersNeeded: Int
+ $filled: Int
+ $filledAt: Timestamp
+
+ $managers: [Any!]
+ $durationDays: Int
+
+) @auth(level: USER) {
+ shift_update(
+ id: $id
+ data: {
+ title: $title
+ orderId: $orderId
+
+ date: $date
+ startTime: $startTime
+ endTime: $endTime
+ hours: $hours
+ cost: $cost
+
+ location: $location
+ locationAddress: $locationAddress
+ latitude: $latitude
+ longitude: $longitude
+ description: $description
+
+ status: $status
+ workersNeeded: $workersNeeded
+ filled: $filled
+ filledAt: $filledAt
+
+ managers: $managers
+ durationDays: $durationDays
+
+ }
+ )
+}
+
+mutation deleteShift($id: UUID!) @auth(level: USER) {
+ shift_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/shift/queries.gql b/backend/dataconnect/connector/shift/queries.gql
new file mode 100644
index 00000000..43c461df
--- /dev/null
+++ b/backend/dataconnect/connector/shift/queries.gql
@@ -0,0 +1,282 @@
+
+# ------------------------------------------------------------
+# LIST SHIFTS (paginated)
+# ------------------------------------------------------------
+query listShifts(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shifts(offset: $offset, limit: $limit) {
+ id
+ title
+
+ orderId
+
+ date
+ startTime
+ endTime
+ hours
+ cost
+
+ location
+ locationAddress
+ latitude
+ longitude
+ description
+
+ status
+ workersNeeded
+ filled
+ filledAt
+
+ managers
+ durationDays
+
+ createdAt
+ updatedAt
+ createdBy
+
+ order {
+ id
+ eventName
+ status
+ orderType
+ businessId
+ vendorId
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# GET SHIFT BY ID
+# ------------------------------------------------------------
+query getShiftById($id: UUID!) @auth(level: USER) {
+ shift(id: $id) {
+ id
+ title
+
+ orderId
+
+ date
+ startTime
+ endTime
+ hours
+ cost
+
+ location
+ locationAddress
+ latitude
+ longitude
+ description
+
+ status
+ workersNeeded
+ filled
+ filledAt
+
+ managers
+ durationDays
+
+ createdAt
+ updatedAt
+ createdBy
+
+ order {
+ id
+ eventName
+ status
+ orderType
+ businessId
+ vendorId
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# FILTER SHIFTS (by status/orderId/date range)
+# NOTE: Timestamp filters use ge/le (not gte/lte)
+# ------------------------------------------------------------
+query filterShifts(
+ $status: ShiftStatus
+ $orderId: UUID
+
+ $dateFrom: Timestamp
+ $dateTo: Timestamp
+
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shifts(
+ where: {
+ status: { eq: $status }
+ orderId: { eq: $orderId }
+ date: { ge: $dateFrom, le: $dateTo }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ title
+
+ orderId
+
+ date
+ startTime
+ endTime
+ hours
+ cost
+
+ location
+ locationAddress
+ latitude
+ longitude
+ description
+
+ status
+ workersNeeded
+ filled
+ filledAt
+
+ managers
+ durationDays
+
+ createdAt
+ updatedAt
+ createdBy
+
+ order {
+ id
+ eventName
+ status
+ orderType
+ businessId
+ vendorId
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# BUSINESS: GET SHIFTS FOR A BUSINESS (via order.businessId)
+# ------------------------------------------------------------
+query getShiftsByBusinessId(
+ $businessId: UUID!
+ $dateFrom: Timestamp
+ $dateTo: Timestamp
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { businessId: { eq: $businessId } }
+ date: { ge: $dateFrom, le: $dateTo }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ title
+
+ orderId
+
+ date
+ startTime
+ endTime
+ hours
+ cost
+
+ location
+ locationAddress
+ latitude
+ longitude
+ description
+
+ status
+ workersNeeded
+ filled
+ filledAt
+
+ managers
+ durationDays
+
+ createdAt
+ updatedAt
+ createdBy
+
+ order {
+ id
+ eventName
+ status
+ orderType
+ businessId
+ vendorId
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+}
+
+# ------------------------------------------------------------
+# VENDOR: GET SHIFTS FOR A VENDOR (via order.vendorId)
+# ------------------------------------------------------------
+query getShiftsByVendorId(
+ $vendorId: UUID!
+ $dateFrom: Timestamp
+ $dateTo: Timestamp
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shifts(
+ where: {
+ order: { vendorId: { eq: $vendorId } }
+ date: { ge: $dateFrom, le: $dateTo }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ title
+
+ orderId
+
+ date
+ startTime
+ endTime
+ hours
+ cost
+
+ location
+ locationAddress
+ latitude
+ longitude
+ description
+
+ status
+ workersNeeded
+ filled
+ filledAt
+
+ managers
+ durationDays
+
+ createdAt
+ updatedAt
+ createdBy
+
+ order {
+ id
+ eventName
+ status
+ orderType
+ businessId
+ vendorId
+ business { id businessName email contactName }
+ vendor { id companyName }
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/shiftRole/mutations.gql b/backend/dataconnect/connector/shiftRole/mutations.gql
new file mode 100644
index 00000000..d7225ef8
--- /dev/null
+++ b/backend/dataconnect/connector/shiftRole/mutations.gql
@@ -0,0 +1,65 @@
+mutation createShiftRole(
+ $shiftId: UUID!
+ $roleId: UUID!
+ $count: Int!
+ $assigned: Int
+ $startTime: Timestamp
+ $endTime: Timestamp
+ $hours: Float
+ $department: String
+ $uniform: String
+ $breakType: BreakDuration
+ $totalValue: Float
+) @auth(level: USER) {
+ shiftRole_insert(
+ data: {
+ shiftId: $shiftId
+ roleId: $roleId
+ count: $count
+ assigned: $assigned
+ startTime: $startTime
+ endTime: $endTime
+ hours: $hours
+ department: $department
+ uniform: $uniform
+ breakType: $breakType
+ totalValue: $totalValue
+ }
+ )
+}
+
+mutation updateShiftRole(
+ $shiftId: UUID!
+ $roleId: UUID!
+ $count: Int
+ $assigned: Int
+ $startTime: Timestamp
+ $endTime: Timestamp
+ $hours: Float
+ $department: String
+ $uniform: String
+ $breakType: BreakDuration
+ $totalValue: Float
+) @auth(level: USER) {
+ shiftRole_update(
+ key: { shiftId: $shiftId, roleId: $roleId }
+ data: {
+ count: $count
+ assigned: $assigned
+ startTime: $startTime
+ endTime: $endTime
+ hours: $hours
+ department: $department
+ uniform: $uniform
+ breakType: $breakType
+ totalValue: $totalValue
+ }
+ )
+}
+
+mutation deleteShiftRole(
+ $shiftId: UUID!
+ $roleId: UUID!
+) @auth(level: USER) {
+ shiftRole_delete(key: { shiftId: $shiftId, roleId: $roleId })
+}
diff --git a/backend/dataconnect/connector/shiftRole/queries.gql b/backend/dataconnect/connector/shiftRole/queries.gql
new file mode 100644
index 00000000..9dabe0cb
--- /dev/null
+++ b/backend/dataconnect/connector/shiftRole/queries.gql
@@ -0,0 +1,295 @@
+
+query getShiftRoleById(
+ $shiftId: UUID!
+ $roleId: UUID!
+ ) @auth(level: USER) {
+ shiftRole(key: { shiftId: $shiftId, roleId: $roleId }) {
+ id
+ shiftId
+ roleId
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ department
+ uniform
+ breakType
+ totalValue
+ createdAt
+
+ role {
+ id
+ name
+ costPerHour
+ }
+
+ shift{
+ location
+ locationAddress
+ description
+ orderId
+
+ order{
+ recurringDays
+ permanentDays
+ notes
+
+ business{
+ id
+ businessName
+ }
+
+ vendor{
+ id
+ companyName
+ }
+
+ }
+ }
+ }
+}
+
+query listShiftRolesByShiftId(
+ $shiftId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shiftRoles(
+ where: { shiftId: { eq: $shiftId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ shiftId
+ roleId
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ department
+ uniform
+ breakType
+ totalValue
+ createdAt
+
+ role {
+ id
+ name
+ costPerHour
+ }
+
+ shift{
+ location
+ locationAddress
+ description
+ orderId
+
+ order{
+ recurringDays
+ permanentDays
+ notes
+
+ business{
+ id
+ businessName
+ }
+
+ vendor{
+ id
+ companyName
+ }
+
+ }
+ }
+ }
+}
+
+query listShiftRolesByRoleId(
+ $roleId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shiftRoles(
+ where: { roleId: { eq: $roleId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ shiftId
+ roleId
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ department
+ uniform
+ breakType
+ totalValue
+ createdAt
+
+ role {
+ id
+ name
+ costPerHour
+ }
+
+ shift{
+ location
+ locationAddress
+ description
+ orderId
+
+ order{
+ recurringDays
+ permanentDays
+ notes
+
+ business{
+ id
+ businessName
+ }
+
+ vendor{
+ id
+ companyName
+ }
+
+ }
+ }
+
+ }
+}
+
+query listShiftRolesByShiftIdAndTimeRange(
+ $shiftId: UUID!
+ $start: Timestamp!
+ $end: Timestamp!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ shiftRoles(
+ where: {
+ shiftId: { eq: $shiftId }
+ startTime: { ge: $start }
+ endTime: { le: $end }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ shiftId
+ roleId
+ count
+ assigned
+ startTime
+ endTime
+ hours
+ department
+ uniform
+ breakType
+ totalValue
+ createdAt
+
+ role {
+ id
+ name
+ costPerHour
+ }
+
+ shift{
+ location
+ locationAddress
+ description
+ orderId
+
+ order{
+ recurringDays
+ permanentDays
+ notes
+
+ business{
+ id
+ businessName
+ }
+
+ vendor{
+ id
+ companyName
+ }
+
+ }
+ }
+
+ }
+}
+
+# ------------------------------------------------------------
+# 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 }
+ }
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/staff/mutations.gql b/backend/dataconnect/connector/staff/mutations.gql
new file mode 100644
index 00000000..6e272b63
--- /dev/null
+++ b/backend/dataconnect/connector/staff/mutations.gql
@@ -0,0 +1,184 @@
+mutation CreateStaff(
+ $userId: String!
+ $fullName: String!
+ $level: String
+ $role: String
+ $phone: String
+ $email: String
+ $photoUrl: String
+
+ $totalShifts: Int
+ $averageRating: Float
+ $onTimeRate: Int
+ $noShowCount: Int
+ $cancellationCount: Int
+ $reliabilityScore: Int
+
+ $bio: String
+ #$skills: Any
+ $industries: Any
+ $preferredLocations: Any
+ $maxDistanceMiles: Int
+ $languages: Any
+ $itemsAttire: Any
+
+ $xp: Int
+ $badges: Any
+ $isRecommended: Boolean
+
+ $ownerId: UUID
+ $department: DepartmentType
+ $hubId: UUID
+ $manager: UUID
+ $english: EnglishProficiency
+
+
+
+ $backgroundCheckStatus: BackgroundCheckStatus
+ $employmentType: EmploymentType
+ $initial: String
+ $englishRequired: Boolean
+ $city: String
+ $addres: String
+) @auth(level: USER) {
+ staff_insert(
+ data: {
+ userId: $userId
+ fullName: $fullName
+ level: $level
+ role: $role
+ phone: $phone
+ email: $email
+ photoUrl: $photoUrl
+
+ totalShifts: $totalShifts
+ averageRating: $averageRating
+ onTimeRate: $onTimeRate
+ noShowCount: $noShowCount
+ cancellationCount: $cancellationCount
+ reliabilityScore: $reliabilityScore
+
+ bio: $bio
+ #skills: $skills
+ industries: $industries
+ preferredLocations: $preferredLocations
+ maxDistanceMiles: $maxDistanceMiles
+ languages: $languages
+ itemsAttire: $itemsAttire
+
+ xp: $xp
+ badges: $badges
+ isRecommended: $isRecommended
+
+ ownerId: $ownerId
+ department: $department
+ hubId: $hubId
+ manager: $manager
+ english: $english
+
+ backgroundCheckStatus: $backgroundCheckStatus
+ employmentType: $employmentType
+ initial: $initial
+ englishRequired: $englishRequired
+ city: $city
+ addres: $addres
+
+ }
+ )
+}
+
+mutation UpdateStaff(
+ $id: UUID!
+
+ $userId: String
+ $fullName: String
+ $level: String
+ $role: String
+ $phone: String
+ $email: String
+ $photoUrl: String
+
+ $totalShifts: Int
+ $averageRating: Float
+ $onTimeRate: Int
+ $noShowCount: Int
+ $cancellationCount: Int
+ $reliabilityScore: Int
+
+ $bio: String
+ #$skills: Any
+ $industries: Any
+ $preferredLocations: Any
+ $maxDistanceMiles: Int
+ $languages: Any
+ $itemsAttire: Any
+
+ $xp: Int
+ $badges: Any
+ $isRecommended: Boolean
+
+ $ownerId: UUID
+ $department: DepartmentType
+ $hubId: UUID
+ $manager: UUID
+ $english: EnglishProficiency
+
+
+
+ $backgroundCheckStatus: BackgroundCheckStatus
+ $employmentType: EmploymentType
+ $initial: String
+ $englishRequired: Boolean
+ $city: String
+ $addres: String
+) @auth(level: USER) {
+ staff_update(
+ id: $id
+ data: {
+ userId: $userId
+ fullName: $fullName
+ level: $level
+ role: $role
+ phone: $phone
+ email: $email
+ photoUrl: $photoUrl
+
+ totalShifts: $totalShifts
+ averageRating: $averageRating
+ onTimeRate: $onTimeRate
+ noShowCount: $noShowCount
+ cancellationCount: $cancellationCount
+ reliabilityScore: $reliabilityScore
+
+ bio: $bio
+ #skills: $skills
+ industries: $industries
+ preferredLocations: $preferredLocations
+ maxDistanceMiles: $maxDistanceMiles
+ languages: $languages
+ itemsAttire: $itemsAttire
+
+ xp: $xp
+ badges: $badges
+ isRecommended: $isRecommended
+
+ ownerId: $ownerId
+ department: $department
+ hubId: $hubId
+ manager: $manager
+ english: $english
+
+ backgroundCheckStatus: $backgroundCheckStatus
+ employmentType: $employmentType
+ initial: $initial
+ englishRequired: $englishRequired
+ city: $city
+ addres: $addres
+
+ }
+ )
+}
+
+mutation DeleteStaff($id: UUID!) @auth(level: USER) {
+ staff_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/staff/queries.gql b/backend/dataconnect/connector/staff/queries.gql
new file mode 100644
index 00000000..f93b4e08
--- /dev/null
+++ b/backend/dataconnect/connector/staff/queries.gql
@@ -0,0 +1,173 @@
+query listStaff @auth(level: USER) {
+ staffs {
+ id
+ userId
+ fullName
+ level
+ role
+ phone
+ email
+ photoUrl
+
+ totalShifts
+ averageRating
+ onTimeRate
+ noShowCount
+ cancellationCount
+ reliabilityScore
+ xp
+ badges
+ isRecommended
+
+ bio
+ #skills
+ industries
+ preferredLocations
+ maxDistanceMiles
+ languages
+ itemsAttire
+
+ ownerId
+ createdAt
+ department
+ hubId
+ manager
+ english
+
+ backgroundCheckStatus
+ employmentType
+ initial
+ englishRequired
+ city
+ addres
+ }
+}
+
+query getStaffById($id: UUID!) @auth(level: USER) {
+ staff(id: $id) {
+ id
+ userId
+ fullName
+ role
+ level
+ phone
+ email
+ photoUrl
+
+ totalShifts
+ averageRating
+ onTimeRate
+ noShowCount
+ cancellationCount
+ reliabilityScore
+ xp
+ badges
+ isRecommended
+
+ bio
+ #skills
+ industries
+ preferredLocations
+ maxDistanceMiles
+ languages
+ itemsAttire
+
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ department
+ hubId
+ manager
+ english
+
+ backgroundCheckStatus
+ employmentType
+ initial
+ englishRequired
+ city
+ addres
+ }
+}
+
+query getStaffByUserId($userId: String!) @auth(level: USER) {
+ staffs(where: { userId: { eq: $userId } }) {
+ id
+ userId
+ fullName
+ level
+ phone
+ email
+ photoUrl
+
+ totalShifts
+ averageRating
+ onTimeRate
+ noShowCount
+ cancellationCount
+ reliabilityScore
+ xp
+ badges
+ isRecommended
+
+ bio
+ #skills
+ industries
+ preferredLocations
+ maxDistanceMiles
+ languages
+ itemsAttire
+
+ ownerId
+ createdAt
+ updatedAt
+ createdBy
+ department
+ hubId
+ manager
+ english
+
+ backgroundCheckStatus
+ employmentType
+ initial
+ englishRequired
+ city
+ addres
+ }
+}
+
+query filterStaff(
+ $ownerId: UUID
+ $fullName: String
+ $level: String
+ $email: String
+) @auth(level: USER) {
+ staffs(
+ where: {
+ ownerId: { eq: $ownerId }
+ fullName: { eq: $fullName }
+ level: { eq: $level }
+ email: { eq: $email }
+ }
+ ) {
+ id
+ userId
+ fullName
+ level
+ phone
+ email
+ photoUrl
+ averageRating
+ reliabilityScore
+ totalShifts
+ ownerId
+ isRecommended
+
+ backgroundCheckStatus
+ employmentType
+ initial
+ englishRequired
+ city
+ addres
+ }
+}
diff --git a/backend/dataconnect/connector/staffAvailability/mutations.gql b/backend/dataconnect/connector/staffAvailability/mutations.gql
new file mode 100644
index 00000000..91f95a5e
--- /dev/null
+++ b/backend/dataconnect/connector/staffAvailability/mutations.gql
@@ -0,0 +1,44 @@
+
+mutation createStaffAvailability(
+ $staffId: UUID!
+ $day: DayOfWeek!
+ $slot: AvailabilitySlot!
+ $status: AvailabilityStatus
+ $notes: String
+) @auth(level: USER) {
+ staffAvailability_insert(
+ data: {
+ staffId: $staffId
+ day: $day
+ slot: $slot
+ status: $status
+ notes: $notes
+ }
+ )
+}
+
+mutation updateStaffAvailability(
+ $staffId: UUID!
+ $day: DayOfWeek!
+ $slot: AvailabilitySlot!
+ $status: AvailabilityStatus
+ $notes: String
+) @auth(level: USER) {
+ staffAvailability_update(
+ key: { staffId: $staffId, day: $day, slot: $slot }
+ data: {
+ status: $status
+ notes: $notes
+ }
+ )
+}
+
+mutation deleteStaffAvailability(
+ $staffId: UUID!
+ $day: DayOfWeek!
+ $slot: AvailabilitySlot!
+) @auth(level: USER) {
+ staffAvailability_delete(
+ key: { staffId: $staffId, day: $day, slot: $slot }
+ )
+}
diff --git a/backend/dataconnect/connector/staffAvailability/queries.gql b/backend/dataconnect/connector/staffAvailability/queries.gql
new file mode 100644
index 00000000..e9d5ef11
--- /dev/null
+++ b/backend/dataconnect/connector/staffAvailability/queries.gql
@@ -0,0 +1,87 @@
+
+query listStaffAvailabilities(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffAvailabilities(offset: $offset, limit: $limit) {
+ id
+ staffId
+ day
+ slot
+ status
+ notes
+ createdAt
+ updatedAt
+ createdBy
+
+ staff { id fullName }
+ }
+}
+
+query listStaffAvailabilitiesByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffAvailabilities(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ day
+ slot
+ status
+ notes
+ createdAt
+ updatedAt
+ createdBy
+
+ staff { id fullName }
+ }
+}
+
+query getStaffAvailabilityByKey(
+ $staffId: UUID!
+ $day: DayOfWeek!
+ $slot: AvailabilitySlot!
+) @auth(level: USER) {
+ staffAvailability(key: { staffId: $staffId, day: $day, slot: $slot }) {
+ id
+ staffId
+ day
+ slot
+ status
+ notes
+ createdAt
+ updatedAt
+ createdBy
+
+ staff { id fullName }
+ }
+}
+
+query listStaffAvailabilitiesByDay(
+ $day: DayOfWeek!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffAvailabilities(
+ where: { day: { eq: $day } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ day
+ slot
+ status
+ notes
+ createdAt
+ updatedAt
+ createdBy
+
+ staff { id fullName }
+ }
+}
diff --git a/backend/dataconnect/connector/staffAvailabilityStats/mutations.gql b/backend/dataconnect/connector/staffAvailabilityStats/mutations.gql
new file mode 100644
index 00000000..25d3926d
--- /dev/null
+++ b/backend/dataconnect/connector/staffAvailabilityStats/mutations.gql
@@ -0,0 +1,54 @@
+
+mutation createStaffAvailabilityStats(
+ $staffId: UUID!
+ $needWorkIndex: Int
+ $utilizationPercentage: Int
+ $predictedAvailabilityScore: Int
+ $scheduledHoursThisPeriod: Int
+ $desiredHoursThisPeriod: Int
+ $lastShiftDate: Timestamp
+ $acceptanceRate: Int
+) @auth(level: USER) {
+ staffAvailabilityStats_insert(
+ data: {
+ staffId: $staffId
+ needWorkIndex: $needWorkIndex
+ utilizationPercentage: $utilizationPercentage
+ predictedAvailabilityScore: $predictedAvailabilityScore
+ scheduledHoursThisPeriod: $scheduledHoursThisPeriod
+ desiredHoursThisPeriod: $desiredHoursThisPeriod
+ lastShiftDate: $lastShiftDate
+ acceptanceRate: $acceptanceRate
+ }
+ )
+}
+
+mutation updateStaffAvailabilityStats(
+ $staffId: UUID!
+ $needWorkIndex: Int
+ $utilizationPercentage: Int
+ $predictedAvailabilityScore: Int
+ $scheduledHoursThisPeriod: Int
+ $desiredHoursThisPeriod: Int
+ $lastShiftDate: Timestamp
+ $acceptanceRate: Int
+) @auth(level: USER) {
+ staffAvailabilityStats_update(
+ key: { staffId: $staffId }
+ data: {
+ needWorkIndex: $needWorkIndex
+ utilizationPercentage: $utilizationPercentage
+ predictedAvailabilityScore: $predictedAvailabilityScore
+ scheduledHoursThisPeriod: $scheduledHoursThisPeriod
+ desiredHoursThisPeriod: $desiredHoursThisPeriod
+ lastShiftDate: $lastShiftDate
+ acceptanceRate: $acceptanceRate
+ }
+ )
+}
+
+mutation deleteStaffAvailabilityStats(
+ $staffId: UUID!
+) @auth(level: USER) {
+ staffAvailabilityStats_delete(key: { staffId: $staffId })
+}
diff --git a/backend/dataconnect/connector/staffAvailabilityStats/queries.gql b/backend/dataconnect/connector/staffAvailabilityStats/queries.gql
new file mode 100644
index 00000000..a1d658ca
--- /dev/null
+++ b/backend/dataconnect/connector/staffAvailabilityStats/queries.gql
@@ -0,0 +1,109 @@
+# ==========================================================
+# StaffAvailabilityStats - QUERIES
+# ==========================================================
+# Notes:
+# - Entity key is composite: key: ["staffId"]
+# - So the single-record lookup is: staffAvailabilityStats(key: { staffId: ... })
+# - There is no Query.staffAvailabilityStat(id: ...) unless you defined id as the key.
+# ==========================================================
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listStaffAvailabilityStats(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffAvailabilityStatss(offset: $offset, limit: $limit) {
+ id
+ staffId
+ needWorkIndex
+ utilizationPercentage
+ predictedAvailabilityScore
+ scheduledHoursThisPeriod
+ desiredHoursThisPeriod
+ lastShiftDate
+ acceptanceRate
+ createdAt
+ updatedAt
+ createdBy
+
+ staff {
+ id
+ fullName
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY KEY (staffId)
+# ----------------------------------------------------------
+query getStaffAvailabilityStatsByStaffId(
+ $staffId: UUID!
+) @auth(level: USER) {
+ staffAvailabilityStats(key: { staffId: $staffId }) {
+ id
+ staffId
+ needWorkIndex
+ utilizationPercentage
+ predictedAvailabilityScore
+ scheduledHoursThisPeriod
+ desiredHoursThisPeriod
+ lastShiftDate
+ acceptanceRate
+ createdAt
+ updatedAt
+ createdBy
+
+ staff {
+ id
+ fullName
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (optional) - useful for dashboards
+# NOTE: Data Connect filter ops are typically: eq, ne, gt, ge, lt, le, in, isNull
+# ----------------------------------------------------------
+query filterStaffAvailabilityStats(
+ $needWorkIndexMin: Int
+ $needWorkIndexMax: Int
+ $utilizationMin: Int
+ $utilizationMax: Int
+ $acceptanceRateMin: Int
+ $acceptanceRateMax: Int
+ $lastShiftAfter: Timestamp
+ $lastShiftBefore: Timestamp
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffAvailabilityStatss(
+ where: {
+ needWorkIndex: { ge: $needWorkIndexMin, le: $needWorkIndexMax }
+ utilizationPercentage: { ge: $utilizationMin, le: $utilizationMax }
+ acceptanceRate: { ge: $acceptanceRateMin, le: $acceptanceRateMax }
+ lastShiftDate: { ge: $lastShiftAfter, le: $lastShiftBefore }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ needWorkIndex
+ utilizationPercentage
+ predictedAvailabilityScore
+ scheduledHoursThisPeriod
+ desiredHoursThisPeriod
+ lastShiftDate
+ acceptanceRate
+ createdAt
+ updatedAt
+ createdBy
+
+ staff {
+ id
+ fullName
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/staffCourse/mutations.gql b/backend/dataconnect/connector/staffCourse/mutations.gql
new file mode 100644
index 00000000..90801b9b
--- /dev/null
+++ b/backend/dataconnect/connector/staffCourse/mutations.gql
@@ -0,0 +1,47 @@
+# Mutations for StaffCourse
+
+mutation createStaffCourse(
+ $staffId: UUID!
+ $courseId: UUID!
+ $progressPercent: Int
+ $completed: Boolean
+ $completedAt: Timestamp
+ $startedAt: Timestamp
+ $lastAccessedAt: Timestamp
+) @auth(level: USER) {
+ staffCourse_insert(
+ data: {
+ staffId: $staffId
+ courseId: $courseId
+ progressPercent: $progressPercent
+ completed: $completed
+ completedAt: $completedAt
+ startedAt: $startedAt
+ lastAccessedAt: $lastAccessedAt
+ }
+ )
+}
+
+mutation updateStaffCourse(
+ $id: UUID!
+ $progressPercent: Int
+ $completed: Boolean
+ $completedAt: Timestamp
+ $startedAt: Timestamp
+ $lastAccessedAt: Timestamp
+) @auth(level: USER) {
+ staffCourse_update(
+ id: $id
+ data: {
+ progressPercent: $progressPercent
+ completed: $completed
+ completedAt: $completedAt
+ startedAt: $startedAt
+ lastAccessedAt: $lastAccessedAt
+ }
+ )
+}
+
+mutation deleteStaffCourse($id: UUID!) @auth(level: USER) {
+ staffCourse_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/staffCourse/queries.gql b/backend/dataconnect/connector/staffCourse/queries.gql
new file mode 100644
index 00000000..91c6e738
--- /dev/null
+++ b/backend/dataconnect/connector/staffCourse/queries.gql
@@ -0,0 +1,85 @@
+query getStaffCourseById($id: UUID!) @auth(level: USER) {
+ staffCourse(id: $id) {
+ id
+ staffId
+ courseId
+ progressPercent
+ completed
+ completedAt
+ startedAt
+ lastAccessedAt
+ createdAt
+ updatedAt
+ }
+}
+
+query listStaffCoursesByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffCourses(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ courseId
+ progressPercent
+ completed
+ completedAt
+ startedAt
+ lastAccessedAt
+ createdAt
+ updatedAt
+ }
+}
+
+query listStaffCoursesByCourseId(
+ $courseId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffCourses(
+ where: { courseId: { eq: $courseId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ courseId
+ progressPercent
+ completed
+ completedAt
+ startedAt
+ lastAccessedAt
+ createdAt
+ updatedAt
+ }
+}
+
+query getStaffCourseByStaffAndCourse(
+ $staffId: UUID!
+ $courseId: UUID!
+) @auth(level: USER) {
+ staffCourses(
+ where: {
+ staffId: { eq: $staffId }
+ courseId: { eq: $courseId }
+ }
+ limit: 1
+ ) {
+ id
+ staffId
+ courseId
+ progressPercent
+ completed
+ completedAt
+ startedAt
+ lastAccessedAt
+ createdAt
+ updatedAt
+ }
+}
+
diff --git a/backend/dataconnect/connector/staffDocument/mutations.gql b/backend/dataconnect/connector/staffDocument/mutations.gql
new file mode 100644
index 00000000..8877dd02
--- /dev/null
+++ b/backend/dataconnect/connector/staffDocument/mutations.gql
@@ -0,0 +1,43 @@
+
+mutation createStaffDocument(
+ $staffId: UUID!
+ $staffName: String!
+ $documentId: UUID!
+ $status: DocumentStatus!
+ $documentUrl: String
+ $expiryDate: Timestamp
+) @auth(level: USER) {
+ staffDocument_insert(
+ data: {
+ staffId: $staffId
+ staffName: $staffName
+ documentId: $documentId
+ status: $status
+ documentUrl: $documentUrl
+ expiryDate: $expiryDate
+ }
+ )
+}
+
+mutation updateStaffDocument(
+ $staffId: UUID!
+ $documentId: UUID!
+ $status: DocumentStatus
+ $documentUrl: String
+ $expiryDate: Timestamp
+) @auth(level: USER) {
+ staffDocument_update(
+ key: { staffId: $staffId, documentId: $documentId }
+ data: {
+ status: $status
+ documentUrl: $documentUrl
+ }
+ )
+}
+
+mutation deleteStaffDocument(
+ $staffId: UUID!
+ $documentId: UUID!
+) @auth(level: USER) {
+ staffDocument_delete(key: { staffId: $staffId, documentId: $documentId })
+}
diff --git a/backend/dataconnect/connector/staffDocument/queries.gql b/backend/dataconnect/connector/staffDocument/queries.gql
new file mode 100644
index 00000000..77e6cc6f
--- /dev/null
+++ b/backend/dataconnect/connector/staffDocument/queries.gql
@@ -0,0 +1,100 @@
+
+query getStaffDocumentByKey(
+ $staffId: UUID!
+ $documentId: UUID!
+) @auth(level: USER) {
+ staffDocument(key: { staffId: $staffId, documentId: $documentId }) {
+ id
+ staffId
+ staffName
+ documentId
+ status
+ documentUrl
+ expiryDate
+ createdAt
+ updatedAt
+ document {
+ id
+ name
+ documentType
+ description
+ }
+ }
+}
+
+query listStaffDocumentsByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffDocuments(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ staffName
+ documentId
+ status
+ documentUrl
+ expiryDate
+ createdAt
+ updatedAt
+ document {
+ id
+ name
+ documentType
+ }
+ }
+}
+
+query listStaffDocumentsByDocumentType(
+ $documentType: DocumentType!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffDocuments(
+ where: { document: { documentType: { eq: $documentType } } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ staffName
+ documentId
+ status
+ documentUrl
+ expiryDate
+ document {
+ id
+ name
+ documentType
+ }
+ }
+}
+
+query listStaffDocumentsByStatus(
+ $status: DocumentStatus!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffDocuments(
+ where: { status: { eq: $status } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ staffName
+ documentId
+ status
+ documentUrl
+ expiryDate
+ document {
+ id
+ name
+ documentType
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/staffRole/mutations.gql b/backend/dataconnect/connector/staffRole/mutations.gql
new file mode 100644
index 00000000..a2857979
--- /dev/null
+++ b/backend/dataconnect/connector/staffRole/mutations.gql
@@ -0,0 +1,22 @@
+mutation createStaffRole(
+ $staffId: UUID!
+ $roleId: UUID!
+ $roleType: RoleType
+) @auth(level: USER) {
+ staffRole_insert(
+ data: {
+ staffId: $staffId
+ roleId: $roleId
+ roleType: $roleType
+ }
+ )
+}
+
+mutation deleteStaffRole(
+ $staffId: UUID!
+ $roleId: UUID!
+) @auth(level: USER) {
+ staffRole_delete(
+ key: { staffId: $staffId, roleId: $roleId }
+ )
+}
diff --git a/backend/dataconnect/connector/staffRole/queries.gql b/backend/dataconnect/connector/staffRole/queries.gql
new file mode 100644
index 00000000..560cbf56
--- /dev/null
+++ b/backend/dataconnect/connector/staffRole/queries.gql
@@ -0,0 +1,142 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listStaffRoles(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffRoles(offset: $offset, limit: $limit) {
+ id
+ staffId
+ roleId
+ createdAt
+ roleType
+
+ staff {
+ id
+ fullName
+ userId
+ email
+ phone
+ }
+
+ role {
+ id
+ name
+ costPerHour
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY COMPOSITE KEY (staffId + roleId)
+# ----------------------------------------------------------
+query getStaffRoleByKey(
+ $staffId: UUID!
+ $roleId: UUID!
+) @auth(level: USER) {
+ staffRole(key: { staffId: $staffId, roleId: $roleId }) {
+ id
+ staffId
+ roleId
+ createdAt
+ roleType
+
+ staff {
+ id
+ fullName
+ userId
+ email
+ phone
+ }
+
+ role {
+ id
+ name
+ costPerHour
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY STAFF (most common)
+# ----------------------------------------------------------
+query listStaffRolesByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffRoles(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ roleId
+ createdAt
+ roleType
+
+ role {
+ id
+ name
+ costPerHour
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY ROLE (who has this skill)
+# ----------------------------------------------------------
+query listStaffRolesByRoleId(
+ $roleId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffRoles(
+ where: { roleId: { eq: $roleId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ roleId
+ createdAt
+ roleType
+
+ staff {
+ id
+ fullName
+ userId
+ email
+ phone
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (optional)
+# Useful when you want both conditions without using key lookup
+# ----------------------------------------------------------
+query filterStaffRoles(
+ $staffId: UUID
+ $roleId: UUID
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ staffRoles(
+ where: {
+ staffId: { eq: $staffId }
+ roleId: { eq: $roleId }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ roleId
+ createdAt
+ roleType
+ }
+}
\ No newline at end of file
diff --git a/backend/dataconnect/connector/task/mutations.gql b/backend/dataconnect/connector/task/mutations.gql
new file mode 100644
index 00000000..a9c1040e
--- /dev/null
+++ b/backend/dataconnect/connector/task/mutations.gql
@@ -0,0 +1,64 @@
+mutation createTask(
+ $taskName: String!
+ $description: String
+ $priority: TaskPriority!
+ $status: TaskStatus!
+ $dueDate: Timestamp
+ $progress: Int
+ $orderIndex: Int
+ $commentCount: Int
+ $attachmentCount: Int
+ $files: Any
+ $ownerId:UUID!
+) @auth(level: USER) {
+ task_insert(
+ data: {
+ taskName: $taskName
+ description: $description
+ priority: $priority
+ status: $status
+ dueDate: $dueDate
+ progress: $progress
+ orderIndex: $orderIndex
+ commentCount: $commentCount
+ attachmentCount: $attachmentCount
+ files: $files
+ ownerId:$ownerId
+ }
+ )
+}
+
+mutation updateTask(
+ $id: UUID!
+ $taskName: String
+ $description: String
+ $priority: TaskPriority
+ $status: TaskStatus
+ $dueDate: Timestamp
+ $progress: Int
+ $assignedMembers: Any
+ $orderIndex: Int
+ $commentCount: Int
+ $attachmentCount: Int
+ $files: Any
+) @auth(level: USER) {
+ task_update(
+ id: $id
+ data: {
+ taskName: $taskName
+ description: $description
+ priority: $priority
+ status: $status
+ dueDate: $dueDate
+ progress: $progress
+ orderIndex: $orderIndex
+ commentCount: $commentCount
+ attachmentCount: $attachmentCount
+ files: $files
+ }
+ )
+}
+
+mutation deleteTask($id: UUID!) @auth(level: USER) {
+ task_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/task/queries.gql b/backend/dataconnect/connector/task/queries.gql
new file mode 100644
index 00000000..bc315e0d
--- /dev/null
+++ b/backend/dataconnect/connector/task/queries.gql
@@ -0,0 +1,83 @@
+query listTasks @auth(level: USER) {
+ tasks {
+ id
+ taskName
+ description
+ priority
+ status
+ dueDate
+ progress
+ orderIndex
+ commentCount
+ attachmentCount
+ files
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTaskById($id: UUID!) @auth(level: USER) {
+ task(id: $id) {
+ id
+ taskName
+ description
+ priority
+ status
+ dueDate
+ progress
+ orderIndex
+ commentCount
+ attachmentCount
+ files
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTasksByOwnerId($ownerId: UUID!) @auth(level: USER) {
+ tasks(where: { ownerId: { eq: $ownerId } }) {
+ id
+ taskName
+ description
+ priority
+ status
+ dueDate
+ progress
+ orderIndex
+ commentCount
+ attachmentCount
+ files
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterTasks(
+ $status: TaskStatus
+ $priority: TaskPriority
+) @auth(level: USER) {
+ tasks(
+ where: {
+ status: { eq: $status }
+ priority: { eq: $priority }
+ }
+ ) {
+ id
+ taskName
+ description
+ priority
+ status
+ dueDate
+ progress
+ orderIndex
+ commentCount
+ attachmentCount
+ files
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
diff --git a/backend/dataconnect/connector/task_comment/mutations.gql b/backend/dataconnect/connector/task_comment/mutations.gql
new file mode 100644
index 00000000..432cab97
--- /dev/null
+++ b/backend/dataconnect/connector/task_comment/mutations.gql
@@ -0,0 +1,33 @@
+mutation createTaskComment(
+ $taskId: UUID!
+ $teamMemberId: UUID!
+ $comment: String!
+ $isSystem: Boolean
+) @auth(level: USER) {
+ taskComment_insert(
+ data: {
+ taskId: $taskId
+ teamMemberId: $teamMemberId
+ comment: $comment
+ isSystem: $isSystem
+ }
+ )
+}
+
+mutation updateTaskComment(
+ $id: UUID!
+ $comment: String
+ $isSystem: Boolean
+) @auth(level: USER) {
+ taskComment_update(
+ id: $id
+ data: {
+ comment: $comment
+ isSystem: $isSystem
+ }
+ )
+}
+
+mutation deleteTaskComment($id: UUID!) @auth(level: USER) {
+ taskComment_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/task_comment/queries.gql b/backend/dataconnect/connector/task_comment/queries.gql
new file mode 100644
index 00000000..48afc3f9
--- /dev/null
+++ b/backend/dataconnect/connector/task_comment/queries.gql
@@ -0,0 +1,62 @@
+query listTaskComments @auth(level: USER) {
+ taskComments {
+ id
+ taskId
+ teamMemberId
+ comment
+ isSystem
+ createdAt
+
+ teamMember{
+
+ user {
+ fullName
+ email
+ }
+
+ }
+
+ }
+}
+
+query getTaskCommentById($id: UUID!) @auth(level: USER) {
+ taskComment(id: $id) {
+ id
+ taskId
+ teamMemberId
+ comment
+ isSystem
+ createdAt
+
+ teamMember{
+
+ user {
+ fullName
+ email
+ }
+
+ }
+
+ }
+}
+
+query getTaskCommentsByTaskId($taskId: UUID!) @auth(level: USER) {
+ taskComments(where: { taskId: { eq: $taskId } }) {
+ id
+ taskId
+ teamMemberId
+ comment
+ isSystem
+ createdAt
+
+ teamMember{
+
+ user {
+ fullName
+ email
+ }
+
+ }
+
+ }
+}
diff --git a/backend/dataconnect/connector/taxForm/mutations.gql b/backend/dataconnect/connector/taxForm/mutations.gql
new file mode 100644
index 00000000..d7798b35
--- /dev/null
+++ b/backend/dataconnect/connector/taxForm/mutations.gql
@@ -0,0 +1,45 @@
+mutation createTaxForm(
+ $formType: TaxFormType!
+ $title: String!
+ $subtitle: String
+ $description: String
+ $status: TaxFormStatus
+ $staffId: UUID!
+ $formData: Any
+) @auth(level: USER) {
+ taxForm_insert(
+ data: {
+ formType: $formType
+ title: $title
+ subtitle: $subtitle
+ description: $description
+ status: $status
+ staffId: $staffId
+ formData: $formData
+ }
+ )
+}
+
+mutation updateTaxForm(
+ $id: UUID!
+ $status: TaxFormStatus
+ $formData: Any
+ $title: String
+ $subtitle: String
+ $description: String
+) @auth(level: USER) {
+ taxForm_update(
+ id: $id
+ data: {
+ status: $status
+ formData: $formData
+ title: $title
+ subtitle: $subtitle
+ description: $description
+ }
+ )
+}
+
+mutation deleteTaxForm($id: UUID!) @auth(level: USER) {
+ taxForm_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/taxForm/queries.gql b/backend/dataconnect/connector/taxForm/queries.gql
new file mode 100644
index 00000000..e7d65579
--- /dev/null
+++ b/backend/dataconnect/connector/taxForm/queries.gql
@@ -0,0 +1,67 @@
+query listTaxForms @auth(level: USER) {
+ taxForms {
+ id
+ formType
+ title
+ subtitle
+ description
+ status
+ staffId
+ formData
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTaxFormById($id: UUID!) @auth(level: USER) {
+ taxForm(id: $id) {
+ id
+ formType
+ title
+ subtitle
+ description
+ status
+ staffId
+ formData
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTaxFormsBystaffId($staffId: UUID!) @auth(level: USER) {
+ taxForms(where: { staffId: { eq: $staffId } }) {
+ id
+ formType
+ title
+ subtitle
+ description
+ status
+ staffId
+ formData
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query filterTaxForms(
+ $formType: TaxFormType
+ $status: TaxFormStatus
+ $staffId: UUID
+) @auth(level: USER) {
+ taxForms(
+ where: {
+ formType: { eq: $formType }
+ status: { eq: $status }
+ staffId: { eq: $staffId }
+ }
+ ) {
+ id
+ formType
+ title
+ status
+ staffId
+ }
+}
diff --git a/backend/dataconnect/connector/team/mutations.gql b/backend/dataconnect/connector/team/mutations.gql
new file mode 100644
index 00000000..2f29e088
--- /dev/null
+++ b/backend/dataconnect/connector/team/mutations.gql
@@ -0,0 +1,73 @@
+mutation createTeam(
+ $teamName: String!
+ $ownerId: String!
+ $ownerName: String!
+ $ownerRole: String!
+ $email: String
+ $companyLogo: String
+ $totalMembers: Int
+ $activeMembers: Int
+ $totalHubs: Int
+ $departments: Any
+ $favoriteStaffCount: Int
+ $blockedStaffCount: Int
+ $favoriteStaff: Any
+ $blockedStaff: Any
+) @auth(level: USER) {
+ team_insert(
+ data: {
+ teamName: $teamName
+ ownerId: $ownerId
+ ownerName: $ownerName
+ ownerRole: $ownerRole
+ email: $email
+ companyLogo: $companyLogo
+ totalMembers: $totalMembers
+ activeMembers: $activeMembers
+ totalHubs: $totalHubs
+ departments: $departments
+ favoriteStaffCount: $favoriteStaffCount
+ blockedStaffCount: $blockedStaffCount
+ favoriteStaff: $favoriteStaff
+ blockedStaff: $blockedStaff
+ }
+ )
+}
+
+mutation updateTeam(
+ $id: UUID!
+ $teamName: String
+ $ownerName: String
+ $ownerRole: String
+ $companyLogo: String
+ $totalMembers: Int
+ $activeMembers: Int
+ $totalHubs: Int
+ $departments: Any
+ $favoriteStaffCount: Int
+ $blockedStaffCount: Int
+ $favoriteStaff: Any
+ $blockedStaff: Any
+) @auth(level: USER) {
+ team_update(
+ id: $id
+ data: {
+ teamName: $teamName
+ ownerName: $ownerName
+ ownerRole: $ownerRole
+ companyLogo: $companyLogo
+ totalMembers: $totalMembers
+ activeMembers: $activeMembers
+ totalHubs: $totalHubs
+ departments: $departments
+ favoriteStaffCount: $favoriteStaffCount
+ blockedStaffCount: $blockedStaffCount
+ favoriteStaff: $favoriteStaff
+ blockedStaff: $blockedStaff
+ }
+ )
+}
+
+mutation deleteTeam($id: UUID!) @auth(level: USER) {
+ team_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/team/queries.gql b/backend/dataconnect/connector/team/queries.gql
new file mode 100644
index 00000000..63fd2771
--- /dev/null
+++ b/backend/dataconnect/connector/team/queries.gql
@@ -0,0 +1,68 @@
+query listTeams @auth(level: USER) {
+ teams {
+ id
+ teamName
+ ownerId
+ ownerName
+ ownerRole
+ email
+ companyLogo
+ totalMembers
+ activeMembers
+ totalHubs
+ departments
+ favoriteStaffCount
+ blockedStaffCount
+ favoriteStaff
+ blockedStaff
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTeamById($id: UUID!) @auth(level: USER) {
+ team(id: $id) {
+ id
+ teamName
+ ownerId
+ ownerName
+ ownerRole
+ email
+ companyLogo
+ totalMembers
+ activeMembers
+ totalHubs
+ departments
+ favoriteStaffCount
+ blockedStaffCount
+ favoriteStaff
+ blockedStaff
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTeamsByOwnerId($ownerId: String!) @auth(level: USER) {
+ teams(where: { ownerId: { eq: $ownerId } }) {
+ id
+ teamName
+ ownerId
+ ownerName
+ ownerRole
+ email
+ companyLogo
+ totalMembers
+ activeMembers
+ totalHubs
+ departments
+ favoriteStaffCount
+ blockedStaffCount
+ favoriteStaff
+ blockedStaff
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
diff --git a/backend/dataconnect/connector/teamHub/mutations.gql b/backend/dataconnect/connector/teamHub/mutations.gql
new file mode 100644
index 00000000..b145c46f
--- /dev/null
+++ b/backend/dataconnect/connector/teamHub/mutations.gql
@@ -0,0 +1,55 @@
+mutation createTeamHub(
+ $teamId: UUID!
+ $hubName: String!
+ $address: String!
+ $city: String!
+ $state: String!
+ $zipCode: String!
+ $managerName: String!
+ $isActive: Boolean
+ $departments: Any
+) @auth(level: USER) {
+ teamHub_insert(
+ data: {
+ teamId: $teamId
+ hubName: $hubName
+ address: $address
+ city: $city
+ state: $state
+ zipCode: $zipCode
+ managerName: $managerName
+ isActive: $isActive
+ departments: $departments
+ }
+ )
+}
+
+mutation updateTeamHub(
+ $id: UUID!
+ $hubName: String
+ $address: String
+ $city: String
+ $state: String
+ $zipCode: String
+ $managerName: String
+ $isActive: Boolean
+ $departments: Any
+) @auth(level: USER) {
+ teamHub_update(
+ id: $id
+ data: {
+ hubName: $hubName
+ address: $address
+ city: $city
+ state: $state
+ zipCode: $zipCode
+ managerName: $managerName
+ isActive: $isActive
+ departments: $departments
+ }
+ )
+}
+
+mutation deleteTeamHub($id: UUID!) @auth(level: USER) {
+ teamHub_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/teamHub/queries.gql b/backend/dataconnect/connector/teamHub/queries.gql
new file mode 100644
index 00000000..240a17b1
--- /dev/null
+++ b/backend/dataconnect/connector/teamHub/queries.gql
@@ -0,0 +1,80 @@
+query listTeamHubs @auth(level: USER) {
+ teamHubs {
+ id
+ teamId
+ hubName
+ address
+ city
+ state
+ zipCode
+ managerName
+ isActive
+ departments
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTeamHubById($id: UUID!) @auth(level: USER) {
+ teamHub(id: $id) {
+ id
+ teamId
+ hubName
+ address
+ city
+ state
+ zipCode
+ managerName
+ isActive
+ departments
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getTeamHubsByTeamId($teamId: UUID!) @auth(level: USER) {
+ teamHubs(where: { teamId: { eq: $teamId } }) {
+ id
+ teamId
+ hubName
+ address
+ city
+ state
+ zipCode
+ managerName
+ isActive
+ departments
+ createdAt
+ updatedAt
+ 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
+ }
+}
\ No newline at end of file
diff --git a/backend/dataconnect/connector/teamHudDeparment/mutations.gql b/backend/dataconnect/connector/teamHudDeparment/mutations.gql
new file mode 100644
index 00000000..b2e9b176
--- /dev/null
+++ b/backend/dataconnect/connector/teamHudDeparment/mutations.gql
@@ -0,0 +1,35 @@
+
+mutation createTeamHudDepartment(
+ $name: String!
+ $costCenter: String
+ $teamHubId: UUID!
+) @auth(level: USER) {
+ teamHudDepartment_insert(
+ data: {
+ name: $name
+ costCenter: $costCenter
+ teamHubId: $teamHubId
+ }
+ )
+}
+
+mutation updateTeamHudDepartment(
+ $id: UUID!
+
+ $name: String
+ $costCenter: String
+ $teamHubId: UUID
+) @auth(level: USER) {
+ teamHudDepartment_update(
+ id: $id
+ data: {
+ name: $name
+ costCenter: $costCenter
+ teamHubId: $teamHubId
+ }
+ )
+}
+
+mutation deleteTeamHudDepartment($id: UUID!) @auth(level: USER) {
+ teamHudDepartment_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/teamHudDeparment/queries.gql b/backend/dataconnect/connector/teamHudDeparment/queries.gql
new file mode 100644
index 00000000..3d2a85a2
--- /dev/null
+++ b/backend/dataconnect/connector/teamHudDeparment/queries.gql
@@ -0,0 +1,68 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listTeamHudDepartments(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ teamHudDepartments(offset: $offset, limit: $limit) {
+ id
+ name
+ costCenter
+
+ teamHubId
+ teamHub {
+ id
+ hubName
+ }
+
+ createdAt
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY ID
+# ----------------------------------------------------------
+query getTeamHudDepartmentById($id: UUID!) @auth(level: USER) {
+ teamHudDepartment(id: $id) {
+ id
+ name
+ costCenter
+
+ teamHubId
+ teamHub {
+ id
+ hubName
+ }
+
+ createdAt
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY TEAM HUB ID
+# ----------------------------------------------------------
+query listTeamHudDepartmentsByTeamHubId(
+ $teamHubId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ teamHudDepartments(
+ where: { teamHubId: { eq: $teamHubId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ name
+ costCenter
+
+ teamHubId
+ teamHub {
+ id
+ hubName
+ }
+
+ createdAt
+ }
+}
diff --git a/backend/dataconnect/connector/teamMember/mutations.gql b/backend/dataconnect/connector/teamMember/mutations.gql
new file mode 100644
index 00000000..c271c2f8
--- /dev/null
+++ b/backend/dataconnect/connector/teamMember/mutations.gql
@@ -0,0 +1,92 @@
+mutation createTeamMember(
+ $teamId: UUID!
+ $role: TeamMemberRole!
+ $title: String
+ $department: String
+ $teamHubId: UUID
+ $isActive: Boolean
+ $userId: String!
+ $inviteStatus: TeamMemberInviteStatus
+) @auth(level: USER) {
+ teamMember_insert(
+ data: {
+ teamId: $teamId
+ role: $role
+ title: $title
+ department: $department
+ teamHubId: $teamHubId
+ isActive: $isActive
+ userId: $userId
+ inviteStatus: $inviteStatus
+ }
+ )
+}
+
+mutation updateTeamMember(
+ $id: UUID!
+ $role: TeamMemberRole
+ $title: String
+ $department: String
+ $teamHubId: UUID
+ $isActive: Boolean
+ $inviteStatus: TeamMemberInviteStatus
+) @auth(level: USER) {
+ teamMember_update(
+ id: $id
+ data: {
+ role: $role
+ title: $title
+ department: $department
+ teamHubId: $teamHubId
+ isActive: $isActive
+ inviteStatus: $inviteStatus
+ }
+ )
+}
+
+mutation updateTeamMemberInviteStatus(
+ $id: UUID!
+ $inviteStatus: TeamMemberInviteStatus!
+) @auth(level: USER) {
+ teamMember_update(
+ id: $id
+ data: {
+ inviteStatus: $inviteStatus
+ }
+ )
+}
+
+mutation acceptInviteByCode(
+ $inviteCode: UUID!
+) @auth(level: USER) {
+ teamMember_updateMany(
+ where: {
+ inviteCode: { eq: $inviteCode }
+ inviteStatus: { eq: PENDING }
+ }
+ data: {
+ inviteStatus: ACCEPTED
+ isActive: true
+ }
+ )
+}
+
+mutation cancelInviteByCode(
+ $inviteCode: UUID!
+) @auth(level: USER) {
+ teamMember_updateMany(
+ where: {
+ inviteCode: { eq: $inviteCode }
+ inviteStatus: { eq: PENDING }
+ }
+ data: {
+ inviteStatus: CANCELLED
+ isActive: false
+ }
+ )
+}
+
+
+mutation deleteTeamMember($id: UUID!) @auth(level: USER) {
+ teamMember_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/teamMember/queries.gql b/backend/dataconnect/connector/teamMember/queries.gql
new file mode 100644
index 00000000..4415f16d
--- /dev/null
+++ b/backend/dataconnect/connector/teamMember/queries.gql
@@ -0,0 +1,66 @@
+query listTeamMembers @auth(level: USER) {
+ teamMembers {
+ id
+ teamId
+ role
+ title
+ department
+ teamHubId
+ isActive
+ createdAt
+
+ user {
+ fullName
+ email
+ }
+
+ teamHub{
+ hubName
+ }
+
+ }
+}
+
+query getTeamMemberById($id: UUID!) @auth(level: USER) {
+ teamMember(id: $id) {
+ id
+ teamId
+ role
+ title
+ department
+ teamHubId
+ isActive
+ createdAt
+
+ user {
+ fullName
+ email
+ }
+
+ teamHub{
+ hubName
+ }
+ }
+}
+
+query getTeamMembersByTeamId($teamId: UUID!) @auth(level: USER) {
+ teamMembers(where: { teamId: { eq: $teamId } }) {
+ id
+ teamId
+ role
+ title
+ department
+ teamHubId
+ isActive
+ createdAt
+
+ user {
+ fullName
+ email
+ }
+
+ teamHub{
+ hubName
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/user/mutations.gql b/backend/dataconnect/connector/user/mutations.gql
new file mode 100644
index 00000000..05e233b6
--- /dev/null
+++ b/backend/dataconnect/connector/user/mutations.gql
@@ -0,0 +1,45 @@
+mutation CreateUser(
+ $id: String!, # Firebase UID
+ $email: String,
+ $fullName: String,
+ $role: UserBaseRole!,
+ $userRole: String,
+ $photoUrl: String
+) @auth(level: USER) {
+ user_insert(
+ data: {
+ id: $id
+ email: $email
+ fullName: $fullName
+ role: $role
+ userRole: $userRole
+ photoUrl: $photoUrl
+ }
+ )
+}
+
+mutation UpdateUser(
+ $id: String!,
+ $email: String,
+ $fullName: String,
+ $role: UserBaseRole,
+ $userRole: String,
+ $photoUrl: String
+) @auth(level: USER) {
+ user_update(
+ id: $id,
+ data: {
+ email: $email
+ fullName: $fullName
+ role: $role
+ userRole: $userRole
+ photoUrl: $photoUrl
+ }
+ )
+}
+
+mutation DeleteUser(
+ $id: String!
+) @auth(level: USER) {
+ user_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/user/queries.gql b/backend/dataconnect/connector/user/queries.gql
new file mode 100644
index 00000000..044abebf
--- /dev/null
+++ b/backend/dataconnect/connector/user/queries.gql
@@ -0,0 +1,48 @@
+query listUsers @auth(level: USER) {
+ users {
+ id
+ email
+ fullName
+ role
+ userRole
+ photoUrl
+ createdDate
+ updatedDate
+ }
+}
+
+query getUserById(
+ $id: String!
+) @auth(level: USER) {
+ user(id: $id) {
+ id
+ email
+ fullName
+ role
+ userRole
+ photoUrl
+ }
+}
+
+query filterUsers(
+ $id: String,
+ $email: String,
+ $role: UserBaseRole,
+ $userRole: String
+) @auth(level: USER) {
+ users(
+ where: {
+ id: { eq: $id }
+ email: { eq: $email }
+ role: { eq: $role }
+ userRole: { eq: $userRole }
+ }
+ ) {
+ id
+ email
+ fullName
+ role
+ userRole
+ photoUrl
+ }
+}
diff --git a/backend/dataconnect/connector/userConversation/mutations.gql b/backend/dataconnect/connector/userConversation/mutations.gql
new file mode 100644
index 00000000..53e4e945
--- /dev/null
+++ b/backend/dataconnect/connector/userConversation/mutations.gql
@@ -0,0 +1,74 @@
+
+mutation createUserConversation(
+ $conversationId: UUID!
+ $userId: String!
+ $unreadCount: Int
+ $lastReadAt: Timestamp
+) @auth(level: USER) {
+ userConversation_insert(
+ data: {
+ conversationId: $conversationId
+ userId: $userId
+ unreadCount: $unreadCount
+ lastReadAt: $lastReadAt
+ }
+ )
+}
+
+mutation updateUserConversation(
+ $conversationId: UUID!
+ $userId: String!
+ $unreadCount: Int
+ $lastReadAt: Timestamp
+) @auth(level: USER) {
+ userConversation_update(
+ key: { conversationId: $conversationId, userId: $userId }
+ data: {
+ unreadCount: $unreadCount
+ lastReadAt: $lastReadAt
+ }
+ )
+}
+
+# ----------------------------------------------------------
+# MARK AS READ (sets unreadCount=0 + lastReadAt=now)
+# Note: request.time is valid in schema defaults; in mutations
+# you can pass Timestamp from client. If you want "now" server-side,
+# you'd typically pass null and have logic elsewhere.
+# ----------------------------------------------------------
+mutation markConversationAsRead(
+ $conversationId: UUID!
+ $userId: String!
+ $lastReadAt: Timestamp
+) @auth(level: USER) {
+ userConversation_update(
+ key: { conversationId: $conversationId, userId: $userId }
+ data: {
+ unreadCount: 0
+ lastReadAt: $lastReadAt
+ }
+ )
+}
+
+# ----------------------------------------------------------
+# INCREMENT UNREAD (common after sending message)
+# ----------------------------------------------------------
+mutation incrementUnreadForUser(
+ $conversationId: UUID!
+ $userId: String!
+ $unreadCount: Int!
+) @auth(level: USER) {
+ userConversation_update(
+ key: { conversationId: $conversationId, userId: $userId }
+ data: { unreadCount: $unreadCount }
+ )
+}
+
+mutation deleteUserConversation(
+ $conversationId: UUID!
+ $userId: String!
+) @auth(level: USER) {
+ userConversation_delete(
+ key: { conversationId: $conversationId, userId: $userId }
+ )
+}
diff --git a/backend/dataconnect/connector/userConversation/queries.gql b/backend/dataconnect/connector/userConversation/queries.gql
new file mode 100644
index 00000000..99a1a2e4
--- /dev/null
+++ b/backend/dataconnect/connector/userConversation/queries.gql
@@ -0,0 +1,230 @@
+
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listUserConversations(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ userConversations(offset: $offset, limit: $limit) {
+ id
+ conversationId
+ userId
+ unreadCount
+ lastReadAt
+ createdAt
+
+ conversation {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+
+ user {
+ id
+ fullName
+ photoUrl
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY KEY (conversationId + userId)
+# ----------------------------------------------------------
+query getUserConversationByKey(
+ $conversationId: UUID!
+ $userId: String!
+) @auth(level: USER) {
+ userConversation(key: { conversationId: $conversationId, userId: $userId }) {
+ id
+ conversationId
+ userId
+ unreadCount
+ lastReadAt
+ createdAt
+
+ conversation {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+
+ user {
+ id
+ fullName
+ photoUrl
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY USER (My inbox) ✅
+# Order by most recent activity (Conversation.lastMessageAt)
+# NOTE: If your DC version doesn't allow orderBy on nested fields,
+# just orderBy createdAt/updatedAt on user_conversations.
+# ----------------------------------------------------------
+query listUserConversationsByUserId(
+ $userId: String!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ userConversations(
+ where: { userId: { eq: $userId } }
+ offset: $offset
+ limit: $limit
+ # If supported:
+ # orderBy: { conversation: { lastMessageAt: DESC } }
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ conversationId
+ userId
+ unreadCount
+ lastReadAt
+ createdAt
+ updatedAt
+ createdBy
+
+ conversation {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+
+ user {
+ id
+ fullName
+ photoUrl
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST UNREAD BY USER (badge, notifications)
+# ----------------------------------------------------------
+query listUnreadUserConversationsByUserId(
+ $userId: String!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ userConversations(
+ where: {
+ userId: { eq: $userId }
+ unreadCount: { gt: 0 }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ conversationId
+ userId
+ unreadCount
+ lastReadAt
+ createdAt
+
+ conversation {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY CONVERSATION (participants view)
+# ----------------------------------------------------------
+query listUserConversationsByConversationId(
+ $conversationId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ userConversations(
+ where: { conversationId: { eq: $conversationId } }
+ offset: $offset
+ limit: $limit
+ orderBy: { createdAt: ASC }
+ ) {
+ id
+ conversationId
+ userId
+ unreadCount
+ lastReadAt
+ createdAt
+
+ user {
+ id
+ fullName
+ photoUrl
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (dashboard/debug)
+# ----------------------------------------------------------
+query filterUserConversations(
+ $userId: String
+ $conversationId: UUID
+ $unreadMin: Int
+ $unreadMax: Int
+ $lastReadAfter: Timestamp
+ $lastReadBefore: Timestamp
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ userConversations(
+ where: {
+ userId: { eq: $userId }
+ conversationId: { eq: $conversationId }
+ unreadCount: { ge: $unreadMin, le: $unreadMax }
+ lastReadAt: { ge: $lastReadAfter, le: $lastReadBefore }
+ }
+ offset: $offset
+ limit: $limit
+ orderBy: { updatedAt: DESC }
+ ) {
+ id
+ conversationId
+ userId
+ unreadCount
+ lastReadAt
+ createdAt
+
+ conversation {
+ id
+ subject
+ status
+ conversationType
+ isGroup
+ groupName
+ lastMessage
+ lastMessageAt
+ createdAt
+ }
+ user { id fullName photoUrl }
+ }
+}
diff --git a/backend/dataconnect/connector/vendor/mutations.gql b/backend/dataconnect/connector/vendor/mutations.gql
new file mode 100644
index 00000000..5f0b72cf
--- /dev/null
+++ b/backend/dataconnect/connector/vendor/mutations.gql
@@ -0,0 +1,99 @@
+mutation createVendor(
+ $userId: String!
+ $companyName: String!
+ $email: String
+ $phone: String
+ $photoUrl: String
+ $address: String
+ $billingAddress: String
+ $timezone: String
+ $legalName: String
+ $doingBusinessAs: String
+ $region: String
+ $state: String
+ $city: String
+ $serviceSpecialty: String
+ $approvalStatus: ApprovalStatus
+ $isActive: Boolean
+ $markup: Float
+ $fee: Float
+ $csat: Float
+ $tier: VendorTier
+) @auth(level: USER) {
+ vendor_insert(
+ data: {
+ userId: $userId
+ companyName: $companyName
+ email: $email
+ phone: $phone
+ photoUrl: $photoUrl
+ address: $address
+ billingAddress: $billingAddress
+ timezone: $timezone
+ legalName: $legalName
+ doingBusinessAs: $doingBusinessAs
+ region: $region
+ state: $state
+ city: $city
+ serviceSpecialty: $serviceSpecialty
+ approvalStatus: $approvalStatus
+ isActive: $isActive
+ markup: $markup
+ fee: $fee
+ csat: $csat
+ tier: $tier
+ }
+ )
+}
+
+mutation updateVendor(
+ $id: UUID!
+ $companyName: String
+ $email: String
+ $phone: String
+ $photoUrl: String
+ $address: String
+ $billingAddress: String
+ $timezone: String
+ $legalName: String
+ $doingBusinessAs: String
+ $region: String
+ $state: String
+ $city: String
+ $serviceSpecialty: String
+ $approvalStatus: ApprovalStatus
+ $isActive: Boolean
+ $markup: Float
+ $fee: Float
+ $csat: Float
+ $tier: VendorTier
+) @auth(level: USER) {
+ vendor_update(
+ id: $id
+ data: {
+ companyName: $companyName
+ email: $email
+ phone: $phone
+ photoUrl: $photoUrl
+ address: $address
+ billingAddress: $billingAddress
+ timezone: $timezone
+ legalName: $legalName
+ doingBusinessAs: $doingBusinessAs
+ region: $region
+ state: $state
+ city: $city
+ serviceSpecialty: $serviceSpecialty
+ approvalStatus: $approvalStatus
+ isActive: $isActive
+ markup: $markup
+ fee: $fee
+ csat: $csat
+ tier: $tier
+ }
+ )
+}
+
+mutation deleteVendor($id: UUID!) @auth(level: USER) {
+ vendor_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/vendor/queries.gql b/backend/dataconnect/connector/vendor/queries.gql
new file mode 100644
index 00000000..76c69b03
--- /dev/null
+++ b/backend/dataconnect/connector/vendor/queries.gql
@@ -0,0 +1,86 @@
+query getVendorById($id: UUID!) @auth(level: USER) {
+ vendor(id: $id) {
+ id
+ userId
+ companyName
+ email
+ phone
+ photoUrl
+ address
+ billingAddress
+ timezone
+ legalName
+ doingBusinessAs
+ region
+ state
+ city
+ serviceSpecialty
+ approvalStatus
+ isActive
+ markup
+ fee
+ csat
+ tier
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query getVendorByUserId($userId: String!) @auth(level: USER) {
+ vendors(where: { userId: { eq: $userId } }) {
+ id
+ userId
+ companyName
+ email
+ phone
+ photoUrl
+ address
+ billingAddress
+ timezone
+ legalName
+ doingBusinessAs
+ region
+ state
+ city
+ serviceSpecialty
+ approvalStatus
+ isActive
+ markup
+ fee
+ csat
+ tier
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
+
+query listVendors @auth(level: USER) {
+ vendors {
+ id
+ userId
+ companyName
+ email
+ phone
+ photoUrl
+ address
+ billingAddress
+ timezone
+ legalName
+ doingBusinessAs
+ region
+ state
+ city
+ serviceSpecialty
+ approvalStatus
+ isActive
+ markup
+ fee
+ csat
+ tier
+ createdAt
+ updatedAt
+ createdBy
+ }
+}
diff --git a/backend/dataconnect/connector/vendorBenefitPlan/mutations.gql b/backend/dataconnect/connector/vendorBenefitPlan/mutations.gql
new file mode 100644
index 00000000..2f3fdf63
--- /dev/null
+++ b/backend/dataconnect/connector/vendorBenefitPlan/mutations.gql
@@ -0,0 +1,48 @@
+
+mutation createVendorBenefitPlan(
+ $vendorId: UUID!
+ $title: String!
+ $description: String
+ $requestLabel: String
+ $total: Int
+ $isActive: Boolean
+ $createdBy: String
+) @auth(level: USER) {
+ vendorBenefitPlan_insert(
+ data: {
+ vendorId: $vendorId
+ title: $title
+ description: $description
+ requestLabel: $requestLabel
+ total: $total
+ isActive: $isActive
+ }
+ )
+}
+
+mutation updateVendorBenefitPlan(
+ $id: UUID!
+ $vendorId: UUID
+ $title: String
+ $description: String
+ $requestLabel: String
+ $total: Int
+ $isActive: Boolean
+ $createdBy: String
+) @auth(level: USER) {
+ vendorBenefitPlan_update(
+ id: $id
+ data: {
+ vendorId: $vendorId
+ title: $title
+ description: $description
+ requestLabel: $requestLabel
+ total: $total
+ isActive: $isActive
+ }
+ )
+}
+
+mutation deleteVendorBenefitPlan($id: UUID!) @auth(level: USER) {
+ vendorBenefitPlan_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/vendorBenefitPlan/queries.gql b/backend/dataconnect/connector/vendorBenefitPlan/queries.gql
new file mode 100644
index 00000000..59068553
--- /dev/null
+++ b/backend/dataconnect/connector/vendorBenefitPlan/queries.gql
@@ -0,0 +1,149 @@
+# ----------------------------------------------------------
+# LIST ALL (admin/debug)
+# ----------------------------------------------------------
+query listVendorBenefitPlans(
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ vendorBenefitPlans(
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor {
+ companyName
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# GET BY ID
+# ----------------------------------------------------------
+query getVendorBenefitPlanById($id: UUID!) @auth(level: USER) {
+ vendorBenefitPlan(id: $id) {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor {
+ companyName
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST BY VENDOR
+# ----------------------------------------------------------
+query listVendorBenefitPlansByVendorId(
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ vendorBenefitPlans(
+ where: { vendorId: { eq: $vendorId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor {
+ companyName
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# LIST ACTIVE PLANS BY VENDOR
+# ----------------------------------------------------------
+query listActiveVendorBenefitPlansByVendorId(
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ vendorBenefitPlans(
+ where: {
+ vendorId: { eq: $vendorId }
+ isActive: { eq: true }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor {
+ companyName
+ }
+ }
+}
+
+# ----------------------------------------------------------
+# FILTER (vendorId + title + isActive)
+# - Useful for "does this plan already exist?"
+# ----------------------------------------------------------
+query filterVendorBenefitPlans(
+ $vendorId: UUID
+ $title: String
+ $isActive: Boolean
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ vendorBenefitPlans(
+ where: {
+ vendorId: { eq: $vendorId }
+ title: { eq: $title }
+ isActive: { eq: $isActive }
+ }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorId
+ title
+ description
+ requestLabel
+ total
+ isActive
+ createdAt
+ updatedAt
+ createdBy
+
+ vendor {
+ companyName
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/vendorRate/mutations.gql b/backend/dataconnect/connector/vendorRate/mutations.gql
new file mode 100644
index 00000000..0479e75c
--- /dev/null
+++ b/backend/dataconnect/connector/vendorRate/mutations.gql
@@ -0,0 +1,57 @@
+mutation createVendorRate(
+ $vendorId: UUID!,
+ $roleName: String,
+ $category: CategoryType,
+ $clientRate: Float,
+ $employeeWage: Float,
+ $markupPercentage: Float,
+ $vendorFeePercentage: Float,
+ $isActive: Boolean,
+ $notes: String
+) @auth(level: USER) {
+ vendorRate_insert(
+ data: {
+ vendorId: $vendorId,
+ roleName: $roleName,
+ category: $category,
+ clientRate: $clientRate,
+ employeeWage: $employeeWage,
+ markupPercentage: $markupPercentage,
+ vendorFeePercentage: $vendorFeePercentage,
+ isActive: $isActive,
+ notes: $notes,
+ }
+ )
+}
+
+mutation updateVendorRate(
+ $id: UUID!,
+ $vendorId: UUID,
+ $roleName: String,
+ $category: CategoryType,
+ $clientRate: Float,
+ $employeeWage: Float,
+ $markupPercentage: Float,
+ $vendorFeePercentage: Float,
+ $isActive: Boolean,
+ $notes: String,
+) @auth(level: USER) {
+ vendorRate_update(
+ id: $id,
+ data: {
+ vendorId: $vendorId,
+ roleName: $roleName,
+ category: $category,
+ clientRate: $clientRate,
+ employeeWage: $employeeWage,
+ markupPercentage: $markupPercentage,
+ vendorFeePercentage: $vendorFeePercentage,
+ isActive: $isActive,
+ notes: $notes,
+ }
+ )
+}
+
+mutation deleteVendorRate($id: UUID!) @auth(level: USER) {
+ vendorRate_delete(id: $id)
+}
diff --git a/backend/dataconnect/connector/vendorRate/queries.gql b/backend/dataconnect/connector/vendorRate/queries.gql
new file mode 100644
index 00000000..3e2df738
--- /dev/null
+++ b/backend/dataconnect/connector/vendorRate/queries.gql
@@ -0,0 +1,42 @@
+query listVendorRates @auth(level: USER) {
+ vendorRates {
+ id
+ vendorId
+ roleName
+ category
+ clientRate
+ employeeWage
+ markupPercentage
+ vendorFeePercentage
+ isActive
+ notes
+ createdAt
+
+ vendor{
+ companyName
+ region
+ }
+
+ }
+}
+
+query getVendorRateById($id: UUID!) @auth(level: USER) {
+ vendorRate(id: $id) {
+ id
+ vendorId
+ roleName
+ category
+ clientRate
+ employeeWage
+ markupPercentage
+ vendorFeePercentage
+ isActive
+ notes
+ createdAt
+
+ vendor{
+ companyName
+ region
+ }
+ }
+}
diff --git a/backend/dataconnect/connector/workForce/mutations.gql b/backend/dataconnect/connector/workForce/mutations.gql
new file mode 100644
index 00000000..489ab55f
--- /dev/null
+++ b/backend/dataconnect/connector/workForce/mutations.gql
@@ -0,0 +1,41 @@
+mutation createWorkforce(
+ $vendorId: UUID!
+ $staffId: UUID!
+ $workforceNumber: String!
+ $employmentType: WorkforceEmploymentType
+) @auth(level: USER) {
+ workforce_insert(
+ data: {
+ vendorId: $vendorId
+ staffId: $staffId
+ workforceNumber: $workforceNumber
+ employmentType: $employmentType
+ status: ACTIVE
+ }
+ )
+}
+
+mutation updateWorkforce(
+ $id: UUID!
+ $workforceNumber: String
+ $employmentType: WorkforceEmploymentType
+ $status: WorkforceStatus
+) @auth(level: USER) {
+ workforce_update(
+ id: $id
+ data: {
+ workforceNumber: $workforceNumber
+ employmentType: $employmentType
+ status: $status
+ }
+ )
+}
+
+mutation deactivateWorkforce(
+ $id: UUID!
+) @auth(level: USER) {
+ workforce_update(
+ id: $id
+ data: { status: INACTIVE }
+ )
+}
diff --git a/backend/dataconnect/connector/workForce/queries.gql b/backend/dataconnect/connector/workForce/queries.gql
new file mode 100644
index 00000000..453bc5db
--- /dev/null
+++ b/backend/dataconnect/connector/workForce/queries.gql
@@ -0,0 +1,116 @@
+# ------------------------------------------------------------
+# GET Workforce by ID
+# ------------------------------------------------------------
+query getWorkforceById($id: UUID!) @auth(level: USER) {
+ workforce(id: $id) {
+ id
+ vendorId
+ staffId
+ workforceNumber
+ employmentType
+ status
+ createdAt
+ updatedAt
+
+ staff { id fullName }
+ vendor { id companyName }
+ }
+}
+
+# ------------------------------------------------------------
+# GET Workforce by Vendor + Staff (was "by key")
+# ------------------------------------------------------------
+query getWorkforceByVendorAndStaff(
+ $vendorId: UUID!
+ $staffId: UUID!
+) @auth(level: USER) {
+ workforces(
+ where: {
+ vendorId: { eq: $vendorId }
+ staffId: { eq: $staffId }
+ }
+ limit: 1
+ ) {
+ id
+ vendorId
+ staffId
+ workforceNumber
+ employmentType
+ status
+ createdAt
+ updatedAt
+
+ staff { id fullName }
+ vendor { id companyName }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST Workforce by Vendor
+# ------------------------------------------------------------
+query listWorkforceByVendorId(
+ $vendorId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ workforces(
+ where: { vendorId: { eq: $vendorId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ staffId
+ workforceNumber
+ employmentType
+ status
+ createdAt
+
+ staff { id fullName }
+ }
+}
+
+# ------------------------------------------------------------
+# LIST Workforce by Staff
+# ------------------------------------------------------------
+query listWorkforceByStaffId(
+ $staffId: UUID!
+ $offset: Int
+ $limit: Int
+) @auth(level: USER) {
+ workforces(
+ where: { staffId: { eq: $staffId } }
+ offset: $offset
+ limit: $limit
+ ) {
+ id
+ vendorId
+ workforceNumber
+ employmentType
+ status
+ createdAt
+ updatedAt
+
+ vendor { id companyName }
+ }
+}
+
+# ------------------------------------------------------------
+# CHECK workforceNumber uniqueness within a Vendor (optional)
+# ------------------------------------------------------------
+query getWorkforceByVendorAndNumber(
+ $vendorId: UUID!
+ $workforceNumber: String!
+) @auth(level: USER) {
+ workforces(
+ where: {
+ vendorId: { eq: $vendorId }
+ workforceNumber: { eq: $workforceNumber }
+ }
+ limit: 1
+ ) {
+ id
+ staffId
+ workforceNumber
+ status
+ }
+}
diff --git a/backend/dataconnect/dataconnect.yaml b/backend/dataconnect/dataconnect.yaml
new file mode 100644
index 00000000..39e01fdb
--- /dev/null
+++ b/backend/dataconnect/dataconnect.yaml
@@ -0,0 +1,13 @@
+specVersion: "v1"
+serviceId: "krow-workforce-db"
+location: "us-central1"
+schema:
+ source: "./schema"
+ datasource:
+ postgresql:
+ database: "krow_db"
+ cloudSql:
+ instanceId: "krow-sql"
+ # schemaValidation: "STRICT" # STRICT mode makes Postgres schema match Data Connect exactly.
+ # schemaValidation: "COMPATIBLE" # COMPATIBLE mode makes Postgres schema compatible with Data Connect.
+connectorDirs: ["./connector"]
diff --git a/backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd b/backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd
deleted file mode 100644
index f241b3a5..00000000
--- a/backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd
+++ /dev/null
@@ -1,124 +0,0 @@
-flowchart LR
- subgraph "Profile & Onboarding"
- User --> User_Q["Queries
- listUsers
- getUserById"]
- User --> User_M["Mutations
- createUser
- updateUser
- deleteUser"]
- Staff --> Staff_Q["Queries
- listStaff
- getStaffById
- getStaffByUserId"]
- Staff --> Staff_M["Mutations
- createStaff
- updateStaff
- deleteStaff"]
- Contact --> Contact_Q["Queries
- listContacts
- getContactById
- listContactsByStaffId"]
- Contact --> Contact_M["Mutations
- createContact
- updateContact
- deleteContact"]
- AttireOption --> AttireOption_Q["Queries
- listAttireOptions
- getAttireOptionById"]
- AttireOption --> AttireOption_M["Mutations
- createAttireOption
- updateAttireOption
- deleteAttireOption"]
- end
-
- subgraph "Compliance"
- Document --> Document_Q["Queries
- listDocuments
- getDocumentById
- listDocumentsByStaffId"]
- Document --> Document_M["Mutations
- createDocument
- updateDocument
- deleteDocument"]
- Certificate --> Certificate_Q["Queries
- listCertificates
- getCertificateById
- listCertificatesByStaffId"]
- Certificate --> Certificate_M["Mutations
- CreateCertificate
- UpdateCertificate
- DeleteCertificate"]
- TaxForm --> TaxForm_Q["Queries
- listTaxForms
- getTaxFormById
- getTaxFormsByStaffId
- filterTaxForms"]
- TaxForm --> TaxForm_M["Mutations
- createTaxForm
- updateTaxForm
- deleteTaxForm"]
- RequiredDoc --> RequiredDoc_Q["Queries
- listRequiredDocs
- getRequiredDocById
- listRequiredDocsByUserId"]
- RequiredDoc --> RequiredDoc_M["Mutations
- createRequiredDoc
- updateRequiredDoc
- deleteRequiredDoc"]
- end
-
- subgraph "Finances"
- Account --> Account_Q["Queries
- listAccounts
- getAccountById
- listAccountsByOwnerId"]
- Account --> Account_M["Mutations
- createAccount
- updateAccount
- deleteAccount"]
- TimeSheet --> TimeSheet_Q["Queries
- listTimeSheets
- getTimeSheetById
- listTimeSheetsByStaffId"]
- TimeSheet --> TimeSheet_M["Mutations
- createTimeSheet
- updateTimeSheet
- deleteTimeSheet"]
- RecentPayment --> RecentPayment_Q["Queries
- listRecentPayments
- getRecentPaymentById
- listRecentPaymentsByUserId"]
- RecentPayment --> RecentPayment_M["Mutations
- createRecentPayment
- updateRecentPayment
- deleteRecentPayment"]
- Invoice --> Invoice_Q["Queries
- listInvoices
- getInvoiceById"]
- Invoice --> Invoice_M["Mutations
- createInvoice
- updateInvoice
- deleteInvoice"]
- InvoiceTemplate --> InvoiceTemplate_Q["Queries
- listInvoiceTemplates
- getInvoiceTemplateById"]
- InvoiceTemplate --> InvoiceTemplate_M["Mutations
- createInvoiceTemplate
- updateInvoiceTemplate
- deleteInvoiceTemplate"]
- VendorRate --> VendorRate_Q["Queries
- listVendorRates
- getVendorRateById"]
- VendorRate --> VendorRate_M["Mutations
- createVendorRate
- updateVendorRate
- deleteVendorRate"]
- CustomRateCard --> CustomRateCard_Q["Queries
- listCustomRateCards
- getCustomRateCardById"]
- CustomRateCard --> CustomRateCard_M["Mutations
- createCustomRateCard
- updateCustomRateCard
- deleteCustomRateCard"]
- end
-
- subgraph "Shifts & Work"
- Shift --> Shift_Q["Queries
- listShifts
- getShiftById
- filterShifts"]
- Shift --> Shift_M["Mutations
- CreateShift
- UpdateShift
- DeleteShift"]
- Application --> Application_Q["Queries
- getApplicationById
- listApplicationsByStaffId"]
- Application --> Application_M["Mutations
- createApplication
- updateApplication
- deleteApplication"]
- StaffShift --> StaffShift_Q["Queries
- getMyShifts
- getStaffShiftById
- getStaffShiftsByShiftId"]
- StaffShift --> StaffShift_M["Mutations
- createStaffShift
- updateStaffShift
- deleteStaffShift"]
- StaffAvailability --> StaffAvailability_Q["Queries
- listStaffAvailabilities
- getStaffAvailabilityById
- getStaffAvailabilityByStaffId"]
- StaffAvailability --> StaffAvailability_M["Mutations
- createStaffAvailability
- updateStaffAvailability
- deleteStaffAvailability"]
- Assignment --> Assignment_Q["Queries
- listAssignments
- getAssignmentById
- listAssignmentsByStaffId"]
- Assignment --> Assignment_M["Mutations
- CreateAssignment
- UpdateAssignment
- DeleteAssignment"]
- Order --> Order_Q["Queries
- listOrders
- getOrderById"]
- Order --> Order_M["Mutations
- createOrder
- updateOrder
- deleteOrder"]
- Position --> Position_Q["Queries
- listPositions
- getPositionById
- listPositionsByOrderId"]
- Position --> Position_M["Mutations
- createPosition
- updatePosition
- deletePosition"]
- Category --> Category_Q["Queries
- listCategories
- getCategoryById"]
- Category --> Category_M["Mutations
- createCategory
- updateCategory
- deleteCategory"]
- Role --> Role_Q["Queries
- listRoles
- getRoleById"]
- Role --> Role_M["Mutations
- createRole
- updateRole
- deleteRole"]
- RoleCategory --> RoleCategory_Q["Queries
- listRoleCategories
- getRoleCategoryById"]
- RoleCategory --> RoleCategory_M["Mutations
- createRoleCategory
- updateRoleCategory
- deleteRoleCategory"]
- Schedule --> Schedule_Q["Queries
- listSchedules
- getScheduleById
- getScheduleByPositionId"]
- Schedule --> Schedule_M["Mutations
- createSchedule
- updateSchedule
- deleteSchedule"]
- Workforce --> Workforce_Q["Queries"]
- Workforce --> Workforce_M["Mutations"]
- end
-
- subgraph "Learning"
- Course --> Course_Q["Queries
- listCourses
- getCourseById
- filterCourses"]
- Course --> Course_M["Mutations
- createCourse
- updateCourse
- deleteCourse"]
- Level --> Level_Q["Queries
- listLevels
- getLevelById"]
- Level --> Level_M["Mutations
- createLevel
- updateLevel
- deleteLevel"]
- StaffCourse --> StaffCourse_Q["Queries
- getStaffCourseById
- listStaffCoursesByStaffId
- listStaffCoursesByCourseId
- getStaffCourseByStaffAndCourse"]
- StaffCourse --> StaffCourse_M["Mutations
- createStaffCourse
- updateStaffCourse
- deleteStaffCourse"]
- end
-
- subgraph "Benefits"
- BenefitsData --> BenefitsData_Q["Queries
- listBenefitsData
- getBenefitsDataById
- getBenefitsDataByStaffId"]
- BenefitsData --> BenefitsData_M["Mutations
- createBenefitsData
- updateBenefitsData
- deleteBenefitsData"]
- end
-
- subgraph "Business & Vendors"
- Business --> Business_Q["Queries
- listBusinesses
- getBusinessById
- getBusinessesByUserId"]
- Business --> Business_M["Mutations
- createBusiness
- updateBusiness
- deleteBusiness"]
- Vendor --> Vendor_Q["Queries
- listVendors
- getVendorById"]
- Vendor --> Vendor_M["Mutations
- createVendor
- updateVendor
- deleteVendor"]
- Hub --> Hub_Q["Queries
- listHubs
- getHubById"]
- Hub --> Hub_M["Mutations
- createHub
- updateHub
- deleteHub"]
- end
-
- subgraph "Teams"
- Team --> Team_Q["Queries
- listTeams
- getTeamById"]
- Team --> Team_M["Mutations
- createTeam
- updateTeam
- deleteTeam"]
- TeamMember --> TeamMember_Q["Queries
- listTeamMembers
- getTeamMemberById
- listTeamMembersByTeamId"]
- TeamMember --> TeamMember_M["Mutations
- createTeamMember
- updateTeamMember
- deleteTeamMember"]
- MemberTask --> MemberTask_Q["Queries
- getMyTasks
- getMemberTaskById
- getMemberTasksByTaskId"]
- MemberTask --> MemberTask_M["Mutations
- createMemberTask
- updateMemberTask
- deleteMemberTask"]
- TeamHub --> TeamHub_Q["Queries
- listTeamHubs
- getTeamHubById
- listTeamHubsByTeamId"]
- TeamHub --> TeamHub_M["Mutations
- createTeamHub
- updateTeamHub
- deleteTeamHub"]
- Task --> Task_Q["Queries
- listTasks
- getTaskById"]
- Task --> Task_M["Mutations
- createTask
- updateTask
- deleteTask"]
- TaskComment --> TaskComment_Q["Queries
- listTaskComments
- getTaskCommentById
- listTaskCommentsByTaskId"]
- TaskComment --> TaskComment_M["Mutations
- createTaskComment
- updateTaskComment
- deleteTaskComment"]
- end
-
- subgraph "Communication"
- Conversation --> Conversation_Q["Queries
- listConversations
- getConversationById
- getConversationsByUserId"]
- Conversation --> Conversation_M["Mutations
- createConversation
- updateConversation
- deleteConversation"]
- Message --> Message_Q["Queries
- listMessages
- getMessageById
- listMessagesByConversationId"]
- Message --> Message_M["Mutations
- createMessage
- updateMessage
- deleteMessage"]
- end
-
- subgraph "Others"
- ActivityLog --> ActivityLog_Q["Queries
- listActivityLogs
- getActivityLogById
- listActivityLogsByUserId"]
- ActivityLog --> ActivityLog_M["Mutations
- createActivityLog
- updateActivityLog
- deleteActivityLog"]
- ClientFeedback --> ClientFeedback_Q["Queries
- listClientFeedbacks
- getClientFeedbackById"]
- ClientFeedback --> ClientFeedback_M["Mutations
- createClientFeedback
- updateClientFeedback
- deleteClientFeedback"]
- FaqData --> FaqData_Q["Queries
- listFaqDatas
- getFaqDataById"]
- FaqData --> FaqData_M["Mutations
- createFaqData
- updateFaqData
- deleteFaqData"]
- end
-
- subgraph "Reporting"
- Reports --> Reports_Q["Queries
- getCoverageReport
- getNoShowReport
- getSpendReport
- getForecastReport
- getPerformanceReport
- getDailyOpsReport"]
- end
diff --git a/backend/dataconnect/docs/dataconnect.mmd b/backend/dataconnect/docs/dataconnect.mmd
deleted file mode 100644
index b67267f0..00000000
--- a/backend/dataconnect/docs/dataconnect.mmd
+++ /dev/null
@@ -1,271 +0,0 @@
-erDiagram
- User {
- String id PK
- String email
- String fullName
- Timestamp createdDate
- }
- Business {
- UUID id PK
- String userId FK
- String businessName
- Timestamp createdAt
- }
- Vendor {
- UUID id PK
- String userId FK
- String companyName
- Timestamp createdAt
- }
- Staff {
- UUID id PK
- String userId FK
- UUID hubId FK
- UUID ownerId FK
- String fullName
- Timestamp createdAt
- }
- Shift {
- UUID id PK
- UUID orderId FK
- UUID ownerId FK
- ShiftStatus status
- Timestamp createdAt
- }
- Order {
- UUID id PK
- UUID ownerId FK
- UUID hubId FK
- OrderStatus status
- Timestamp createdAt
- }
- Position {
- UUID id PK
- UUID orderId FK
- UUID roleId FK
- UUID ownerId FK
- Timestamp createdAt
- }
- Task {
- UUID id PK
- UUID ownerId FK
- TaskStatus status
- Timestamp createdAt
- }
- Team {
- UUID id PK
- String ownerId FK
- String teamName
- Timestamp createdAt
- }
- TeamMember {
- UUID id PK
- UUID teamId FK
- UUID hubId FK
- String memberName
- Timestamp createdAt
- }
- Hub {
- UUID id PK
- UUID ownerId FK
- String name
- Timestamp createdAt
- }
- Account {
- UUID id PK
- UUID ownerId FK "polymorphic ownerId"
- String bank
- Timestamp createdAt
- }
- Document {
- UUID id PK
- UUID staffId FK
- DocumentStatus status
- Timestamp createdAt
- }
- Certificate {
- UUID id PK
- UUID staffId FK
- CertificateStatus status
- Timestamp createdAt
- }
- Contact {
- UUID id PK
- UUID staffId FK
- String name
- Timestamp createdAt
- }
- BenefitsData {
- UUID id PK
- UUID staffId FK
- String title
- Timestamp createdAt
- }
- Course {
- UUID id PK
- String title
- Timestamp createdAt
- }
- TaxForm {
- UUID id PK
- UUID staffId FK
- TaxFormStatus status
- Timestamp createdAt
- }
- TimeSheet {
- UUID id PK
- UUID staffId FK
- UUID shiftId FK
- TimeSheetStatus status
- Timestamp createdAt
- }
- Invoice {
- UUID id PK
- UUID ownerId FK
- InvoiceStatus status
- Timestamp createdAt
- }
- Assignment {
- UUID id PK
- UUID staffId FK
- UUID ownerId FK
- AssignmentStatus status
- Timestamp createdAt
- }
- Conversation {
- UUID id PK
- String subject
- Timestamp createdAt
- }
- Message {
- UUID id PK
- UUID conversationId FK
- String senderId
- Timestamp createdAt
- }
- Role {
- UUID id PK
- UUID ownerId FK
- String name
- Timestamp createdAt
- }
- RecentPayment {
- UUID id PK
- UUID payedUserId FK
- UUID ownerId FK
- RecentPaymentStatus status
- Timestamp createdAt
- }
- RequiredDoc {
- UUID id PK
- UUID ownerId FK
- ReqDocumentStatus status
- Timestamp createdAt
- }
- VendorRate {
- UUID id PK
- UUID vendorId FK
- String roleName
- Timestamp createdAt
- }
- Schedule {
- UUID id PK
- UUID positionId FK
- Timestamp createdAt
- }
- TaskComment {
- UUID id PK
- UUID taskId FK
- String authorName
- Timestamp createdAt
- }
- TeamHub {
- UUID id PK
- UUID teamId FK
- String hubName
- Timestamp createdAt
- }
- Application {
- UUID id PK
- UUID shiftId FK
- UUID staffId FK
- ApplicationStatus status
- Timestamp createdAt
- }
- StaffShift {
- UUID id PK
- UUID staffId FK
- UUID shiftId FK
- Timestamp createdAt
- }
- MemberTask {
- UUID id PK
- UUID teamMemberId FK
- UUID taskId FK
- Timestamp createdAt
- }
- StaffCourse {
- UUID id PK
- UUID staffId FK
- UUID courseId FK
- Timestamp createdAt
- }
-
- User ||--|{ Staff : "has profile"
- User ||--|{ Vendor : "can be"
- User ||--|{ Business : "can be"
- User ||--o{ ActivityLog : "generates"
-
- Business ||--o{ "Order" : "creates"
- Business ||--o{ Invoice : "receives"
- Business ||--o{ Task : "owns"
- Business ||--o{ Hub : "owns"
- Business ||--o{ Role : "defines"
- Business ||--o{ Shift : "posts"
- Business ||--o{ Staff : "employs"
- Business ||--o{ Account : "owns"
-
- Vendor ||--o{ VendorRate : "defines"
- Vendor ||--o{ Task : "owns"
- Vendor ||--o{ Hub : "owns"
- Vendor ||--o{ Role : "defines"
- Vendor ||--o{ Shift : "posts"
- Vendor ||--o{ Staff : "employs"
- Vendor ||--o{ Account : "owns"
-
- Staff ||--o{ Document : "has"
- Staff ||--o{ Certificate : "holds"
- Staff ||--o{ Contact : "has emergency"
- Staff ||--o{ BenefitsData : "accrues"
- Staff ||--o{ TaxForm : "submits"
- Staff ||--o{ TimeSheet : "fills"
- Staff ||--o{ Assignment : "receives"
- Staff ||--o{ Account : "owns"
- Staff ||--o{ RecentPayment : "is paid to"
- Staff ||--o{ RequiredDoc : "owns"
- Staff ||--o{ Application : "submits"
- Hub ||--o{ Staff : "is based at"
-
- Shift ||--o{ TimeSheet : "generates"
- Shift ||--o{ Application : "receives"
-
- "Order" ||--o{ Shift : "contains"
- "Order" ||--o{ Position : "requires"
-
- Task ||--o{ TaskComment : "has"
-
- Team ||--o{ TeamMember : "has"
- Team ||--o{ TeamHub : "operates in"
-
- Conversation ||--o{ Message : "contains"
-
- Position ||--o{ Schedule : "has"
- Role ||--o{ Position : "is for"
-
- %% Join Tables
- Staff ||--|{ StaffShift : "works"
- Shift ||--|{ StaffShift : "is worked by"
- Staff ||--|{ StaffCourse : "enrolls in"
- Course ||--|{ StaffCourse : "is taken by"
- TeamMember ||--|{ MemberTask : "assigned to"
- Task ||--|{ MemberTask : "is assigned to"
diff --git a/backend/dataconnect/docs/staff_app_diagram.mmd b/backend/dataconnect/docs/staff_app_diagram.mmd
deleted file mode 100644
index d251a18e..00000000
--- a/backend/dataconnect/docs/staff_app_diagram.mmd
+++ /dev/null
@@ -1,121 +0,0 @@
-flowchart LR
-
-subgraph L1["login/create user"]
- S_auth_phone["phone_verification_screen.dart"]
- S_auth_phone --> S_auth_phone_Q["Queries
* user - getUserById
* staff - getStaffByUserId"]
- S_auth_phone --> S_auth_phone_M["Mutations
* user - createUser"]
- S_auth_phone --> S_auth_phone_F["Firebase
* user - auth"]
-end
-
-subgraph L2["Profile"]
- S_worker_profile["worker_profile_screen.dart"]
- S_worker_profile --> S_worker_profile_Q["Queries
* user - getUserById
* staff - getStaffByUserId"]
-end
-
-subgraph L3["Personal info"]
- S_personal_info["personal_info_screen.dart"]
- S_personal_info --> S_personal_info_Q["Queries
* staff - getStaffByUserId"]
- S_personal_info --> S_personal_info_M["Mutations
* staff - UpdateStaff"]
-end
-
-subgraph L4["Emergency Contact"]
- S_emergency["emergency_contact_screen.dart"]
- S_emergency --> S_emergency_Q["Queries
* contact - getContactsByStaffId"]
- S_emergency --> S_emergency_M["Mutations
* contact - updateContact
* contact - createContact
* contact - deleteContact"]
-end
-
-subgraph L5["Experience & skills"]
- S_experience["experience_screen.dart"]
- S_experience --> S_experience_Q["Queries
* staff - getStaffByUserId"]
- S_experience --> S_experience_M["Mutations
* staff - UpdateStaff"]
-end
-
-subgraph L6["Attire"]
- S_attire["attire_screen.dart"]
- S_attire --> S_attire_Q["Queries
* attireOption - listAttireOptions
* staff - getStaffByUserId"]
- S_attire --> S_attire_M["Mutations
* staff - UpdateStaff"]
-end
-
-subgraph L7["Documents"]
- S_documents["documents_screen.dart"]
- S_documents --> S_documents_Q["Queries
* document - getDocumentsByStaffId"]
- S_documents --> S_documents_M["Mutations
* document - updateDocument"]
-end
-
-subgraph L8["Certificates"]
- S_certificates["certificates_screen.dart"]
- S_certificates --> S_certificates_Q["Queries
* certificate - listCertificatesByStaffId"]
- S_certificates --> S_certificates_M["Mutations
* certificate - UpdateCertificate
* certificate - CreateCertificate
* certificate - DeleteCertificate"]
-end
-
-subgraph L9["Tax Documents"]
- S_tax_forms["tax_forms_screen.dart"]
- S_tax_forms --> S_tax_forms_Q["Queries
* taxForm - getTaxFormsBystaffId"]
- S_tax_forms --> S_tax_forms_M["Mutations
* taxForm - createTaxForm
* taxForm - updateTaxForm"]
-end
-
-subgraph L10["KROW University"]
- S_uni["krow_university_screen.dart"]
- S_uni --> S_uni_Q["Queries
* course - listCourses
* staffCourse - listStaffCoursesByStaffId
* staff - getStaffByUserId
* level - listLevels
* certificate - listCertificatesByStaffId"]
-end
-
-subgraph L11["Trainings"]
- S_trainings["trainings_screen.dart"]
- S_trainings --> S_trainings_Q["Queries
* course - listCourses
* staffCourse - listStaffCoursesByStaffId"]
-end
-
-subgraph L12["Leaderboard"]
- S_leaderboard["leaderboard_screen.dart"]
- S_leaderboard --> S_leaderboard_Q["Queries
* staffCourse - missing"]
-end
-
-subgraph L13["Bank Account"]
- S_bank["bank_account_screen.dart"]
- S_bank --> S_bank_Q["Queries
* account - getAccountsByOwnerId"]
- S_bank --> S_bank_M["Mutations
* account - createAccount
* account - updateAccount
* account - deleteAccount"]
-end
-
-subgraph L14["Earnings/Payments"]
- S_payments["payments_screen.dart"]
- S_payments --> S_payments_Q["Queries
* recentPayment - getRecentPaymentsByPayedUserId"]
-end
-
-subgraph L15["Timecard"]
- S_timecard["time_card_screen.dart"]
- S_timecard --> S_timecard_Q["Queries
* timeSheet - getTimeSheetsByStaffId"]
-end
-
-subgraph L16["Clock in"]
- S_clockin["clock_in_screen.dart"]
- S_clockin --> S_clockin_Q["Queries
* application - getApplicationsByStaffId"]
- S_clockin --> S_clockin_M["Mutations
* application - createApplication
* application - updateApplicationStatus"]
-end
-
-subgraph L17["Shifts"]
- S_shifts["shifts_screen.dart"]
- S_shifts --> S_shifts_Q["Queries
* application - getApplicationsByStaffId
* shift - filterShifts
* timeSheet - getTimeSheetsByStaffId"]
- S_shifts --> S_shifts_M["Mutations
* application - updateApplicationStatus
* shift - CreateShift
* application - createApplication
* staffShift - createStaffShift"]
-end
-
-subgraph L18["My availability"]
- S_availability["availability_screen.dart"]
- S_availability --> S_availability_Q["Queries
* staffAvailability - getStaffAvailabilityByStaffId"]
- S_availability --> S_availability_M["Mutations
* staffAvailability - updateStaffAvailability
* staffAvailability - createStaffAvailability
* staffAvailability - deleteStaffAvailability"]
-end
-
-subgraph L19["Your Benefits Overview"]
- S_benefits["benefits_screen.dart"]
- S_benefits --> S_benefits_Q["Queries
* benefitsData - getBenefitsDataByStaffId"]
- S_benefits --> S_benefits_M["Mutations
* benefitsData - updateBenefitsData"]
-end
-
-subgraph L20["Home"]
- S_home["worker_home_screen.dart"]
- S_home --> S_home_Q["Queries
* application - getApplicationsByStaffId
* shift - filterShifts
* benefitsData - getBenefitsDataByStaffId"]
-end
-
-subgraph L21["Shift detail"]
- S_shift_detail["shift_details_screen.dart"]
- S_shift_detail --> S_shift_detail_Q["Queries
* application - getApplicationsByStaffId"]
- S_shift_detail --> S_shift_detail_M["Mutations
* application - updateApplicationStatus"]
-end
diff --git a/backend/dataconnect/schema/ShiftRole.gql b/backend/dataconnect/schema/ShiftRole.gql
new file mode 100644
index 00000000..1b3598d3
--- /dev/null
+++ b/backend/dataconnect/schema/ShiftRole.gql
@@ -0,0 +1,32 @@
+enum BreakDuration {
+ MIN_15
+ MIN_30
+ NO_BREAK
+}
+
+#this is position, timesheet and schedule in staff app
+type ShiftRole @table(name: "shift_roles", key: ["shiftId", "roleId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ shiftId: UUID!
+ shift: Shift! @ref(fields: "shiftId", references: "id")
+
+ roleId: UUID!
+ role: Role! @ref(fields: "roleId", references: "id")
+
+ # demand / requirements
+ count: Int!
+ assigned: Int @default(expr: "0")
+
+ startTime: Timestamp
+ endTime: Timestamp
+ hours: Float
+
+ department: String
+ uniform: String
+ breakType: BreakDuration
+ totalValue: Float
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+}
diff --git a/backend/dataconnect/schema/VendorBenefitPlan.gql b/backend/dataconnect/schema/VendorBenefitPlan.gql
new file mode 100644
index 00000000..e58868df
--- /dev/null
+++ b/backend/dataconnect/schema/VendorBenefitPlan.gql
@@ -0,0 +1,17 @@
+type VendorBenefitPlan @table(name: "vendor_benefit_plans") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ vendorId: UUID!
+ vendor: Vendor! @ref(fields: "vendorId", references: "id")
+
+ title: String!
+ description: String
+ requestLabel: String
+
+ total: Int
+ isActive: Boolean @default(expr: "true")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/account.gql b/backend/dataconnect/schema/account.gql
new file mode 100644
index 00000000..65862520
--- /dev/null
+++ b/backend/dataconnect/schema/account.gql
@@ -0,0 +1,17 @@
+
+enum AccountType {
+ CHECKING
+ SAVINGS
+}
+
+type Account @table(name: "accounts") {
+ id: UUID! @default(expr: "uuidV4()")
+ bank: String!
+ type: AccountType!
+ last4: String!
+ isPrimary: Boolean
+ ownerId: UUID! #staff/business
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/activityLog.gql b/backend/dataconnect/schema/activityLog.gql
new file mode 100644
index 00000000..f7b16658
--- /dev/null
+++ b/backend/dataconnect/schema/activityLog.gql
@@ -0,0 +1,39 @@
+enum ActivityIconType {
+ INVOICE
+ CHECK
+ ALERT
+ MESSAGE
+ CALENDAR
+}
+
+enum ActivityType {
+ ORDER_CREATED
+ SHIFT_UPDATE
+ COMPLIANCE_ALERT
+ MESSAGE_RECEIVED
+ SYSTEM_UPDATE
+}
+
+type ActivityLog @table(name: "activity_logs") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ userId: String!
+
+ #app
+ date: Timestamp!
+ hourStart: String
+ hourEnd: String
+ totalhours: String
+ iconType: ActivityIconType
+ iconColor: String
+
+ #web
+ title: String!
+ description: String!
+ isRead: Boolean @default(expr: "false")
+ activityType: ActivityType!
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/application.gql b/backend/dataconnect/schema/application.gql
new file mode 100644
index 00000000..ed5294fc
--- /dev/null
+++ b/backend/dataconnect/schema/application.gql
@@ -0,0 +1,42 @@
+enum ApplicationStatus {
+ PENDING
+ ACCEPTED
+ REJECTED
+ CONFIRMED
+ CHECKED_IN
+ CHECKED_OUT
+ LATE
+ NO_SHOW
+}
+
+enum ApplicationOrigin {
+ STAFF
+ EMPLOYER #like vendor
+}
+
+#position
+type Application @table(name: "applications") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ shiftId: UUID!
+ shift: Shift! @ref(fields: "shiftId", references: "id")
+
+ staffId: UUID!
+ staff: Staff! @ref(fields: "staffId", references: "id")
+
+ roleId: UUID!
+ shiftRole: ShiftRole! @ref(
+ fields: ["shiftId", "roleId"],
+ references: ["shiftId", "roleId"]
+ )
+
+ status: ApplicationStatus!
+ appliedAt: Timestamp @default(expr: "request.time")
+ checkInTime: Timestamp
+ checkOutTime: Timestamp
+ origin: ApplicationOrigin!
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/assignment.gql b/backend/dataconnect/schema/assignment.gql
new file mode 100644
index 00000000..0b692553
--- /dev/null
+++ b/backend/dataconnect/schema/assignment.gql
@@ -0,0 +1,46 @@
+enum AssignmentStatus {
+ PENDING
+ CONFIRMED
+ OPEN
+ COMPLETED
+ CANCELED
+ ACTIVE
+}
+
+type Assignment @table(name: "assignments") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ # Who is doing the assignment
+ workforceId: UUID!
+ workforce: Workforce! @ref(fields: "workforceId", references: "id")
+
+ # What exact shift + role this assignment is for
+ roleId: UUID!
+ shiftId: UUID!
+
+ shiftRole: ShiftRole! @ref(
+ fields: ["shiftId", "roleId"],
+ references: ["shiftId", "roleId"]
+ )
+
+ # --- task info ---
+ title: String
+ description: String
+ instructions: String
+
+ status: AssignmentStatus @default(expr: "'PENDING'")
+
+ # flags / perks
+ tipsAvailable: Boolean
+ travelTime: Boolean
+ mealProvided: Boolean
+ parkingAvailable: Boolean
+ gasCompensation: Boolean
+
+ # Optional managers list (still ok as json)
+ managers: [Any!]
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String @default(expr: "auth.uid")
+}
\ No newline at end of file
diff --git a/backend/dataconnect/schema/attireOption.gql b/backend/dataconnect/schema/attireOption.gql
new file mode 100644
index 00000000..2c09a410
--- /dev/null
+++ b/backend/dataconnect/schema/attireOption.gql
@@ -0,0 +1,15 @@
+type AttireOption @table(name: "attire_options") {
+ id: UUID! @default(expr: "uuidV4()")
+ itemId: String!
+ label: String!
+ icon: String
+ imageUrl: String
+ isMandatory: Boolean
+
+ # Relations / ownership
+ vendorId: UUID
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/benefitsData.gql b/backend/dataconnect/schema/benefitsData.gql
new file mode 100644
index 00000000..397d80f3
--- /dev/null
+++ b/backend/dataconnect/schema/benefitsData.gql
@@ -0,0 +1,15 @@
+type BenefitsData @table(name: "benefits_data", key: ["staffId", "vendorBenefitPlanId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ vendorBenefitPlanId: UUID!
+ vendorBenefitPlan: VendorBenefitPlan! @ref( fields: "vendorBenefitPlanId", references: "id" )
+
+ current: Int!
+
+ staffId: UUID!
+ staff: Staff! @ref( fields: "staffId", references: "id" )
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/business.gql b/backend/dataconnect/schema/business.gql
new file mode 100644
index 00000000..fcc1df9a
--- /dev/null
+++ b/backend/dataconnect/schema/business.gql
@@ -0,0 +1,53 @@
+enum BusinessArea {
+ BAY_AREA
+ SOUTHERN_CALIFORNIA
+ NORTHERN_CALIFORNIA
+ CENTRAL_VALLEY
+ OTHER
+}
+
+enum BusinessSector {
+ BON_APPETIT
+ EUREST
+ ARAMARK
+ EPICUREAN_GROUP
+ CHARTWELLS
+ OTHER
+}
+
+enum BusinessRateGroup {
+ STANDARD
+ PREMIUM
+ ENTERPRISE
+ CUSTOM
+}
+
+enum BusinessStatus {
+ ACTIVE
+ INACTIVE
+ PENDING
+}
+
+type Business @table(name: "businesses") {
+ id: UUID! @default(expr: "uuidV4()")
+ businessName: String!
+ contactName: String
+ userId: String!
+
+ companyLogoUrl: String
+ phone: String
+ email: String
+ hubBuilding: String
+ address: String
+ city: String
+ area: BusinessArea
+ sector: BusinessSector
+ rateGroup: BusinessRateGroup!
+ status: BusinessStatus!
+ notes: String
+
+ # --- TIMESTAMPS ---
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/category.gql b/backend/dataconnect/schema/category.gql
new file mode 100644
index 00000000..905e9837
--- /dev/null
+++ b/backend/dataconnect/schema/category.gql
@@ -0,0 +1,10 @@
+#courses categories
+type Category @table(name: "categories") {
+ id: UUID! @default(expr: "uuidV4()")
+ categoryId: String!
+ label: String!
+ icon: String
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/certificate.gql b/backend/dataconnect/schema/certificate.gql
new file mode 100644
index 00000000..4f91b2f6
--- /dev/null
+++ b/backend/dataconnect/schema/certificate.gql
@@ -0,0 +1,54 @@
+enum ComplianceType {
+ BACKGROUND_CHECK
+ FOOD_HANDLER
+ RBS
+ LEGAL
+ OPERATIONAL
+ SAFETY
+ TRAINING
+ LICENSE
+ OTHER
+}
+
+enum CertificateStatus {
+ CURRENT
+ EXPIRING_SOON
+ COMPLETED
+ PENDING
+ EXPIRED
+ EXPIRING
+ NOT_STARTED
+}
+
+enum ValidationStatus {
+ APPROVED
+ PENDING_EXPERT_REVIEW
+ REJECTED
+ AI_VERIFIED
+ AI_FLAGGED
+ MANUAL_REVIEW_NEEDED
+}
+
+
+type Certificate @table(name: "certificates") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ name: String!
+ description: String
+ expiry: Timestamp
+ status: CertificateStatus!
+ fileUrl: String
+ icon: String
+ certificationType: ComplianceType
+ issuer: String #Issuing Authority
+ certificateNumber: String
+
+ validationStatus: ValidationStatus
+
+ staffId: UUID!
+ staff: Staff! @ref(fields: "staffId", references: "id")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/clientFeedback.gql b/backend/dataconnect/schema/clientFeedback.gql
new file mode 100644
index 00000000..70a34bc6
--- /dev/null
+++ b/backend/dataconnect/schema/clientFeedback.gql
@@ -0,0 +1,17 @@
+type ClientFeedback @table(name: "client_feedbacks") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ businessId: UUID!
+ business: Business! @ref(fields: "businessId", references: "id")
+
+ vendorId: UUID!
+ vendor: Vendor! @ref(fields: "vendorId", references: "id")
+
+ rating: Int
+ comment: String
+ date: Timestamp
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/conversation.gql b/backend/dataconnect/schema/conversation.gql
new file mode 100644
index 00000000..aa32abc5
--- /dev/null
+++ b/backend/dataconnect/schema/conversation.gql
@@ -0,0 +1,30 @@
+enum ConversationStatus {
+ ACTIVE
+}
+
+enum ConversationType {
+ CLIENT_VENDOR
+ GROUP_STAFF
+ STAFF_CLIENT
+ STAFF_ADMIN
+ VENDOR_ADMIN
+ CLIENT_ADMIN
+ GROUP_STAFF
+ GROUP_ORDER_STAFF
+}
+
+type Conversation @table(name: "conversations") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ subject: String
+ status: ConversationStatus
+ conversationType: ConversationType
+ isGroup: Boolean
+ groupName: String
+ lastMessage: String
+ lastMessageAt: Timestamp #lastTime
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/course.gql b/backend/dataconnect/schema/course.gql
new file mode 100644
index 00000000..91e791d5
--- /dev/null
+++ b/backend/dataconnect/schema/course.gql
@@ -0,0 +1,18 @@
+type Course @table(name: "courses") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ title: String
+ description: String
+ thumbnailUrl: String
+ durationMinutes: Int
+ xpReward: Int
+ categoryId: UUID!
+ category: Category! @ref(fields: "categoryId", references: "id")
+
+ levelRequired: String
+ isCertification: Boolean
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/customRateCard.gql b/backend/dataconnect/schema/customRateCard.gql
new file mode 100644
index 00000000..c38a6cda
--- /dev/null
+++ b/backend/dataconnect/schema/customRateCard.gql
@@ -0,0 +1,10 @@
+type CustomRateCard @table(name: "custom_rate_cards") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+ baseBook: String
+ discount: Float
+ isDefault: Boolean
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/document.gql b/backend/dataconnect/schema/document.gql
new file mode 100644
index 00000000..b0657b10
--- /dev/null
+++ b/backend/dataconnect/schema/document.gql
@@ -0,0 +1,20 @@
+
+enum DocumentType {
+ W4_FORM
+ I9_FORM
+ STATE_TAX_FORM
+ DIRECT_DEPOSIT
+ ID_COPY
+ SSN_CARD
+ WORK_PERMIT
+}
+
+type Document @table(name: "documents") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+ description: String
+ documentType: DocumentType!
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/emergencyContact.gql b/backend/dataconnect/schema/emergencyContact.gql
new file mode 100644
index 00000000..fdcd7268
--- /dev/null
+++ b/backend/dataconnect/schema/emergencyContact.gql
@@ -0,0 +1,17 @@
+enum RelationshipType {
+ FAMILY
+ SPOUSE
+ FRIEND
+ OTHER
+}
+
+type EmergencyContact @table(name: "emergecyContacts") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+ phone: String!
+ relationship: RelationshipType!
+ staffId: UUID!
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/faqData.gql b/backend/dataconnect/schema/faqData.gql
new file mode 100644
index 00000000..e5fb8974
--- /dev/null
+++ b/backend/dataconnect/schema/faqData.gql
@@ -0,0 +1,8 @@
+type FaqData @table(name: "faq_data") {
+ id: UUID! @default(expr: "uuidV4()")
+ category: String!
+ questions: [Any!]
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/hub.gql b/backend/dataconnect/schema/hub.gql
new file mode 100644
index 00000000..98a6f5b3
--- /dev/null
+++ b/backend/dataconnect/schema/hub.gql
@@ -0,0 +1,11 @@
+type Hub @table(name: "hubs") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+ locationName: String
+ address: String
+ nfcTagId: String
+ ownerId: UUID!
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/invoice.gql b/backend/dataconnect/schema/invoice.gql
new file mode 100644
index 00000000..89306cab
--- /dev/null
+++ b/backend/dataconnect/schema/invoice.gql
@@ -0,0 +1,60 @@
+enum InvoiceStatus {
+ PAID
+ PENDING
+ OVERDUE
+ PENDING_REVIEW
+ APPROVED
+ DISPUTED
+ DRAFT
+}
+
+enum InovicePaymentTerms{
+ NET_30
+ NET_45
+ NET_60
+}
+
+type Invoice @table(name: "invoices") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ status: InvoiceStatus!
+
+ #vendor poner companyName
+ vendorId: UUID!
+ vendor: Vendor! @ref(fields: "vendorId", references: "id")
+
+ #businnes poner businessName
+ businessId: UUID!
+ business: Business! @ref(fields: "businessId", references: "id")
+
+ #order poner eventName
+ orderId: UUID!
+ order: Order! @ref(fields: "orderId", references: "id")
+
+ #web
+ paymentTerms: InovicePaymentTerms
+ invoiceNumber: String!
+ issueDate: Timestamp!
+ dueDate: Timestamp!
+ hub: String
+ managerName: String
+ vendorNumber: String
+ roles: Any #here is for staff
+ charges: Any
+ otherCharges: Float
+ subtotal: Float
+ amount: Float!
+ notes: String
+
+ staffCount: Int
+ chargesCount: Int
+
+ #DISPUTED
+ disputedItems: Any @col(dataType: "jsonb")
+ disputeReason: String
+ disputeDetails: String
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/invoiceTemplate.gql b/backend/dataconnect/schema/invoiceTemplate.gql
new file mode 100644
index 00000000..07040154
--- /dev/null
+++ b/backend/dataconnect/schema/invoiceTemplate.gql
@@ -0,0 +1,47 @@
+
+enum InovicePaymentTermsTemp{
+ NET_30
+ NET_45
+ NET_60
+}
+
+type InvoiceTemplate @table(name: "invoice_templates") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+
+ ownerId: UUID!#vendor/business
+
+ #vendor poner companyName
+ vendorId: UUID
+ vendor: Vendor @ref(fields: "vendorId", references: "id")
+
+ #businnes poner businessName
+ businessId: UUID
+ business: Business @ref(fields: "businessId", references: "id")
+
+ #order poner eventName
+ orderId: UUID
+ order: Order @ref(fields: "orderId", references: "id")
+
+ #web
+ paymentTerms: InovicePaymentTermsTemp
+ invoiceNumber: String
+ issueDate: Timestamp
+ dueDate: Timestamp
+ hub: String
+ managerName: String
+ vendorNumber: String
+ roles: Any #here is for staff
+ charges: Any
+ otherCharges: Float
+ subtotal: Float
+ amount: Float
+ notes: String
+
+ staffCount: Int
+ chargesCount: Int
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/level.gql b/backend/dataconnect/schema/level.gql
new file mode 100644
index 00000000..fe64dbd6
--- /dev/null
+++ b/backend/dataconnect/schema/level.gql
@@ -0,0 +1,10 @@
+type Level @table(name: "levels") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+ xpRequired: Int!
+ icon: String
+ colors: Any
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/memberTask.gql b/backend/dataconnect/schema/memberTask.gql
new file mode 100644
index 00000000..0e66bfcc
--- /dev/null
+++ b/backend/dataconnect/schema/memberTask.gql
@@ -0,0 +1,13 @@
+
+type MemberTask @table(name: "member_tasks", key: ["teamMemberId", "taskId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ teamMemberId: UUID!
+ teamMember: TeamMember! @ref(fields: "teamMemberId", references: "id")
+
+ taskId: UUID!
+ task: Task! @ref(fields: "taskId", references: "id")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+}
diff --git a/backend/dataconnect/schema/message.gql b/backend/dataconnect/schema/message.gql
new file mode 100644
index 00000000..2afe899e
--- /dev/null
+++ b/backend/dataconnect/schema/message.gql
@@ -0,0 +1,16 @@
+type Message @table(name: "messages") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ conversationId: UUID!
+
+ senderId: String! #userId
+ #senderName: String
+ user: User! @ref(fields: "senderId", references: "id")
+
+ content: String!
+ isSystem: Boolean
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/order.gql b/backend/dataconnect/schema/order.gql
new file mode 100644
index 00000000..3ce96cae
--- /dev/null
+++ b/backend/dataconnect/schema/order.gql
@@ -0,0 +1,65 @@
+enum OrderType {
+ ONE_TIME
+ PERMANENT
+ RECURRING
+ RAPID
+}
+
+enum OrderStatus {
+ DRAFT
+ POSTED
+ FILLED
+ COMPLETED
+ CANCELLED
+ PENDING
+ FULLY_STAFFED
+ PARTIAL_STAFFED
+}
+
+enum OrderDuration {
+ WEEKLY
+ MONTHLY
+}
+
+#events
+type Order @table(name: "orders") {
+ id: UUID! @default(expr: "uuidV4()")
+ eventName: String
+
+ vendorId: UUID!
+ vendor: Vendor! @ref(fields: "vendorId", references: "id")
+
+ businessId: UUID!
+ business: Business! @ref(fields: "businessId", references: "id")
+
+ orderType: OrderType!
+ location: String
+ status: OrderStatus! @default(expr: "'DRAFT'")
+ duration: OrderDuration
+ lunchBreak: Int
+ total: Float
+ deparment: String
+
+ assignedStaff: Any @col(dataType: "jsonb")
+ shifts: Any @col(dataType: "jsonb")
+
+ requested: Int
+ hub: String
+
+ date: Timestamp
+
+ startDate: Timestamp #for recurring and permanent
+ endDate: Timestamp #for recurring and permanent
+
+ recurringDays: Any @col(dataType: "jsonb")
+ poReference: String
+
+ permanentDays: Any @col(dataType: "jsonb")
+
+ detectedConflicts: Any @col(dataType:"jsonb")
+ notes: String
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/recentPayment.gql b/backend/dataconnect/schema/recentPayment.gql
new file mode 100644
index 00000000..2ebd37b9
--- /dev/null
+++ b/backend/dataconnect/schema/recentPayment.gql
@@ -0,0 +1,39 @@
+enum RecentPaymentStatus {
+ PAID
+ PENDING
+ FAILED
+}
+
+type RecentPayment @table(name: "recent_payments") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ workedTime: String
+
+ status: RecentPaymentStatus
+
+ staffId: UUID!
+ applicationId: UUID!
+ application: Application! @ref(fields: "applicationId", references: "id")
+
+ #title: String poner en queries ,dentro de application esta shiftrole que tiene shift adentro, que tiene title
+ #date: Timestamp poner en queries ,dentro de application esta shiftrole que tiene shift adentro, que tiene date
+ #address: String poner en queries ,dentro de application esta shiftrole que tiene shift adentro, que tiene locationAddress
+
+ #hours: Float poner en queries ,dentro de application esta shiftrole, dentro de shiftrole esta hours
+ #rate: Float poner en queries ,dentro de application esta shiftrole, dentro de shiftrole esta role que tiene costPerHours
+ #rolename: Float poner en queries ,dentro de application esta shiftrole, dentro de shiftrole esta role que tiene name
+ #amount: Float poner en queries ,dentro de application esta shiftrole que tiene totalValue
+ #startTime poner en queries ,dentro de application esta shiftrole que tiene startTime
+ #endTime poner en queries ,dentro de application esta shiftrole que tiene endTime
+
+ invoiceId: UUID!
+ invoice: Invoice! @ref(fields: "invoiceId", references: "id")
+ #poner en queries q salga una busuqeda por businessId que tiene business que esta en invoice, tmbn por vendor
+
+ #location: String oner en queries, esto esta dentro de order que tiene invoce, location
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
+
diff --git a/backend/dataconnect/schema/role.gql b/backend/dataconnect/schema/role.gql
new file mode 100644
index 00000000..fb3f6772
--- /dev/null
+++ b/backend/dataconnect/schema/role.gql
@@ -0,0 +1,13 @@
+type Role @table(name: "roles") {
+ id: UUID! @default(expr: "uuidV4()")
+ name: String!
+
+ vendorId: UUID!
+
+ roleCategoryId: UUID!
+
+ costPerHour: Float!
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/roleCategory.gql b/backend/dataconnect/schema/roleCategory.gql
new file mode 100644
index 00000000..2168f1f2
--- /dev/null
+++ b/backend/dataconnect/schema/roleCategory.gql
@@ -0,0 +1,20 @@
+enum RoleCategoryType {
+ KITCHEN_AND_CULINARY
+ CONCESSIONS
+ FACILITIES
+ BARTENDING
+ SECURITY
+ EVENT_STAFF
+ MANAGEMENT
+ TECHNICAL
+ OTHER
+}
+
+type RoleCategory @table(name: "role_categories") {
+ id: UUID! @default(expr: "uuidV4()")
+ roleName: String!
+ category: RoleCategoryType!
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/shift.gql b/backend/dataconnect/schema/shift.gql
new file mode 100644
index 00000000..30c7dd9c
--- /dev/null
+++ b/backend/dataconnect/schema/shift.gql
@@ -0,0 +1,47 @@
+enum ShiftStatus {
+ DRAFT
+ FILLED
+ PENDING
+ ASSIGNED
+ CONFIRMED
+ OPEN
+ IN_PROGRESS
+ COMPLETED
+ CANCELED
+}
+
+type Shift @table(name: "shifts") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ title: String!
+
+ orderId: UUID!
+ order: Order! @ref(fields: "orderId", references: "id")
+
+ date: Timestamp
+ startTime: Timestamp
+ endTime: Timestamp
+ hours: Float
+ cost: Float
+
+ location: String
+ locationAddress: String
+ latitude: Float
+ longitude: Float
+ description: String
+
+ status: ShiftStatus
+ workersNeeded: Int
+ filled: Int
+ filledAt: Timestamp
+
+ # JSON list of managers (e.g. [{name, phone, avatar}, ...])
+ managers: [Any!]
+
+ durationDays: Int
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
+
diff --git a/backend/dataconnect/schema/staff.gql b/backend/dataconnect/schema/staff.gql
new file mode 100644
index 00000000..fc201204
--- /dev/null
+++ b/backend/dataconnect/schema/staff.gql
@@ -0,0 +1,93 @@
+
+enum BackgroundCheckStatus {
+ PENDING
+ CLEARED
+ FAILED
+ EXPIRED
+ NOT_REQUIRED
+}
+
+enum EmploymentType {
+ FULL_TIME
+ PART_TIME
+ ON_CALL
+ WEEKENDS
+ SPECIFIC_DAYS
+ SEASONAL
+ MEDICAL_LEAVE
+}
+
+enum DepartmentType {
+ OPERATIONS
+ SALES
+ HR
+ FINANCE
+ IT
+ MARKETING
+ CUSTOMER_SERVICE
+ LOGISTICS
+}
+
+enum EnglishProficiency {
+ FLUENT
+ INTERMEDIATE
+ BASIC
+ NONE
+}
+
+type Staff @table(name: "staffs") {
+ id: UUID! @default(expr: "uuidV4()")
+ userId: String!
+
+ # Identity
+ fullName: String!
+ level: String
+ role: String
+ phone: String
+ email: String
+ photoUrl: String
+
+ # Metrics
+ totalShifts: Int
+ averageRating: Float
+ onTimeRate: Int
+ noShowCount: Int
+ cancellationCount: Int
+ reliabilityScore: Int
+
+ # Gamification
+ xp: Int @default(expr: "0")
+ badges: Any
+
+ # Profile
+ bio: String
+ #skills: Any changed it for staffRole
+ industries: Any
+ preferredLocations: Any
+ maxDistanceMiles: Int
+ languages: Any
+ itemsAttire: Any
+
+ # Recommendation
+ isRecommended: Boolean @default(expr: "false")
+
+ # Relations / ownership
+ ownerId: UUID #vendor/business
+
+ # web
+ department: DepartmentType
+ hubId: UUID
+ manager: UUID
+ english: EnglishProficiency
+
+ backgroundCheckStatus: BackgroundCheckStatus
+ employmentType: EmploymentType
+ initial: String
+ englishRequired: Boolean @default(expr: "false")
+ city: String
+ addres: String
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/staffAvailability.gql b/backend/dataconnect/schema/staffAvailability.gql
new file mode 100644
index 00000000..0c6787e3
--- /dev/null
+++ b/backend/dataconnect/schema/staffAvailability.gql
@@ -0,0 +1,42 @@
+
+enum DayOfWeek {
+ SUNDAY
+ MONDAY
+ TUESDAY
+ WEDNESDAY
+ THURSDAY
+ FRIDAY
+ SATURDAY
+}
+
+enum AvailabilitySlot {
+ MORNING
+ AFTERNOON
+ EVENING
+}
+
+enum AvailabilityStatus {
+ CONFIRMED_AVAILABLE
+ UNKNOWN
+ BLOCKED
+}
+
+#3 in day, its good?
+
+type StaffAvailability @table(name: "staff_availabilities", key: ["staffId", "day", "slot"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ staffId: UUID!
+ staff: Staff! @ref(fields: "staffId", references: "id")
+
+ day: DayOfWeek!
+ slot: AvailabilitySlot!
+
+ status: AvailabilityStatus! @default(expr: "'CONFIRMED_AVAILABLE'")
+
+ notes: String
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String @default(expr: "auth.uid")
+}
\ No newline at end of file
diff --git a/backend/dataconnect/schema/staffAvailabilityStats.gql b/backend/dataconnect/schema/staffAvailabilityStats.gql
new file mode 100644
index 00000000..2e2cca47
--- /dev/null
+++ b/backend/dataconnect/schema/staffAvailabilityStats.gql
@@ -0,0 +1,18 @@
+type StaffAvailabilityStats @table(name: "staff_availability_stats", key: ["staffId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ staffId: UUID!
+ staff: Staff! @ref(fields: "staffId", references: "id")
+
+ needWorkIndex: Int
+ utilizationPercentage: Int
+ predictedAvailabilityScore: Int
+ scheduledHoursThisPeriod: Int
+ desiredHoursThisPeriod: Int
+ lastShiftDate: Timestamp
+ acceptanceRate: Int
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String @default(expr: "auth.uid")
+}
\ No newline at end of file
diff --git a/backend/dataconnect/schema/staffCourse.gql b/backend/dataconnect/schema/staffCourse.gql
new file mode 100644
index 00000000..9b321087
--- /dev/null
+++ b/backend/dataconnect/schema/staffCourse.gql
@@ -0,0 +1,15 @@
+type StaffCourse @table(name: "staff_courses") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ staffId: UUID!
+ courseId: UUID!
+
+ progressPercent: Int @default(expr: "0")
+ completed: Boolean @default(expr: "false")
+ completedAt: Timestamp
+ startedAt: Timestamp
+ lastAccessedAt: Timestamp
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+}
diff --git a/backend/dataconnect/schema/staffDocument.gql b/backend/dataconnect/schema/staffDocument.gql
new file mode 100644
index 00000000..65c26058
--- /dev/null
+++ b/backend/dataconnect/schema/staffDocument.gql
@@ -0,0 +1,21 @@
+enum DocumentStatus {
+ UPLOADED
+ PENDING
+ EXPIRING
+ MISSING
+ VERIFIED
+}
+
+type StaffDocument @table(name: "staff_documents", key: ["staffId", "documentId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+ staffId: UUID!
+ staffName: String!
+ documentId: UUID!
+ document: Document! @ref(fields: "documentId", references: "id")
+ status: DocumentStatus!
+ documentUrl: String
+ expiryDate: Timestamp
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/staffRole.gql b/backend/dataconnect/schema/staffRole.gql
new file mode 100644
index 00000000..8ca84cfa
--- /dev/null
+++ b/backend/dataconnect/schema/staffRole.gql
@@ -0,0 +1,24 @@
+
+
+enum RoleType {
+ SKILLED
+ BEGINNER
+ CROSS_TRAINED
+}
+
+#this is skills of staff
+type StaffRole @table(name: "staff_roles", key: ["staffId", "roleId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ staffId: UUID!
+ staff: Staff! @ref(fields: "staffId", references: "id")
+
+ roleId: UUID!
+ role: Role! @ref(fields: "roleId", references: "id")
+
+ roleType: RoleType
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/task.gql b/backend/dataconnect/schema/task.gql
new file mode 100644
index 00000000..37cd3b12
--- /dev/null
+++ b/backend/dataconnect/schema/task.gql
@@ -0,0 +1,32 @@
+enum TaskStatus {
+ PENDING
+ IN_PROGRESS
+ COMPLETED
+}
+
+enum TaskPriority {
+ LOW
+ NORMAL
+ HIGH
+}
+
+type Task @table(name: "tasks") {
+
+ id: UUID! @default(expr: "uuidV4()")
+
+ taskName: String! #task identifier
+ description: String
+ priority: TaskPriority!
+ status: TaskStatus!
+ dueDate: Timestamp
+ progress: Int
+ orderIndex: Int
+ commentCount: Int
+ attachmentCount: Int
+ files: Any
+ ownerId:UUID! #client/vendor
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/task_comment.gql b/backend/dataconnect/schema/task_comment.gql
new file mode 100644
index 00000000..ea64af3d
--- /dev/null
+++ b/backend/dataconnect/schema/task_comment.gql
@@ -0,0 +1,15 @@
+type TaskComment @table(name: "task_comments") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ taskId: UUID!
+
+ teamMemberId: UUID!
+ teamMember: TeamMember! @ref(fields: "teamMemberId", references: "id")
+
+ comment: String!
+ isSystem: Boolean! @default(expr: "false")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/taxForm.gql b/backend/dataconnect/schema/taxForm.gql
new file mode 100644
index 00000000..35a36462
--- /dev/null
+++ b/backend/dataconnect/schema/taxForm.gql
@@ -0,0 +1,27 @@
+enum TaxFormStatus {
+ NOT_STARTED
+ DRAFT
+ SUBMITTED
+ APPROVED
+ REJECTED
+}
+
+enum TaxFormType {
+ I9
+ W4
+}
+
+type TaxForm @table(name: "tax_forms") {
+ id: UUID! @default(expr: "uuidV4()")
+ formType: TaxFormType!
+ title: String!
+ subtitle: String
+ description: String
+ status: TaxFormStatus!
+ staffId: UUID!
+ formData: Any
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/team.gql b/backend/dataconnect/schema/team.gql
new file mode 100644
index 00000000..e747e6b5
--- /dev/null
+++ b/backend/dataconnect/schema/team.gql
@@ -0,0 +1,25 @@
+type Team @table(name: "teams") {
+
+ id: UUID! @default(expr: "uuidV4()")
+ teamName: String!
+
+ ownerId: String! #vendor/business
+ ownerName: String!
+ ownerRole: String!
+ email: String
+ companyLogo: String
+
+ totalMembers: Int
+ activeMembers: Int
+ totalHubs: Int
+ departments: Any
+
+ favoriteStaffCount: Int
+ blockedStaffCount: Int
+ favoriteStaff: Any
+ blockedStaff: Any
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/teamHub.gql b/backend/dataconnect/schema/teamHub.gql
new file mode 100644
index 00000000..fada65a5
--- /dev/null
+++ b/backend/dataconnect/schema/teamHub.gql
@@ -0,0 +1,19 @@
+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!
+ state: String!
+ zipCode: String!
+ managerName: String!
+ isActive: Boolean! @default(expr: "true")
+ departments: Any
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/teamHudDeparment.gql b/backend/dataconnect/schema/teamHudDeparment.gql
new file mode 100644
index 00000000..fd90bee6
--- /dev/null
+++ b/backend/dataconnect/schema/teamHudDeparment.gql
@@ -0,0 +1,13 @@
+type TeamHudDepartment @table(name: "team_hud_departments") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ name: String!
+ costCenter: String
+
+ teamHubId: UUID!
+ teamHub: TeamHub! @ref(fields: "teamHubId", references: "id")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/teamMember.gql b/backend/dataconnect/schema/teamMember.gql
new file mode 100644
index 00000000..2cd25ffb
--- /dev/null
+++ b/backend/dataconnect/schema/teamMember.gql
@@ -0,0 +1,40 @@
+enum TeamMemberRole {
+ OWNER
+ ADMIN
+ MEMBER
+ MANAGER
+ VIEWER
+}
+
+enum TeamMemberInviteStatus {
+ PENDING
+ ACCEPTED
+ #EXPIRED
+ CANCELLED
+}
+
+type TeamMember @table(name: "team_members") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ teamId: UUID!
+ team: Team! @ref(fields: "teamId", references: "id")
+
+ userId: String!
+ user: User! @ref(fields: "userId", references: "id")
+
+ role: TeamMemberRole!
+ title: String
+ department: String
+
+ teamHubId: UUID
+ teamHub: TeamHub @ref(fields: "teamHubId", references: "id")
+
+ isActive: Boolean @default(expr: "true")
+
+ inviteStatus: TeamMemberInviteStatus @default(expr: "'PENDING'")
+ inviteCode: UUID! @default(expr: "uuidV4()")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/user.gql b/backend/dataconnect/schema/user.gql
new file mode 100644
index 00000000..4cb4ca24
--- /dev/null
+++ b/backend/dataconnect/schema/user.gql
@@ -0,0 +1,16 @@
+enum UserBaseRole {
+ ADMIN
+ USER
+}
+
+type User @table(name: "users") {
+ id: String! # user_id / uid de Firebase
+ email: String
+ fullName: String
+ role: UserBaseRole!
+ userRole: String
+ photoUrl: String
+ createdDate: Timestamp @default(expr: "request.time")
+ updatedDate: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/userConversation.gql b/backend/dataconnect/schema/userConversation.gql
new file mode 100644
index 00000000..73074e87
--- /dev/null
+++ b/backend/dataconnect/schema/userConversation.gql
@@ -0,0 +1,17 @@
+type UserConversation @table(name: "user_conversations", key: ["conversationId", "userId"]) {
+ id: UUID! @default(expr: "uuidV4()")
+
+ conversationId: UUID!
+ conversation: Conversation! @ref(fields: "conversationId", references: "id")
+
+ userId: String!
+ user: User! @ref(fields: "userId", references: "id")
+
+ # per-user state
+ unreadCount: Int @default(expr: "0")
+ lastReadAt: Timestamp
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
\ No newline at end of file
diff --git a/backend/dataconnect/schema/vendor.gql b/backend/dataconnect/schema/vendor.gql
new file mode 100644
index 00000000..e9ff82de
--- /dev/null
+++ b/backend/dataconnect/schema/vendor.gql
@@ -0,0 +1,39 @@
+
+enum ApprovalStatus {
+ APPROVED
+}
+
+enum VendorTier {
+ PREFERRED
+ APPROVED
+ STANDARD
+}
+
+
+
+type Vendor @table(name: "vendors") {
+ id: UUID! @default(expr: "uuidV4()")
+ userId: String!
+ companyName: String!
+ email: String
+ phone: String
+ photoUrl: String
+ address: String
+ billingAddress: String
+ timezone: String @default(expr: "'UTC'")
+ legalName: String
+ doingBusinessAs: String
+ region: String
+ state: String
+ city: String
+ serviceSpecialty: String
+ approvalStatus: ApprovalStatus
+ isActive: Boolean
+ markup: Float
+ fee: Float
+ csat: Float
+ tier: VendorTier
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/vendorRate.gql b/backend/dataconnect/schema/vendorRate.gql
new file mode 100644
index 00000000..269126aa
--- /dev/null
+++ b/backend/dataconnect/schema/vendorRate.gql
@@ -0,0 +1,31 @@
+enum CategoryType {
+ KITCHEN_AND_CULINARY
+ CONCESSIONS
+ FACILITIES
+ BARTENDING
+ SECURITY
+ EVENT_STAFF
+ MANAGEMENT
+ TECHNICAL
+ OTHER
+}
+
+type VendorRate @table(name: "vendor_rates") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ vendorId: UUID!
+ vendor: Vendor! @ref(fields: "vendorId", references: "id")
+
+ roleName: String
+ category: CategoryType
+ clientRate: Float
+ employeeWage: Float
+ markupPercentage: Float
+ vendorFeePercentage: Float
+ isActive: Boolean
+ notes: String
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String
+}
diff --git a/backend/dataconnect/schema/workforce.gql b/backend/dataconnect/schema/workforce.gql
new file mode 100644
index 00000000..e00058ed
--- /dev/null
+++ b/backend/dataconnect/schema/workforce.gql
@@ -0,0 +1,30 @@
+# enums cant start by a number, reason of W1099
+enum WorkforceEmploymentType {
+ W2
+ W1099
+ TEMPORARY
+ CONTRACT
+}
+
+enum WorkforceStatus {
+ ACTIVE
+ INACTIVE
+}
+
+type Workforce @table( name: "workforce") {
+ id: UUID! @default(expr: "uuidV4()")
+
+ vendorId: UUID!
+ vendor: Vendor! @ref(fields: "vendorId", references: "id")
+
+ staffId: UUID!
+ staff: Staff! @ref(fields: "staffId", references: "id")
+
+ workforceNumber: String!
+ employmentType: WorkforceEmploymentType
+ status: WorkforceStatus @default(expr: "'ACTIVE'")
+
+ createdAt: Timestamp @default(expr: "request.time")
+ updatedAt: Timestamp @default(expr: "request.time")
+ createdBy: String @default(expr: "auth.uid")
+}
\ No newline at end of file
diff --git a/docs/backend-diagram/apps_screen_functions_dataconnect.xlsx b/docs/backend-diagram/apps_screen_functions_dataconnect.xlsx
deleted file mode 100644
index aa20de1f..00000000
Binary files a/docs/backend-diagram/apps_screen_functions_dataconnect.xlsx and /dev/null differ
diff --git a/docs/backend-diagram/client_app_diagram.mmd b/docs/backend-diagram/client_app_diagram.mmd
deleted file mode 100644
index 38d4868c..00000000
--- a/docs/backend-diagram/client_app_diagram.mmd
+++ /dev/null
@@ -1,74 +0,0 @@
-flowchart LR
-
-subgraph C1["Login"]
- S_client_sign_in["client_sign_in_screen.dart"]
- S_client_sign_in --> S_client_sign_in_Q["Queries
* user - getUserById
* business - getBusinessesByUserId"]
- S_client_sign_in --> S_client_sign_in_F["Firebase
* user - auth"]
-end
-
-subgraph C2["Create account"]
- S_client_sign_up["client_sign_up_screen.dart"]
- S_client_sign_up --> S_client_sign_up_Q["Queries
* business - getBusinessesByUserId"]
- S_client_sign_up --> S_client_sign_up_M["Mutations
* user - createUser
* business - createBusiness"]
-end
-
-subgraph C3["Edit account"]
- S_edit_account_na["manual_or_unknown_screen.dart"]
- S_edit_account_na --> S_edit_account_na_M["Mutations
* business - updateBusiness"]
-end
-
-subgraph C4["Profile"]
- S_client_settings["client_settings_screen.dart"]
- S_client_settings --> S_client_settings_Q["Queries
* user - getUserById
* business - getBusinessesByUserId"]
-end
-
-subgraph C5["Hubs"]
- S_client_hubs["client_hubs_screen.dart"]
- S_client_hubs --> S_client_hubs_Q["Queries
* hub - getHubsByOwnerId"]
- S_client_hubs --> S_client_hubs_M["Mutations
* hub - createHub
* hub - updateHub
* hub - deleteHub"]
-end
-
-subgraph C6["Orders"]
- S_client_shifts["client_shifts_screen.dart"]
- S_client_shifts --> S_client_shifts_Q["Queries
* order - getOrdersByOwnerId"]
-end
-
-subgraph C7["RAPID Order"]
- S_rapid_order["rapid_order_flow_page.dart"]
- S_rapid_order --> S_rapid_order_M["Mutations
* order - createOrder"]
-end
-
-subgraph C8["One-time Order"]
- S_one_time["one_time_order_flow_page.dart"]
- S_one_time --> S_one_time_Q["Queries
* role - listRolesByOwnerId"]
- S_one_time --> S_one_time_M["Mutations
* position - createPosition
* order - createOrder"]
-end
-
-subgraph C9["Permanent Placement"]
- S_permanent["permanent_order_flow_page.dart"]
- S_permanent --> S_permanent_Q["Queries
* role - listRolesByOwnerId"]
- S_permanent --> S_permanent_M["Mutations
* position - createPosition
* order - createOrder"]
-end
-
-subgraph C10["Recurring Order"]
- S_recurring["recurring_order_flow_page.dart"]
- S_recurring --> S_recurring_Q["Queries
* role - listRolesByOwnerId"]
- S_recurring --> S_recurring_M["Mutations
* position - createPosition
* order - createOrder"]
-end
-
-subgraph C11["Billing"]
- S_billing["client_billing_screen.dart"]
- S_billing --> S_billing_Q["Queries
* account - getAccountsByOwnerId
* invoice - getInvoicesByOwnerId
* recentPayment - filterRecentPayments"]
- S_billing --> S_billing_M["Mutations
* account - createAccount
* account - updateAccount
* account - deleteAccount"]
-end
-
-subgraph C12["Coverage"]
- S_coverage["coverage_dashboard.dart"]
- S_coverage --> S_coverage_Q["Queries
* order - getOrdersByOwnerId
* shift - filterShifts
* application - getApplicationsByShiftId"]
-end
-
-subgraph C13["Home"]
- S_client_home["client_home_screen.dart"]
- S_client_home --> S_client_home_Q["Queries
* order - getOrdersByOwnerId
* shift - filterShifts
* application - getApplicationsByShiftId
* recentPayment - filterRecentPayments"]
- S_client_home --> S_client_home_M["Mutations
* order - createOrder"]
-end
diff --git a/docs/backend-diagram/dataconnect-schema.mmd b/docs/backend-diagram/dataconnect-schema.mmd
deleted file mode 100644
index b67267f0..00000000
--- a/docs/backend-diagram/dataconnect-schema.mmd
+++ /dev/null
@@ -1,271 +0,0 @@
-erDiagram
- User {
- String id PK
- String email
- String fullName
- Timestamp createdDate
- }
- Business {
- UUID id PK
- String userId FK
- String businessName
- Timestamp createdAt
- }
- Vendor {
- UUID id PK
- String userId FK
- String companyName
- Timestamp createdAt
- }
- Staff {
- UUID id PK
- String userId FK
- UUID hubId FK
- UUID ownerId FK
- String fullName
- Timestamp createdAt
- }
- Shift {
- UUID id PK
- UUID orderId FK
- UUID ownerId FK
- ShiftStatus status
- Timestamp createdAt
- }
- Order {
- UUID id PK
- UUID ownerId FK
- UUID hubId FK
- OrderStatus status
- Timestamp createdAt
- }
- Position {
- UUID id PK
- UUID orderId FK
- UUID roleId FK
- UUID ownerId FK
- Timestamp createdAt
- }
- Task {
- UUID id PK
- UUID ownerId FK
- TaskStatus status
- Timestamp createdAt
- }
- Team {
- UUID id PK
- String ownerId FK
- String teamName
- Timestamp createdAt
- }
- TeamMember {
- UUID id PK
- UUID teamId FK
- UUID hubId FK
- String memberName
- Timestamp createdAt
- }
- Hub {
- UUID id PK
- UUID ownerId FK
- String name
- Timestamp createdAt
- }
- Account {
- UUID id PK
- UUID ownerId FK "polymorphic ownerId"
- String bank
- Timestamp createdAt
- }
- Document {
- UUID id PK
- UUID staffId FK
- DocumentStatus status
- Timestamp createdAt
- }
- Certificate {
- UUID id PK
- UUID staffId FK
- CertificateStatus status
- Timestamp createdAt
- }
- Contact {
- UUID id PK
- UUID staffId FK
- String name
- Timestamp createdAt
- }
- BenefitsData {
- UUID id PK
- UUID staffId FK
- String title
- Timestamp createdAt
- }
- Course {
- UUID id PK
- String title
- Timestamp createdAt
- }
- TaxForm {
- UUID id PK
- UUID staffId FK
- TaxFormStatus status
- Timestamp createdAt
- }
- TimeSheet {
- UUID id PK
- UUID staffId FK
- UUID shiftId FK
- TimeSheetStatus status
- Timestamp createdAt
- }
- Invoice {
- UUID id PK
- UUID ownerId FK
- InvoiceStatus status
- Timestamp createdAt
- }
- Assignment {
- UUID id PK
- UUID staffId FK
- UUID ownerId FK
- AssignmentStatus status
- Timestamp createdAt
- }
- Conversation {
- UUID id PK
- String subject
- Timestamp createdAt
- }
- Message {
- UUID id PK
- UUID conversationId FK
- String senderId
- Timestamp createdAt
- }
- Role {
- UUID id PK
- UUID ownerId FK
- String name
- Timestamp createdAt
- }
- RecentPayment {
- UUID id PK
- UUID payedUserId FK
- UUID ownerId FK
- RecentPaymentStatus status
- Timestamp createdAt
- }
- RequiredDoc {
- UUID id PK
- UUID ownerId FK
- ReqDocumentStatus status
- Timestamp createdAt
- }
- VendorRate {
- UUID id PK
- UUID vendorId FK
- String roleName
- Timestamp createdAt
- }
- Schedule {
- UUID id PK
- UUID positionId FK
- Timestamp createdAt
- }
- TaskComment {
- UUID id PK
- UUID taskId FK
- String authorName
- Timestamp createdAt
- }
- TeamHub {
- UUID id PK
- UUID teamId FK
- String hubName
- Timestamp createdAt
- }
- Application {
- UUID id PK
- UUID shiftId FK
- UUID staffId FK
- ApplicationStatus status
- Timestamp createdAt
- }
- StaffShift {
- UUID id PK
- UUID staffId FK
- UUID shiftId FK
- Timestamp createdAt
- }
- MemberTask {
- UUID id PK
- UUID teamMemberId FK
- UUID taskId FK
- Timestamp createdAt
- }
- StaffCourse {
- UUID id PK
- UUID staffId FK
- UUID courseId FK
- Timestamp createdAt
- }
-
- User ||--|{ Staff : "has profile"
- User ||--|{ Vendor : "can be"
- User ||--|{ Business : "can be"
- User ||--o{ ActivityLog : "generates"
-
- Business ||--o{ "Order" : "creates"
- Business ||--o{ Invoice : "receives"
- Business ||--o{ Task : "owns"
- Business ||--o{ Hub : "owns"
- Business ||--o{ Role : "defines"
- Business ||--o{ Shift : "posts"
- Business ||--o{ Staff : "employs"
- Business ||--o{ Account : "owns"
-
- Vendor ||--o{ VendorRate : "defines"
- Vendor ||--o{ Task : "owns"
- Vendor ||--o{ Hub : "owns"
- Vendor ||--o{ Role : "defines"
- Vendor ||--o{ Shift : "posts"
- Vendor ||--o{ Staff : "employs"
- Vendor ||--o{ Account : "owns"
-
- Staff ||--o{ Document : "has"
- Staff ||--o{ Certificate : "holds"
- Staff ||--o{ Contact : "has emergency"
- Staff ||--o{ BenefitsData : "accrues"
- Staff ||--o{ TaxForm : "submits"
- Staff ||--o{ TimeSheet : "fills"
- Staff ||--o{ Assignment : "receives"
- Staff ||--o{ Account : "owns"
- Staff ||--o{ RecentPayment : "is paid to"
- Staff ||--o{ RequiredDoc : "owns"
- Staff ||--o{ Application : "submits"
- Hub ||--o{ Staff : "is based at"
-
- Shift ||--o{ TimeSheet : "generates"
- Shift ||--o{ Application : "receives"
-
- "Order" ||--o{ Shift : "contains"
- "Order" ||--o{ Position : "requires"
-
- Task ||--o{ TaskComment : "has"
-
- Team ||--o{ TeamMember : "has"
- Team ||--o{ TeamHub : "operates in"
-
- Conversation ||--o{ Message : "contains"
-
- Position ||--o{ Schedule : "has"
- Role ||--o{ Position : "is for"
-
- %% Join Tables
- Staff ||--|{ StaffShift : "works"
- Shift ||--|{ StaffShift : "is worked by"
- Staff ||--|{ StaffCourse : "enrolls in"
- Course ||--|{ StaffCourse : "is taken by"
- TeamMember ||--|{ MemberTask : "assigned to"
- Task ||--|{ MemberTask : "is assigned to"
diff --git a/docs/backend-diagram/dataconnect-schemas-mutations-queries.mmd b/docs/backend-diagram/dataconnect-schemas-mutations-queries.mmd
deleted file mode 100644
index f241b3a5..00000000
--- a/docs/backend-diagram/dataconnect-schemas-mutations-queries.mmd
+++ /dev/null
@@ -1,124 +0,0 @@
-flowchart LR
- subgraph "Profile & Onboarding"
- User --> User_Q["Queries
- listUsers
- getUserById"]
- User --> User_M["Mutations
- createUser
- updateUser
- deleteUser"]
- Staff --> Staff_Q["Queries
- listStaff
- getStaffById
- getStaffByUserId"]
- Staff --> Staff_M["Mutations
- createStaff
- updateStaff
- deleteStaff"]
- Contact --> Contact_Q["Queries
- listContacts
- getContactById
- listContactsByStaffId"]
- Contact --> Contact_M["Mutations
- createContact
- updateContact
- deleteContact"]
- AttireOption --> AttireOption_Q["Queries
- listAttireOptions
- getAttireOptionById"]
- AttireOption --> AttireOption_M["Mutations
- createAttireOption
- updateAttireOption
- deleteAttireOption"]
- end
-
- subgraph "Compliance"
- Document --> Document_Q["Queries
- listDocuments
- getDocumentById
- listDocumentsByStaffId"]
- Document --> Document_M["Mutations
- createDocument
- updateDocument
- deleteDocument"]
- Certificate --> Certificate_Q["Queries
- listCertificates
- getCertificateById
- listCertificatesByStaffId"]
- Certificate --> Certificate_M["Mutations
- CreateCertificate
- UpdateCertificate
- DeleteCertificate"]
- TaxForm --> TaxForm_Q["Queries
- listTaxForms
- getTaxFormById
- getTaxFormsByStaffId
- filterTaxForms"]
- TaxForm --> TaxForm_M["Mutations
- createTaxForm
- updateTaxForm
- deleteTaxForm"]
- RequiredDoc --> RequiredDoc_Q["Queries
- listRequiredDocs
- getRequiredDocById
- listRequiredDocsByUserId"]
- RequiredDoc --> RequiredDoc_M["Mutations
- createRequiredDoc
- updateRequiredDoc
- deleteRequiredDoc"]
- end
-
- subgraph "Finances"
- Account --> Account_Q["Queries
- listAccounts
- getAccountById
- listAccountsByOwnerId"]
- Account --> Account_M["Mutations
- createAccount
- updateAccount
- deleteAccount"]
- TimeSheet --> TimeSheet_Q["Queries
- listTimeSheets
- getTimeSheetById
- listTimeSheetsByStaffId"]
- TimeSheet --> TimeSheet_M["Mutations
- createTimeSheet
- updateTimeSheet
- deleteTimeSheet"]
- RecentPayment --> RecentPayment_Q["Queries
- listRecentPayments
- getRecentPaymentById
- listRecentPaymentsByUserId"]
- RecentPayment --> RecentPayment_M["Mutations
- createRecentPayment
- updateRecentPayment
- deleteRecentPayment"]
- Invoice --> Invoice_Q["Queries
- listInvoices
- getInvoiceById"]
- Invoice --> Invoice_M["Mutations
- createInvoice
- updateInvoice
- deleteInvoice"]
- InvoiceTemplate --> InvoiceTemplate_Q["Queries
- listInvoiceTemplates
- getInvoiceTemplateById"]
- InvoiceTemplate --> InvoiceTemplate_M["Mutations
- createInvoiceTemplate
- updateInvoiceTemplate
- deleteInvoiceTemplate"]
- VendorRate --> VendorRate_Q["Queries
- listVendorRates
- getVendorRateById"]
- VendorRate --> VendorRate_M["Mutations
- createVendorRate
- updateVendorRate
- deleteVendorRate"]
- CustomRateCard --> CustomRateCard_Q["Queries
- listCustomRateCards
- getCustomRateCardById"]
- CustomRateCard --> CustomRateCard_M["Mutations
- createCustomRateCard
- updateCustomRateCard
- deleteCustomRateCard"]
- end
-
- subgraph "Shifts & Work"
- Shift --> Shift_Q["Queries
- listShifts
- getShiftById
- filterShifts"]
- Shift --> Shift_M["Mutations
- CreateShift
- UpdateShift
- DeleteShift"]
- Application --> Application_Q["Queries
- getApplicationById
- listApplicationsByStaffId"]
- Application --> Application_M["Mutations
- createApplication
- updateApplication
- deleteApplication"]
- StaffShift --> StaffShift_Q["Queries
- getMyShifts
- getStaffShiftById
- getStaffShiftsByShiftId"]
- StaffShift --> StaffShift_M["Mutations
- createStaffShift
- updateStaffShift
- deleteStaffShift"]
- StaffAvailability --> StaffAvailability_Q["Queries
- listStaffAvailabilities
- getStaffAvailabilityById
- getStaffAvailabilityByStaffId"]
- StaffAvailability --> StaffAvailability_M["Mutations
- createStaffAvailability
- updateStaffAvailability
- deleteStaffAvailability"]
- Assignment --> Assignment_Q["Queries
- listAssignments
- getAssignmentById
- listAssignmentsByStaffId"]
- Assignment --> Assignment_M["Mutations
- CreateAssignment
- UpdateAssignment
- DeleteAssignment"]
- Order --> Order_Q["Queries
- listOrders
- getOrderById"]
- Order --> Order_M["Mutations
- createOrder
- updateOrder
- deleteOrder"]
- Position --> Position_Q["Queries
- listPositions
- getPositionById
- listPositionsByOrderId"]
- Position --> Position_M["Mutations
- createPosition
- updatePosition
- deletePosition"]
- Category --> Category_Q["Queries
- listCategories
- getCategoryById"]
- Category --> Category_M["Mutations
- createCategory
- updateCategory
- deleteCategory"]
- Role --> Role_Q["Queries
- listRoles
- getRoleById"]
- Role --> Role_M["Mutations
- createRole
- updateRole
- deleteRole"]
- RoleCategory --> RoleCategory_Q["Queries
- listRoleCategories
- getRoleCategoryById"]
- RoleCategory --> RoleCategory_M["Mutations
- createRoleCategory
- updateRoleCategory
- deleteRoleCategory"]
- Schedule --> Schedule_Q["Queries
- listSchedules
- getScheduleById
- getScheduleByPositionId"]
- Schedule --> Schedule_M["Mutations
- createSchedule
- updateSchedule
- deleteSchedule"]
- Workforce --> Workforce_Q["Queries"]
- Workforce --> Workforce_M["Mutations"]
- end
-
- subgraph "Learning"
- Course --> Course_Q["Queries
- listCourses
- getCourseById
- filterCourses"]
- Course --> Course_M["Mutations
- createCourse
- updateCourse
- deleteCourse"]
- Level --> Level_Q["Queries
- listLevels
- getLevelById"]
- Level --> Level_M["Mutations
- createLevel
- updateLevel
- deleteLevel"]
- StaffCourse --> StaffCourse_Q["Queries
- getStaffCourseById
- listStaffCoursesByStaffId
- listStaffCoursesByCourseId
- getStaffCourseByStaffAndCourse"]
- StaffCourse --> StaffCourse_M["Mutations
- createStaffCourse
- updateStaffCourse
- deleteStaffCourse"]
- end
-
- subgraph "Benefits"
- BenefitsData --> BenefitsData_Q["Queries
- listBenefitsData
- getBenefitsDataById
- getBenefitsDataByStaffId"]
- BenefitsData --> BenefitsData_M["Mutations
- createBenefitsData
- updateBenefitsData
- deleteBenefitsData"]
- end
-
- subgraph "Business & Vendors"
- Business --> Business_Q["Queries
- listBusinesses
- getBusinessById
- getBusinessesByUserId"]
- Business --> Business_M["Mutations
- createBusiness
- updateBusiness
- deleteBusiness"]
- Vendor --> Vendor_Q["Queries
- listVendors
- getVendorById"]
- Vendor --> Vendor_M["Mutations
- createVendor
- updateVendor
- deleteVendor"]
- Hub --> Hub_Q["Queries
- listHubs
- getHubById"]
- Hub --> Hub_M["Mutations
- createHub
- updateHub
- deleteHub"]
- end
-
- subgraph "Teams"
- Team --> Team_Q["Queries
- listTeams
- getTeamById"]
- Team --> Team_M["Mutations
- createTeam
- updateTeam
- deleteTeam"]
- TeamMember --> TeamMember_Q["Queries
- listTeamMembers
- getTeamMemberById
- listTeamMembersByTeamId"]
- TeamMember --> TeamMember_M["Mutations
- createTeamMember
- updateTeamMember
- deleteTeamMember"]
- MemberTask --> MemberTask_Q["Queries
- getMyTasks
- getMemberTaskById
- getMemberTasksByTaskId"]
- MemberTask --> MemberTask_M["Mutations
- createMemberTask
- updateMemberTask
- deleteMemberTask"]
- TeamHub --> TeamHub_Q["Queries
- listTeamHubs
- getTeamHubById
- listTeamHubsByTeamId"]
- TeamHub --> TeamHub_M["Mutations
- createTeamHub
- updateTeamHub
- deleteTeamHub"]
- Task --> Task_Q["Queries
- listTasks
- getTaskById"]
- Task --> Task_M["Mutations
- createTask
- updateTask
- deleteTask"]
- TaskComment --> TaskComment_Q["Queries
- listTaskComments
- getTaskCommentById
- listTaskCommentsByTaskId"]
- TaskComment --> TaskComment_M["Mutations
- createTaskComment
- updateTaskComment
- deleteTaskComment"]
- end
-
- subgraph "Communication"
- Conversation --> Conversation_Q["Queries
- listConversations
- getConversationById
- getConversationsByUserId"]
- Conversation --> Conversation_M["Mutations
- createConversation
- updateConversation
- deleteConversation"]
- Message --> Message_Q["Queries
- listMessages
- getMessageById
- listMessagesByConversationId"]
- Message --> Message_M["Mutations
- createMessage
- updateMessage
- deleteMessage"]
- end
-
- subgraph "Others"
- ActivityLog --> ActivityLog_Q["Queries
- listActivityLogs
- getActivityLogById
- listActivityLogsByUserId"]
- ActivityLog --> ActivityLog_M["Mutations
- createActivityLog
- updateActivityLog
- deleteActivityLog"]
- ClientFeedback --> ClientFeedback_Q["Queries
- listClientFeedbacks
- getClientFeedbackById"]
- ClientFeedback --> ClientFeedback_M["Mutations
- createClientFeedback
- updateClientFeedback
- deleteClientFeedback"]
- FaqData --> FaqData_Q["Queries
- listFaqDatas
- getFaqDataById"]
- FaqData --> FaqData_M["Mutations
- createFaqData
- updateFaqData
- deleteFaqData"]
- end
-
- subgraph "Reporting"
- Reports --> Reports_Q["Queries
- getCoverageReport
- getNoShowReport
- getSpendReport
- getForecastReport
- getPerformanceReport
- getDailyOpsReport"]
- end
diff --git a/backend/dataconnect/docs/client_app_diagram.mmd b/internal/launchpad/assets/diagrams/dataconnect/mobile/client_app_diagram.mmd
similarity index 72%
rename from backend/dataconnect/docs/client_app_diagram.mmd
rename to internal/launchpad/assets/diagrams/dataconnect/mobile/client_app_diagram.mmd
index 38d4868c..d94fc42e 100644
--- a/backend/dataconnect/docs/client_app_diagram.mmd
+++ b/internal/launchpad/assets/diagrams/dataconnect/mobile/client_app_diagram.mmd
@@ -24,13 +24,13 @@ end
subgraph C5["Hubs"]
S_client_hubs["client_hubs_screen.dart"]
- S_client_hubs --> S_client_hubs_Q["Queries
* hub - getHubsByOwnerId"]
- S_client_hubs --> S_client_hubs_M["Mutations
* hub - createHub
* hub - updateHub
* hub - deleteHub"]
+ S_client_hubs --> S_client_hubs_Q["Queries
* TeamHub - listTeamHubsByOwnerId"]
+ S_client_hubs --> S_client_hubs_M["Mutations
* TeamHub - createTeamHub
* TeamHub - updateTeamHub
* TeamHub - deleteTeamHub"]
end
subgraph C6["Orders"]
S_client_shifts["client_shifts_screen.dart"]
- S_client_shifts --> S_client_shifts_Q["Queries
* order - getOrdersByOwnerId"]
+ S_client_shifts --> S_client_shifts_Q["Queries
* order - getOrdersByBusinessId"]
end
subgraph C7["RAPID Order"]
@@ -41,34 +41,34 @@ end
subgraph C8["One-time Order"]
S_one_time["one_time_order_flow_page.dart"]
S_one_time --> S_one_time_Q["Queries
* role - listRolesByOwnerId"]
- S_one_time --> S_one_time_M["Mutations
* position - createPosition
* order - createOrder"]
+ S_one_time --> S_one_time_M["Mutations
* ShiftRole - createShiftRole
* order - createOrder"]
end
subgraph C9["Permanent Placement"]
S_permanent["permanent_order_flow_page.dart"]
S_permanent --> S_permanent_Q["Queries
* role - listRolesByOwnerId"]
- S_permanent --> S_permanent_M["Mutations
* position - createPosition
* order - createOrder"]
+ S_permanent --> S_permanent_M["Mutations
* ShiftRole - createShiftRole
* order - createOrder"]
end
subgraph C10["Recurring Order"]
S_recurring["recurring_order_flow_page.dart"]
S_recurring --> S_recurring_Q["Queries
* role - listRolesByOwnerId"]
- S_recurring --> S_recurring_M["Mutations
* position - createPosition
* order - createOrder"]
+ S_recurring --> S_recurring_M["Mutations
* ShiftRole - createShiftRole
* order - createOrder"]
end
subgraph C11["Billing"]
S_billing["client_billing_screen.dart"]
- S_billing --> S_billing_Q["Queries
* account - getAccountsByOwnerId
* invoice - getInvoicesByOwnerId
* recentPayment - filterRecentPayments"]
+ S_billing --> S_billing_Q["Queries
* account - getAccountsByOwnerId
* invoice - listInvoicesByBusinessId
* recentPayment - listRecentPaymentsByBusinessId"]
S_billing --> S_billing_M["Mutations
* account - createAccount
* account - updateAccount
* account - deleteAccount"]
end
subgraph C12["Coverage"]
S_coverage["coverage_dashboard.dart"]
- S_coverage --> S_coverage_Q["Queries
* order - getOrdersByOwnerId
* shift - filterShifts
* application - getApplicationsByShiftId"]
+ S_coverage --> S_coverage_Q["Queries
* order - getOrdersByBusinessId
* shift - getShiftsByBusinessId
* application - getApplicationsByShiftId"]
end
subgraph C13["Home"]
S_client_home["client_home_screen.dart"]
- S_client_home --> S_client_home_Q["Queries
* order - getOrdersByOwnerId
* shift - filterShifts
* application - getApplicationsByShiftId
* recentPayment - filterRecentPayments"]
+ S_client_home --> S_client_home_Q["Queries
* order - getOrdersByBusinessId
* shift - getShiftsByBusinessId
* application - getApplicationsByShiftId
* recentPayment - listRecentPaymentsByBusinessId"]
S_client_home --> S_client_home_M["Mutations
* order - createOrder"]
end
diff --git a/docs/backend-diagram/staff_app_diagram.mmd b/internal/launchpad/assets/diagrams/dataconnect/mobile/staff_app_diagram.mmd
similarity index 75%
rename from docs/backend-diagram/staff_app_diagram.mmd
rename to internal/launchpad/assets/diagrams/dataconnect/mobile/staff_app_diagram.mmd
index d251a18e..224227d2 100644
--- a/docs/backend-diagram/staff_app_diagram.mmd
+++ b/internal/launchpad/assets/diagrams/dataconnect/mobile/staff_app_diagram.mmd
@@ -20,8 +20,8 @@ end
subgraph L4["Emergency Contact"]
S_emergency["emergency_contact_screen.dart"]
- S_emergency --> S_emergency_Q["Queries
* contact - getContactsByStaffId"]
- S_emergency --> S_emergency_M["Mutations
* contact - updateContact
* contact - createContact
* contact - deleteContact"]
+ S_emergency --> S_emergency_Q["Queries
* emergencyContact - getEmergencyContactsByStaffId"]
+ S_emergency --> S_emergency_M["Mutations
* conemergencyContacttact - updateEmergencyContact
* emergencyContact - createEmergencyContact
* contemergencyContactact - deleteEmergencyContact"]
end
subgraph L5["Experience & skills"]
@@ -32,14 +32,14 @@ end
subgraph L6["Attire"]
S_attire["attire_screen.dart"]
- S_attire --> S_attire_Q["Queries
* attireOption - listAttireOptions
* staff - getStaffByUserId"]
+ S_attire --> S_attire_Q["Queries
* attireOption - filterAttireOptions
* staff - getStaffByUserId"]
S_attire --> S_attire_M["Mutations
* staff - UpdateStaff"]
end
subgraph L7["Documents"]
S_documents["documents_screen.dart"]
- S_documents --> S_documents_Q["Queries
* document - getDocumentsByStaffId"]
- S_documents --> S_documents_M["Mutations
* document - updateDocument"]
+ S_documents --> S_documents_Q["Queries
* document - listDocuments
* staffDocument - listStaffDocumentsByStaffId"]
+ S_documents --> S_documents_M["Mutations
* staffDocument - updateStaffDocument
* staffDocument - createStaffDocument"]
end
subgraph L8["Certificates"]
@@ -77,12 +77,12 @@ end
subgraph L14["Earnings/Payments"]
S_payments["payments_screen.dart"]
- S_payments --> S_payments_Q["Queries
* recentPayment - getRecentPaymentsByPayedUserId"]
+ S_payments --> S_payments_Q["Queries
* recentPayment - listRecentPaymentsByStaffId"]
end
subgraph L15["Timecard"]
S_timecard["time_card_screen.dart"]
- S_timecard --> S_timecard_Q["Queries
* timeSheet - getTimeSheetsByStaffId"]
+ S_timecard --> S_timecard_Q["Queries
* application - getApplicationsByStaffId"]
end
subgraph L16["Clock in"]
@@ -93,25 +93,25 @@ end
subgraph L17["Shifts"]
S_shifts["shifts_screen.dart"]
- S_shifts --> S_shifts_Q["Queries
* application - getApplicationsByStaffId
* shift - filterShifts
* timeSheet - getTimeSheetsByStaffId"]
- S_shifts --> S_shifts_M["Mutations
* application - updateApplicationStatus
* shift - CreateShift
* application - createApplication
* staffShift - createStaffShift"]
+ S_shifts --> S_shifts_Q["Queries
* application - getApplicationsByStaffId
* shiftRole - listShiftRolesByVendorId/listShiftRolesByRoleId
* application - getApplicationsByStaffId"]
+ S_shifts --> S_shifts_M["Mutations
* application - updateApplicationStatus
* application - createApplication"]
end
subgraph L18["My availability"]
S_availability["availability_screen.dart"]
- S_availability --> S_availability_Q["Queries
* staffAvailability - getStaffAvailabilityByStaffId"]
+ S_availability --> S_availability_Q["Queries
* staffAvailability - listStaffAvailabilitiesByStaffId/getStaffAvailabilityByKey"]
S_availability --> S_availability_M["Mutations
* staffAvailability - updateStaffAvailability
* staffAvailability - createStaffAvailability
* staffAvailability - deleteStaffAvailability"]
end
subgraph L19["Your Benefits Overview"]
S_benefits["benefits_screen.dart"]
- S_benefits --> S_benefits_Q["Queries
* benefitsData - getBenefitsDataByStaffId"]
- S_benefits --> S_benefits_M["Mutations
* benefitsData - updateBenefitsData"]
+ S_benefits --> S_benefits_Q["Queries
* benefitsData - listBenefitsDataByStaffId"]
+ S_benefits --> S_benefits_M["Mutations
* benefitsData - updateBenefitsData
* benefitsData - createBenefitsData"]
end
subgraph L20["Home"]
S_home["worker_home_screen.dart"]
- S_home --> S_home_Q["Queries
* application - getApplicationsByStaffId
* shift - filterShifts
* benefitsData - getBenefitsDataByStaffId"]
+ S_home --> S_home_Q["Queries
* application - getApplicationsByStaffId
* shiftRole - listShiftRolesByVendorId/listShiftRolesByRoleId
* benefitsData - getBenefitsDataByStaffId"]
end
subgraph L21["Shift detail"]
diff --git a/internal/launchpad/assets/diagrams/dataconnect/uml/business_uml_diagram.mmd b/internal/launchpad/assets/diagrams/dataconnect/uml/business_uml_diagram.mmd
new file mode 100644
index 00000000..ee725cbb
--- /dev/null
+++ b/internal/launchpad/assets/diagrams/dataconnect/uml/business_uml_diagram.mmd
@@ -0,0 +1,130 @@
+---
+config:
+ theme: mc
+ layout: dagre
+---
+classDiagram
+direction TB
+ class User {
+ id: String
+ email: String
+ }
+
+ class Business {
+ id: UUID
+ userId: String
+ businessName: String
+ status: BusinessStatus
+ }
+
+ class Vendor {
+ id: UUID
+ userId: String
+ companyName: String
+ }
+
+ class Order {
+ id: UUID
+ businessId: UUID
+ vendorId: UUID
+ status: OrderStatus
+ }
+
+ class Shift {
+ id: UUID
+ orderId: UUID
+ status: ShiftStatus
+ }
+
+ class ShiftRole {
+ shiftId: UUID
+ roleId: UUID
+ }
+
+ class Role {
+ id: UUID
+ name: String
+ vendorId: UUID
+ }
+
+ class Application {
+ id: UUID
+ shiftId: UUID
+ staffId: UUID
+ roleId: UUID
+ }
+
+ class Invoice {
+ id: UUID
+ businessId: UUID
+ vendorId: UUID
+ orderId: UUID
+ status: InvoiceStatus
+ }
+
+ class InvoiceTemplate {
+ id: UUID
+ name: String
+ ownerId: UUID
+ businessId: UUID
+ vendorId: UUID
+ }
+
+ class RecentPayment {
+ id: UUID
+ invoiceId: UUID
+ applicationId: UUID
+ staffId: UUID
+ }
+
+ class ClientFeedback {
+ id: UUID
+ businessId: UUID
+ vendorId: UUID
+ rating: Int
+ }
+
+ class Team {
+ id: UUID
+ teamName: String
+ ownerId: String
+ }
+
+ class TeamMember {
+ id: UUID
+ teamId: UUID
+ userId: String
+ role: TeamMemberRole
+ }
+
+ class TeamHub {
+ id: UUID
+ teamId: UUID
+ hubName: String
+ }
+
+ class Staff {
+ id: UUID
+ userId: String
+ }
+
+ note for Staff "business can create a staff too"
+
+ Business "1" -- "*" Order : places
+ Business "1" -- "*" Invoice : receives
+ Business "1" -- "*" ClientFeedback : gives
+ Business "1" --o "1" Team : (ownerId)
+ Business "1" --o "*" InvoiceTemplate : (ownerId)
+ User "1" -- "1" Business : owns
+ Vendor "1" -- "*" Order : fulfills
+ Vendor "1" -- "*" Invoice : issues
+ Order "1" -- "*" Shift : contains
+ Order "1" -- "1" Invoice : billed via
+ Shift "1" -- "*" ShiftRole : requires
+ ShiftRole "1" -- "1" Role
+ ShiftRole "1" -- "*" Application : target for
+ Application "1" -- "1" Staff
+ Application "1" -- "1" RecentPayment
+ Invoice "1" -- "*" RecentPayment : paid through
+ Team "1" -- "*" TeamHub : contains
+ Team "1" -- "*" TeamMember : has
\ No newline at end of file
diff --git a/internal/launchpad/assets/diagrams/dataconnect/uml/staff_uml_diagram.mmd b/internal/launchpad/assets/diagrams/dataconnect/uml/staff_uml_diagram.mmd
new file mode 100644
index 00000000..7b0588c6
--- /dev/null
+++ b/internal/launchpad/assets/diagrams/dataconnect/uml/staff_uml_diagram.mmd
@@ -0,0 +1,181 @@
+classDiagram
+direction TB
+ class User {
+ id: String
+ email: String
+ fullName: String
+ role: UserBaseRole
+ }
+
+ class Staff {
+ id: UUID
+ userId: String
+ fullName: String
+ ownerId: UUID
+ hubId: UUID
+ rollId: UUID
+ status: BackgroundCheckStatus
+ }
+
+ class Account{
+ id: UUID
+ ownerId:UUID
+ type:AccountType
+ }
+
+ class Workforce {
+ id: UUID
+ vendorId: UUID
+ staffId: UUID
+ status: WorkforceStatus
+ }
+
+ class Application {
+ id: UUID
+ shiftId: UUID
+ staffId: UUID
+ roleId: UUID
+ status: ApplicationStatus
+ }
+
+ class Assignment {
+ id: UUID
+ workforceId: UUID
+ shiftId: UUID
+ roleId: UUID
+ status: AssignmentStatus
+ }
+
+ class ShiftRole {
+ id: UUID
+ shiftId: UUID
+ roleId: UUID
+ }
+
+ class Shift {
+ id: UUID
+ orderId: UUID
+ status: ShiftStatus
+ }
+
+ class Order {
+ id: UUID
+ vendorId: UUID
+ businessId: UUID
+ status: OrderStatus
+ }
+
+ class Vendor {
+ id: UUID
+ userId: String
+ companyName: String
+ }
+
+ class Business {
+ id: UUID
+ userId: String
+ businessName: String
+ }
+
+ class Role {
+ id: UUID
+ name: String
+ vendorId: UUID
+ roleCategoryId: UUID
+ }
+
+ class StaffDocument {
+ staffId: UUID
+ documentId: UUID
+ status: DocumentStatus
+ }
+
+ class Document {
+ id: UUID
+ name: String
+ documentType: DocumentType
+ }
+
+ class StaffCourse {
+ staffId: UUID
+ courseId: UUID
+ }
+
+ class Course {
+ id: UUID
+ title: String
+ categoryId: UUID
+ }
+
+ class Category {
+ id: UUID
+ label: String
+ }
+
+ class StaffAvailability {
+ staffId: UUID
+ day: DayOfWeek
+ slot: AvailabilitySlot
+ }
+
+ class Certificate {
+ staffId: UUID
+ certificationType: ComplianceType
+ status: CertificateStatus
+ }
+
+ class BenefitData {
+ staffId: UUID
+ vendorBenefitPlanId: UUID
+ current: int
+ }
+
+ class Contact {
+ staffId: UUID
+ relationship: RelationshipType
+ name: string
+ }
+
+ class Invoice {
+ orderId: UUID
+ }
+
+ class RecentPayment {
+ staffId: UUID
+ applicationId: UUID
+ status: RecentPaymentStatus
+ }
+
+ class TaxForm {
+ staffId: UUID
+ formType: TaxFormType
+ status: TaxFormStatus
+ }
+
+ User "1" -- "1" Staff : has
+ Staff "1" -- "*" Application : applies to
+ Staff "1" -- "*" Workforce : part of
+ Staff "1" -- "*" StaffDocument : has
+ Staff "1" -- "*" Certificate : has
+ Staff "1" -- "*" BenefitData : has
+ Staff "1" -- "*" Contact : has
+ Staff "1" -- "*" TaxForm : has
+ Staff "1" -- "*" Account : has
+ Staff "1" -- "*" StaffCourse : takes
+ Staff "1" -- "*" StaffAvailability : sets
+ Workforce "1" -- "*" Assignment : receives
+ Assignment -- ShiftRole
+ Vendor "1" -- "*" Order : receives
+ Business "1" -- "*" Order : places
+ Order "1" -- "1" Invoice : has
+ Invoice "1" -- "*" RecentPayment : has
+ RecentPayment "1" -- "1" Application : has
+ Staff "1" --o "1" Vendor : (ownerId)
+ Staff "1" --o "1" Business : (ownerId)
+ Application -- ShiftRole
+ ShiftRole "*" -- "1" Shift : belongs to
+ ShiftRole "*" -- "1" Role : defines
+ Shift "*" -- "1" Order : belongs to
+ StaffDocument "1" -- "1" Document : references
+ StaffCourse "1" -- "1" Course : references
+ Course "1" -- "1" Category : belongs to
\ No newline at end of file
diff --git a/internal/launchpad/assets/diagrams/dataconnect/uml/team_uml_diagram.mmd b/internal/launchpad/assets/diagrams/dataconnect/uml/team_uml_diagram.mmd
new file mode 100644
index 00000000..eb1d6eb6
--- /dev/null
+++ b/internal/launchpad/assets/diagrams/dataconnect/uml/team_uml_diagram.mmd
@@ -0,0 +1,79 @@
+---
+config:
+ layout: elk
+ theme: mc
+---
+classDiagram
+ class User {
+ id: String
+ email: String
+ fullName: String
+ }
+
+ class TeamMember {
+ id: UUID
+ teamId: UUID
+ userId: String
+ teamHubId: UUID
+ role: TeamMemberRole
+ inviteStatus: TeamMemberInviteStatus
+ inviteCode: UUID
+ }
+
+ class Team {
+ id: UUID
+ teamName: String
+ ownerId: String
+ }
+
+ class TeamHub {
+ id: UUID
+ teamId: UUID
+ hubName: String
+ }
+
+ class TeamHudDepartment {
+ id: UUID
+ name: String
+ teamHubId: UUID
+ }
+
+ class MemberTask {
+ teamMemberId: UUID
+ taskId: UUID
+ }
+
+ class Task {
+ id: UUID
+ taskName: String
+ status: TaskStatus
+ priority: TaskPriority
+ ownerId: UUID
+ }
+
+ class Vendor {
+ id: UUID
+ companyName: String
+ }
+
+ class Business {
+ id: UUID
+ businessName: String
+ }
+
+ User "1" -- "1" TeamMember : has
+
+ Team "1" -- "*" TeamHub : contains
+ Team "1" --o "1" Vendor : (ownerId)
+ Team "1" --o "1" Business : (ownerId)
+
+ TeamHub "1" -- "*" TeamHudDepartment : has
+ TeamHub "1" -- "*" TeamMember : is assigned to
+
+ TeamMember "*" -- "1" Team
+ TeamMember "1" -- "*" MemberTask : has assigned
+
+ Task "1" -- "*" MemberTask : is assigned to
+ Task --o Vendor : (ownerId)
+ Task --o Business : (ownerId)
+
\ No newline at end of file
diff --git a/internal/launchpad/assets/diagrams/dataconnect/uml/user_uml_diagram.mmd b/internal/launchpad/assets/diagrams/dataconnect/uml/user_uml_diagram.mmd
new file mode 100644
index 00000000..e8da584a
--- /dev/null
+++ b/internal/launchpad/assets/diagrams/dataconnect/uml/user_uml_diagram.mmd
@@ -0,0 +1,71 @@
+
+classDiagram
+direction TB
+ class User {
+ id: String
+ email: String
+ fullName: String
+ role: UserBaseRole
+ }
+
+ class Staff {
+ id: UUID
+ userId: String
+ fullName: String
+ ownerId: UUID
+ hubId: UUID
+ rollId: UUID
+ status: BackgroundCheckStatus
+ }
+
+ class Vendor {
+ id: UUID
+ userId: String
+ companyName: String
+ }
+
+ class Business {
+ id: UUID
+ userId: String
+ businessName: String
+ }
+
+ class TeamMember {
+ id: UUID
+ teamId: UUID
+ userId: String
+ role: TeamMemberRole
+ }
+
+ class ActivityLog {
+ id: UUID
+ userId: String
+ activityType: ActivityType
+ }
+
+ class UserConversation {
+ conversationId: UUID
+ userId: String
+ }
+
+ class Conversation {
+ id: UUID
+ conversationType: ConversationType
+ }
+
+ class Message{
+ id: UUID
+ conversationId: UUID
+ content: String
+ }
+
+ User <|-- Staff
+ User <|-- Business
+ User <|-- Vendor
+ User <|-- TeamMember
+
+
+ User "1" -- "*" ActivityLog : logs
+ User "1" -- "*" UserConversation : participates in
+ UserConversation "*" -- "1" Conversation : is part of
+ Conversation "1" -- "*" Message : has
diff --git a/internal/launchpad/assets/diagrams/dataconnect/uml/vendor_uml_diagram_simplify.mmd b/internal/launchpad/assets/diagrams/dataconnect/uml/vendor_uml_diagram_simplify.mmd
new file mode 100644
index 00000000..7a642427
--- /dev/null
+++ b/internal/launchpad/assets/diagrams/dataconnect/uml/vendor_uml_diagram_simplify.mmd
@@ -0,0 +1,164 @@
+---
+config:
+ layout: dagre
+---
+classDiagram
+direction TB
+ class User {
+ id: String
+ email: String
+ }
+
+ class Vendor {
+ id: UUID
+ userId: String
+ companyName: String
+ tier: VendorTier
+ }
+
+ class Staff {
+ id: UUID
+ userId: String
+ fullName: String
+ }
+
+ class VendorBenefitPlan {
+ id: UUID
+ vendorId: UUID
+ title: String
+ }
+
+ class InvoiceTemplate {
+ id: UUID
+ name: String
+ ownerId: UUID
+ }
+
+ class VendorRate {
+ id: UUID
+ vendorId: UUID
+ roleName: String
+ }
+
+ class AttireOption{
+ id: UUID
+ vendorId: UUID
+ }
+
+ class Team {
+ id: UUID
+ teamName: String
+ ownerId: String
+ }
+
+ class TeamMember {
+ id: UUID
+ teamId: UUID
+ userId: String
+ role: TeamMemberRole
+ }
+
+ class TeamHub {
+ id: UUID
+ teamId: UUID
+ hubName: String
+ }
+
+ class Business {
+ id: UUID
+ userId: String
+ businessName: String
+ }
+
+ class ClientFeedback {
+ id: UUID
+ businessId: UUID
+ vendorId: UUID
+ rating: Int
+ }
+
+ class Order {
+ id: UUID
+ vendorId: UUID
+ businessId: UUID
+ status: OrderStatus
+ }
+
+ class Shift {
+ id: UUID
+ orderId: UUID
+ status: ShiftStatus
+ }
+
+ class Role {
+ id: UUID
+ name: String
+ vendorId: UUID
+ }
+
+ class ShiftRole {
+ shiftId: UUID
+ roleId: UUID
+ }
+
+ class Workforce {
+ id: UUID
+ vendorId: UUID
+ staffId: UUID
+ status: WorkforceStatus
+ }
+
+ class Application {
+ id: UUID
+ shiftId: UUID
+ staffId: UUID
+ roleId: UUID
+ status: ApplicationStatus
+ }
+
+ class Assignment {
+ id: UUID
+ workforceId: UUID
+ shiftId: UUID
+ roleId: UUID
+ status: AssignmentStatus
+ }
+
+ class Invoice {
+ id: UUID
+ vendorId: UUID
+ businessId: UUID
+ orderId: UUID
+ status: InvoiceStatus
+ }
+
+ class RecentPayment {
+ id: UUID
+ staffId: UUID
+ applicationId: UUID
+ invoiceId: UUID
+ status: RecentPaymentStatus
+ }
+
+ note for Vendor "All tables has relationship with vendor"
+
+ User "1" -- "1" Vendor : has
+ Vendor "1" o-- "1" Staff : (ownerId)
+ Vendor "1" -- "*" VendorBenefitPlan : offers
+ Vendor "1" -- "*" AttireOption
+ Vendor o-- InvoiceTemplate : (ownerId)
+ Vendor "1" -- "*" VendorRate : has
+ Vendor "1" -- "*" ClientFeedback : receives
+ Vendor "1" -- "*" Order : receives
+ Business "1" -- "*" Order : places
+ Order "1" -- "*" Shift : contains
+ Shift "1" -- "*" ShiftRole : requires
+ Role "1" -- "*" ShiftRole : fills
+ ShiftRole "1" -- "*" Application : receives
+ Assignment "1" -- "1" ShiftRole
+ Assignment "1" -- "1" Workforce
+ Invoice "1" -- "1" Order
+ Invoice "1" -- "*" RecentPayment : details
+ Vendor "1" o-- "1" Team
+ Team "1" -- "*" TeamHub : contains
+ Team "1" -- "*" TeamMember : has
\ No newline at end of file
diff --git a/internal/launchpad/assets/diagrams/diagrams-config.json b/internal/launchpad/assets/diagrams/diagrams-config.json
index 640cc3ce..61561eaf 100644
--- a/internal/launchpad/assets/diagrams/diagrams-config.json
+++ b/internal/launchpad/assets/diagrams/diagrams-config.json
@@ -118,5 +118,47 @@
"title": "Legacy App Backend Architecture",
"type": "mermaid",
"icon": "bi-diagram-2"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/uml/user_uml_diagram.mmd",
+ "title": "User UML Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-2"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/uml/staff_uml_diagram.mmd",
+ "title": "Staff UML Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-2"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/uml/business_uml_diagram.mmd",
+ "title": "Business UML Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-3"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/uml/vendor_uml_diagram_simplify.mmd",
+ "title": "Vendor UML Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-3"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/uml/team_uml_diagram.mmd",
+ "title": "Team UML Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-2"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/mobile/client_app_diagram.mmd",
+ "title": "Client App Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-2"
+ },
+ {
+ "path": "assets/diagrams/dataconnect/mobile/staff_app_diagram.mmd",
+ "title": "Staff App Diagram Dataconnect",
+ "type": "mermaid",
+ "icon": "bi-diagram-2"
}
]
\ No newline at end of file
diff --git a/internal/launchpad/assets/documents/dataconnect/backend_manual.md b/internal/launchpad/assets/documents/dataconnect/backend_manual.md
new file mode 100644
index 00000000..a256a882
--- /dev/null
+++ b/internal/launchpad/assets/documents/dataconnect/backend_manual.md
@@ -0,0 +1,294 @@
+# Krow Workforce – Backend Manual
+Firebase Data Connect + Cloud SQL (PostgreSQL)
+
+---
+
+## 1. Backend Overview
+
+This project uses Firebase Data Connect with Cloud SQL (PostgreSQL) as the main backend system.
+
+The architecture is based on:
+
+- GraphQL Schemas → Define database tables
+- Connectors (Queries & Mutations) → Data access layer
+- Cloud SQL → Real database
+- Auto-generated SDK → Used by Web & Mobile apps
+- Makefile → Automates backend workflows
+
+The goal is to keep the backend scalable, structured, and aligned with Web and Mobile applications.
+
+---
+
+## 2. Project Structure
+
+```
+dataconnect/
+│
+├── dataconnect.yaml
+├── schema/
+│ ├── Staff.gql
+│ ├── Vendor.gql
+│ ├── Business.gql
+│ └── ...
+│
+├── connector/
+│ ├── staff/
+│ │ ├── queries.gql
+│ │ └── mutations.gql
+│ ├── invoice/
+│ └── ...
+│
+├── connector/connector.yaml
+│
+docs/backend-diagrams/
+│ ├── business_uml_diagram.mmd
+│ ├── staff_uml_diagram.mmd
+│ ├── team_uml_diagram.mmd
+│ ├── user_uml_diagram.mmd
+│ └── vendor_uml_diagram_simplify.mmd
+```
+
+---
+
+## 3. dataconnect.yaml (Main Configuration)
+
+```yaml
+specVersion: "v1"
+serviceId: "krow-workforce-db"
+location: "us-central1"
+
+schema:
+ source: "./schema"
+ datasource:
+ postgresql:
+ database: "krow_db"
+ cloudSql:
+ instanceId: "krow-sql"
+
+connectorDirs: ["./connector"]
+```
+
+### Purpose
+
+| Field | Description |
+|------|------------|
+| serviceId | Data Connect service name |
+| schema.source | Where GraphQL schemas live |
+| datasource | Cloud SQL connection |
+| connectorDirs | Where queries/mutations are |
+
+---
+
+## 4. Database Schemas
+
+All database schemas are located in:
+
+```
+dataconnect/schema/
+```
+
+Each `.gql` file represents a table:
+
+- Staff.gql
+- Invoice.gql
+- ShiftRole.gql
+- Application.gql
+- etc.
+
+Schemas define:
+
+- Fields
+- Enums
+- Relationships (`@ref`)
+- Composite keys (`key: []`)
+
+---
+
+## 5. Queries & Mutations (Connectors)
+
+Located in:
+
+```
+dataconnect/connector//
+```
+
+Example:
+
+```
+dataconnect/connector/staff/queries.gql
+dataconnect/connector/staff/mutations.gql
+```
+
+Each folder represents one entity.
+
+This layer defines:
+
+- listStaff
+- getStaffById
+- createStaff
+- updateStaff
+- deleteStaff
+- etc.
+
+---
+
+## 6. connector.yaml (SDK Generator)
+
+```yaml
+connectorId: example
+generate:
+ dartSdk:
+ - outputDir: ../../mobile/staff/staff_app_mvp/lib/dataconnect_generated
+ package: dataconnect_generated/generated.dart
+ - outputDir: ../../mobile/client/client_app_mvp/lib/dataconnect_generated
+ package: dataconnect_generated/generated.dart
+```
+
+This file generates the SDK for:
+
+- Staff Mobile App
+- Client Mobile App
+
+---
+
+## 7. What is the SDK?
+
+The SDK is generated using:
+
+```bash
+firebase dataconnect:sdk:generate
+```
+
+It allows the apps to:
+
+- Call queries/mutations
+- Use strong typing
+- Avoid manual GraphQL
+- Reduce runtime errors
+
+Example in Flutter:
+
+```dart
+client.listStaff();
+client.createInvoice();
+```
+
+---
+
+## 8. Makefile – Automation Commands
+
+### Main Commands
+
+| Command | Purpose |
+|--------|---------|
+| dataconnect-enable-apis | Enable required APIs |
+| dataconnect-init | Initialize Data Connect |
+| dataconnect-deploy | Deploy schemas |
+| dataconnect-sql-migrate | Apply DB migrations |
+| dataconnect-generate-sdk | Generate SDK |
+| dataconnect-sync | Full backend update |
+| dataconnect-test | Test without breaking |
+| dataconnect-seed | Insert seed data |
+| dataconnect-bootstrap-db | Create Cloud SQL |
+
+---
+
+## 9. Correct Backend Workflow
+
+### Production Flow
+
+```bash
+make dataconnect-sync
+```
+
+Steps:
+
+1. Deploy schema
+2. Run SQL migrations
+3. Generate SDK
+
+---
+
+### Safe Test Flow
+
+```bash
+make dataconnect-test
+```
+
+This runs:
+
+- Deploy dry-run
+- SQL diff
+- Shows errors without changing DB
+
+---
+
+## 10. Seed Data
+
+Current command:
+
+```make
+dataconnect-seed:
+ @firebase dataconnect:execute seeds/seed_min.graphql --project=$(FIREBASE_ALIAS)
+```
+
+Purpose:
+
+- Validate schema
+- Detect missing tables
+- Prevent bad inserts
+
+---
+
+## 11. UML Diagrams
+
+Located in:
+
+```
+docs/backend-diagrams/
+```
+
+Divided by role:
+
+| File | Scope |
+|------|-------|
+| user_uml_diagram.mmd | User |
+| staff_uml_diagram.mmd | Staff |
+| vendor_uml_diagram_simplify.mmd | Vendor |
+| business_uml_diagram.mmd | Business |
+| team_uml_diagram.mmd | Teams |
+
+Used with Mermaid to visualize relationships.
+
+---
+
+## 12. Core Business Workflow
+
+```text
+Order
+ → Shift
+ → ShiftRole
+ → Application
+ → Workforce
+ → Assignment
+ → Invoice
+ → RecentPayment
+```
+
+This represents the full work & payment lifecycle.
+
+---
+
+## 13. Final Notes
+
+This backend is designed to:
+
+- Scale efficiently
+- Maintain data consistency
+- Align Web & Mobile models
+- Support reporting and billing
+- Avoid duplicated data
+
+---
+
+END OF MANUAL
diff --git a/internal/launchpad/assets/documents/dataconnect/schema_dataconnect_guide.md b/internal/launchpad/assets/documents/dataconnect/schema_dataconnect_guide.md
new file mode 100644
index 00000000..df36c7c4
--- /dev/null
+++ b/internal/launchpad/assets/documents/dataconnect/schema_dataconnect_guide.md
@@ -0,0 +1,1354 @@
+# Data Connect Architecture Guide
+
+## 1. Introduction
+This guide provides a comprehensive overview of the Firebase Data Connect architecture for this project. It is intended for developers, architects, and technical stakeholders who need to understand the data models, relationships, and API operations. The document consolidates all major domain diagrams, sequence flows, and the complete API catalog into a single reference.
+
+## 2. Table of Contents
+- [System Overview](#3-system-overview)
+- [Identity Domain](#4-identity-domain)
+- [Operations Domain](#5-operations-domain)
+- [Billing Domain](#6-billing-domain)
+- [Teams Domain](#7-teams-domain)
+- [Messaging Domain](#8-messaging-domain)
+- [Compliance Domain](#9-compliance-domain)
+- [Learning Domain](#10-learning-domain)
+- [Operations Sequence Diagrams](#11-operations-sequence-diagrams)
+- [API Catalog](#12-api-catalog)
+
+---
+
+## 3. System Overview
+
+### Summary
+This section provides a high-level flowchart illustrating the primary workflows and relationships between the system's core entities. It covers the connections between user roles (User, Staff, Vendor, Business), the order fulfillment lifecycle (Order, Shift, Application, Assignment, Invoice), and the communication module (Conversation, Message).
+
+### Full Content
+# System Overview Flowchart
+
+## Description
+This flowchart illustrates the high-level relationships between the main entities in the system. It shows the core workflows for user roles, order processing, and communication.
+
+## Flowchart
+```mermaid
+flowchart LR
+ subgraph "User Roles"
+ U(User) --> S(Staff)
+ U --> V(Vendor)
+ U --> B(Business)
+ end
+
+ subgraph "Order & Fulfillment"
+ B --> O(Order)
+ V --> O(Order)
+ O --> SH(Shift)
+ SH --> APP(Application)
+ S --> APP
+ APP --> AS(Assignment)
+ AS --> I(Invoice)
+ end
+
+ subgraph "Communication"
+ C(Conversation) --> M(Message)
+ UC(UserConversation) --> U
+ UC --> C
+ end
+
+ style S fill:#f9f,stroke:#333,stroke-width:2px
+ style V fill:#ccf,stroke:#333,stroke-width:2px
+ style B fill:#cfc,stroke:#333,stroke-width:2px
+```
+
+---
+
+## 4. Identity Domain
+
+### Summary
+This section details the relationships between the key identity entities. It visualizes how a central `User` record connects to different profiles like `Staff`, `Vendor`, and `Business`. The diagram also clarifies the role-based access structure, showing how `Staff` are linked to `Roles` and `RoleCategories` through the `StaffRole` entity.
+
+### Full Content
+# Identity Domain Flowchart
+
+## Description
+Este diagrama de flujo detalla las relaciones de alto nivel entre las entidades de identidad clave del sistema, como usuarios, personal, proveedores, empresas y sus roles asociados.
+
+## Flowchart
+```mermaid
+flowchart LR
+ U(User) --> S(Staff)
+ U --> V(Vendor)
+ U --> B(Business)
+
+ S --> SR(StaffRole)
+ SR --> R(Role)
+ R --> RC(RoleCategory)
+
+ style U fill:#f9f,stroke:#333,stroke-width:2px
+ style S fill:#ccf,stroke:#333,stroke-width:2px
+ style V fill:#cfc,stroke:#333,stroke-width:2px
+ style B fill:#ffc,stroke:#333,stroke-width:2px
+```
+
+---
+
+## 5. Operations Domain
+
+### Summary
+This section illustrates the complete lifecycle of an order, from creation to final invoicing. The flowchart shows the progression from an `Order` to a `Shift`, which then requires specific `ShiftRoles`. Staff `Users` can submit an `Application` for these roles, leading to the creation of a `WorkForce` record and a final `Assignment`, which ultimately results in an `Invoice`.
+
+### Full Content
+# Operations Domain Flowchart
+
+## Description
+This flowchart explains the lifecycle of an order, from its creation and staffing to the final invoice generation.
+
+## Flowchart
+```mermaid
+flowchart TD
+ O(Order) --> S(Shift)
+ S --> SR(ShiftRole)
+ SR --> A(Application)
+ U(User) --> A
+ A --> W(WorkForce)
+ W --> AS(Assignment)
+ AS --> I(Invoice)
+
+ style O fill:#f9f,stroke:#333,stroke-width:2px
+ style S fill:#ccf,stroke:#333,stroke-width:2px
+ style A fill:#cfc,stroke:#333,stroke-width:2px
+ style AS fill:#ffc,stroke:#333,stroke-width:2px
+ style I fill:#f99,stroke:#333,stroke-width:2px
+```
+
+---
+
+## 6. Billing Domain
+
+### Summary
+This section provides a data-first view of the billing process, based strictly on evidence from the GraphQL schema. It explains how an `Invoice` is generated from an `Order` and linked to a `Business` and `Vendor`. It also clarifies how financial transactions are tracked via the `RecentPayment` entity, which connects directly to an `Invoice` and `Application`.
+
+### Full Content
+# Billing Domain Flowchart
+
+## Description
+Based on the repository's schema, the billing process centers around the `Invoice` entity. An `Invoice` is generated in the context of an `Order` and is explicitly linked to both a `Business` (the client) and a `Vendor` (the provider). Each invoice captures essential details from these parent entities. Financial transactions are tracked through the `RecentPayment` entity, which is directly tied to a specific `Invoice`, creating a clear record of payments made against that invoice.
+
+## Verified Relationships (evidence)
+- `Invoice.vendorId` -> `Vendor.id` (source: `dataconnect/schema/invoice.gql`)
+- `Invoice.businessId` -> `Business.id` (source: `dataconnect/schema/invoice.gql`)
+- `Invoice.orderId` -> `Order.id` (source: `dataconnect/schema/invoice.gql`)
+- `RecentPayment.invoiceId` -> `Invoice.id` (source: `dataconnect/schema/recentPayment.gql`)
+- `RecentPayment.applicationId` -> `Application.id` (source: `dataconnect/schema/recentPayment.gql`)
+
+## Flowchart
+```mermaid
+flowchart TD
+ O(Order) --> I(Invoice)
+ B(Business) --> I
+ V(Vendor) --> I
+ I --> RP(RecentPayment)
+ A(Application) --> RP
+```
+
+---
+
+## 7. Teams Domain
+
+### Summary
+This section outlines the structure of the Teams domain, showing how users are organized and managed. It details the relationships between `Team`, `TeamMember`, and `User`, and the hierarchical structure involving `TeamHub` and `TeamHudDepartment`. The documentation also clarifies how task management (`Task`, `MemberTask`, `TaskComment`) is integrated into the team structure.
+
+### Full Content
+# Teams Domain Flowchart
+
+## Description
+The Teams domain in this repository organizes users and their associated tasks. The `Team` is the central entity, with a `User` joining via the `TeamMember` join table, which defines their role. Teams can be structured using `TeamHub` (locations) and `TeamHudDepartment` (departments). The domain also includes task management. A `Task` can be assigned to a `TeamMember` through the `MemberTask` entity. Communication on tasks is handled by `TaskComment`, which is linked directly to the `TeamMember` who made the comment, providing a clear link between team structure and actionable work.
+
+## Entities in Scope
+- Team
+- TeamMember
+- User
+- TeamHub
+- TeamHudDepartment
+- Task
+- MemberTask
+- TaskComment
+
+## Verified Relationships (evidence)
+- `TeamMember.teamId` -> `Team.id` (source: `dataconnect/schema/teamMember.gql`)
+- `TeamMember.userId` -> `User.id` (source: `dataconnect/schema/teamMember.gql`)
+- `TeamMember.teamHubId` -> `TeamHub.id` (source: `dataconnect/schema/teamMember.gql`)
+- `TeamHub.teamId` -> `Team.id` (source: `dataconnect/schema/teamHub.gql`, implicit via field name)
+- `TeamHudDepartment.teamHubId` -> `TeamHub.id` (source: `dataconnect/schema/teamHudDeparment.gql`)
+- `MemberTask.teamMemberId` -> `TeamMember.id` (source: `dataconnect/schema/memberTask.gql`)
+- `MemberTask.taskId` -> `Task.id` (source: `dataconnect/schema/memberTask.gql`)
+- `TaskComment.teamMemberId` -> `TeamMember.id` (source: `dataconnect/schema/task_comment.gql`)
+- Not found: `Team.ownerId` is a generic `String` and does not have a `@ref` to `Vendor` or `Business`.
+- Not found: `TaskComment.taskId` exists but has no `@ref` to `Task.id`.
+
+## Flowchart
+```mermaid
+flowchart TD
+ T(Team)
+ U(User)
+ TK(Task)
+
+ T --> TM(TeamMember)
+ U --> TM
+ T --> TH(TeamHub)
+ TH --> THD(TeamHudDepartment)
+
+ TM --> MT(MemberTask)
+ TK --> MT
+
+ TM --> TC(TaskComment)
+```
+
+---
+
+## 8. Messaging Domain
+
+### Summary
+This section explains the architecture of the messaging system, which is built around three core entities. It describes how `Conversation` holds metadata, `Message` contains the actual content linked to a sender `User`, and `UserConversation` tracks the state (e.g., unread counts) for each participant in a conversation. The documentation includes both verified and inferred schema relationships.
+
+### Full Content
+# Messaging Domain Flowchart
+
+## Description
+The messaging system is designed around three core entities. The `Conversation` entity acts as the central container, holding metadata about a specific chat, such as its subject and type (e.g., group chat, client-vendor). The actual content of the conversation is stored in the `Message` entity, where each message is linked to its parent `Conversation` and the `User` who sent it. To track the state for each participant, the `UserConversation` entity links a `User` to a `Conversation` and stores per-user data, such as the number of unread messages and when they last read the chat.
+
+## Entities in Scope
+- Conversation
+- Message
+- UserConversation
+- User
+
+## Verified Relationships (evidence)
+- `Message.senderId` -> `User.id` (source: `dataconnect/schema/message.gql`)
+- `UserConversation.conversationId` -> `Conversation.id` (source: `dataconnect/schema/userConversation.gql`)
+- `UserConversation.userId` -> `User.id` (source: `dataconnect/schema/userConversation.gql`)
+
+## Inferred Relationships (if any)
+- `Message.conversationId` -> `Conversation.id` (source: `dataconnect/schema/message.gql`, inferred from field name)
+
+## Flowchart
+```mermaid
+flowchart TB
+ subgraph "Conversation Metadata"
+ C(Conversation)
+ end
+
+ subgraph "Message Content & User State"
+ M(Message)
+ UC(UserConversation)
+ U(User)
+ end
+
+ C -- Inferred --- M
+ C -- Verified --- UC
+
+ U -- Verified --- UC
+ U -- Verified --- M
+```
+
+---
+
+## 9. Compliance Domain
+
+### Summary
+This section details the compliance and documentation management system for staff members. It explains how `Document` defines required document types, while `StaffDocument` tracks the submissions from `Staff`. The flowchart also illustrates how other compliance-related entities like `RequiredDoc`, `TaxForm`, and `Certificate` are linked directly to a staff member.
+
+### Full Content
+# Compliance Domain Flowchart
+
+## Description
+The compliance domain manages the necessary documentation and certifications for staff members. The system defines a list of document types via the `Document` entity. Staff members submit their compliance files through `StaffDocument`, which links a specific staff member to a generic document definition. Additionally, `RequiredDoc`, `TaxForm`, and `Certificate` entities are used to track other specific compliance items, such as mandatory documents, tax forms (like W-4s), and professional certificates, all of which are linked back to a particular staff member.
+
+## Entities in Scope
+- Document
+- StaffDocument
+- RequiredDoc
+- TaxForm
+- Certificate
+- Staff
+
+## Verified Relationships (evidence)
+- `StaffDocument.documentId` -> `Document.id` (source: `dataconnect/schema/staffDocument.gql`)
+- `Certificate.staffId` -> `Staff.id` (source: `dataconnect/schema/certificate.gql`)
+
+## Inferred Relationships (if any)
+- `StaffDocument.staffId` -> `Staff.id` (source: `dataconnect/schema/staffDocument.gql`, inferred from field name)
+- `RequiredDoc.staffId` -> `Staff.id` (source: `dataconnect/schema/requiredDoc.gql`, inferred from field name)
+- `TaxForm.staffId` -> `Staff.id` (source: `dataconnect/schema/taxForm.gql`, inferred from field name)
+
+## Flowchart
+```mermaid
+flowchart TB
+ subgraph "Compliance Requirements"
+ D(Document)
+ end
+
+ subgraph "Staff Submissions & Documents"
+ S(Staff)
+ SD(StaffDocument)
+ RD(RequiredDoc)
+ TF(TaxForm)
+ C(Certificate)
+ end
+
+ D -- Verified --> SD
+
+ S -- Inferred --> SD
+ S -- Inferred --> RD
+ S -- Inferred --> TF
+ S -- Verified --> C
+```
+
+---
+
+## 10. Learning Domain
+
+### Summary
+This section describes the learning and training module for staff. It explains how `Course` represents a training module belonging to a `Category`. The `StaffCourse` entity is used to track the enrollment and progress of a `Staff` member. The documentation also notes that while a `Level` entity exists, it is not directly linked to courses in the current schema.
+
+### Full Content
+# Learning Domain Flowchart
+
+## Description
+The learning domain provides a structured training system for staff. The core component is the `Course`, which represents an individual training module with a title, description, and associated `Category`. While the `Level` entity exists to define progression tiers (e.g., based on experience points), it is not directly linked to courses in the current schema. The `StaffCourse` entity tracks the progress of a staff member in a specific course, recording their completion status and timestamps. Certificates are not explicitly linked to course completion in the schema.
+
+## Entities in Scope
+- Course
+- Category
+- Level
+- StaffCourse
+- Staff
+
+## Verified Relationships (evidence)
+- `Course.categoryId` -> `Category.id` (source: `dataconnect/schema/course.gql`)
+
+## Inferred Relationships (if any)
+- `StaffCourse.staffId` -> `Staff.id` (source: `dataconnect/schema/staffCourse.gql`, inferred from field name)
+- `StaffCourse.courseId` -> `Course.id` (source: `dataconnect/schema/staffCourse.gql`, inferred from field name)
+
+## Flowchart
+```mermaid
+flowchart TB
+ subgraph "Training Structure"
+ C(Course)
+ CAT(Category)
+ L(Level)
+ end
+
+ subgraph "Staff Participation"
+ S(Staff)
+ SC(StaffCourse)
+ end
+
+ CAT -- Verified --> C
+
+ S -- Inferred --> SC
+ C -- Inferred --> SC
+```
+
+---
+
+## 11. Operations Sequence Diagrams
+
+### Summary
+This section provides a sequence diagram that illustrates the step-by-step operational flow from order creation to invoicing. Based on an analysis of the connector mutations, it shows the sequence of events: a `User` creates an `Order`, then a `Shift`, followed by an `Application` and `Assignment`. Finally, an `Invoice` is generated from the original `Order`.
+
+### Full Content
+# Operations Sequence Diagrams
+
+## Flow 1: Order to Invoice
+
+### Description
+Based on the repository's connector operations, the operational flow begins when a user creates an `Order`. From this order, one or more `Shifts` are generated. A `Staff` member can then apply to a specific `Shift`, creating an `Application`. Subsequently, an `Assignment` is created, linking a `Workforce` member to that `Shift`. While this represents the staffing and fulfillment part of the process, the billing cycle is handled separately. An `Invoice` is generated directly from the parent `Order`, rather than from the individual assignments, consolidating all billing at the order level.
+
+### Verified Steps (Evidence)
+- `createOrder` (source: `dataconnect/connector/order/mutations.gql`)
+- `createShift` (source: `dataconnect/connector/shift/mutations.gql`)
+- `createApplication` (source: `dataconnect/connector/application/mutations.gql`)
+- `CreateAssignment` (source: `dataconnect/connector/assignment/mutations.gql`)
+- `createInvoice` (source: `dataconnect/connector/invoice/mutations.gql`)
+
+### Sequence Diagram
+```mermaid
+sequenceDiagram
+ participant User
+ participant Order
+ participant Shift
+ participant Application
+ participant Assignment
+ participant Invoice
+
+ User->>Order: createOrder()
+ activate Order
+ Order-->>User: new Order
+ deactivate Order
+
+ User->>Shift: createShift(orderId)
+ activate Shift
+ Shift-->>User: new Shift
+ deactivate Shift
+
+ User->>Application: createApplication(shiftId)
+ activate Application
+ Application-->>User: new Application
+ deactivate Application
+
+ User->>Assignment: CreateAssignment(shiftId, workforceId)
+ activate Assignment
+ Assignment-->>User: new Assignment
+ deactivate Assignment
+
+ User->>Invoice: createInvoice(orderId)
+ activate Invoice
+ Invoice-->>User: new Invoice
+ deactivate Invoice
+```
+
+---
+
+## 12. API Catalog
+
+### Summary
+This section provides a complete and exhaustive catalog of every GraphQL query and mutation available in the Data Connect API. Generated by inspecting all 48 connector folders, it lists every operation without summarization. The catalog is organized by entity and serves as a definitive reference for all available API endpoints, their purposes, and their parameters.
+
+### Full Content
+# API Catalog – Data Connect
+
+## Overview
+This document serves as a complete catalog of the available GraphQL queries and mutations for the Firebase Data Connect backend. It is generated automatically by inspecting the `queries.gql` and `mutations.gql` files within each entity's connector directory. This catalog is exhaustive and lists every operation found. Use this guide to understand the available operations, their parameters, and what they affect.
+
+---
+## Account
+*Manages bank accounts for owners (vendors/businesses).*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listAccounts` | Retrieves a list of all accounts. | - | `[Account]` |
+| `getAccountById` | Fetches a single account by its unique ID. | `id: UUID!` | `Account` |
+| `getAccountsByOwnerId` | Finds all accounts belonging to a specific owner. | `ownerId: UUID!` | `[Account]` |
+| `filterAccounts` | Searches for accounts based on bank, type, primary status, or owner. | `bank`, `type`, `isPrimary`, `ownerId` | `[Account]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createAccount` | Adds a new bank account. | `bank`, `type`, `last4`, `isPrimary`, `ownerId` | `Account` |
+| `updateAccount` | Modifies an existing bank account. | `id`, `bank`, `type`, `last4`, `isPrimary` | `Account` |
+| `deleteAccount` | Removes a bank account. | `id: UUID!` | `Account` |
+
+---
+## ActivityLog
+*Tracks user activities and notifications.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listActivityLogs` | Retrieves all activity logs. | `offset`, `limit` | `[ActivityLog]` |
+| `getActivityLogById`| Fetches a single log by its ID. | `id: UUID!` | `ActivityLog` |
+| `listActivityLogsByUserId`| Lists all logs for a specific user. | `userId`, `offset`, `limit` | `[ActivityLog]` |
+| `listUnreadActivityLogsByUserId`| Lists unread logs for a user. | `userId`, `offset`, `limit` | `[ActivityLog]` |
+| `filterActivityLogs`| Searches logs by user, date range, read status, and type. | `userId`, `dateFrom`, `dateTo`, `isRead`, `activityType`, ... | `[ActivityLog]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createActivityLog` | Creates a new activity log entry. | `userId`, `date`, `title`, `description`, `activityType`, ... | `ActivityLog` |
+| `updateActivityLog` | Modifies an existing activity log. | `id`, `title`, `description`, `isRead`, ... | `ActivityLog` |
+| `markActivityLogAsRead`| Marks a single log as read. | `id: UUID!` | `ActivityLog` |
+| `markActivityLogsAsRead`| Marks multiple logs as read. | `ids: [UUID!]!` | `[ActivityLog]` |
+| `deleteActivityLog` | Removes an activity log. | `id: UUID!` | `ActivityLog` |
+
+---
+## Application
+*Manages staff applications for shifts.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listApplications` | Retrieves all applications. | - | `[Application]` |
+| `getApplicationById`| Fetches a single application by its ID. | `id: UUID!` | `Application` |
+| `getApplicationsByShiftId`| Finds all applications for a specific shift. | `shiftId: UUID!` | `[Application]` |
+| `getApplicationsByShiftIdAndStatus`| Filters applications for a shift by status. | `shiftId`, `status`, `offset`, `limit` | `[Application]` |
+| `getApplicationsByStaffId`| Finds all applications submitted by a staff member. | `staffId`, `offset`, `limit` | `[Application]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createApplication` | Creates a new application for a shift. | `shiftId`, `staffId`, `status`, `origin`, `roleId`, ... | `Application` |
+| `updateApplicationStatus`| Updates the status of an application. | `id`, `status`, ... | `Application` |
+| `deleteApplication` | Deletes an application. | `id: UUID!` | `Application` |
+
+---
+## Assignment
+*Manages staff assignments to shifts.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listAssignments` | Retrieves all assignments. | `offset`, `limit` | `[Assignment]` |
+| `getAssignmentById` | Fetches a single assignment by ID. | `id: UUID!` | `Assignment` |
+| `listAssignmentsByWorkforceId` | Lists assignments for a specific workforce member. | `workforceId`, `offset`, `limit` | `[Assignment]` |
+| `listAssignmentsByWorkforceIds` | Lists assignments for a set of workforce members. | `workforceIds`, `offset`, `limit` | `[Assignment]` |
+| `listAssignmentsByShiftRole` | Lists assignments for a specific role within a shift. | `shiftId`, `roleId`, `offset`, `limit` | `[Assignment]` |
+| `filterAssignments` | Filters assignments by status and shift/role IDs. | `shiftIds`, `roleIds`, `status`, `offset`, `limit` | `[Assignment]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `CreateAssignment` | Creates a new assignment. | `workforceId`, `shiftId`, `roleId`, `title`, ... | `Assignment` |
+| `UpdateAssignment` | Modifies an existing assignment. | `id`, `status`, `title`, ... | `Assignment` |
+| `DeleteAssignment` | Removes an assignment. | `id: UUID!` | `Assignment` |
+
+---
+## AttireOption
+*Manages attire options for vendors.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listAttireOptions` | Retrieves all attire options. | - | `[AttireOption]` |
+| `getAttireOptionById`| Fetches a single attire option by ID. | `id: UUID!` | `AttireOption` |
+| `filterAttireOptions`| Searches options by item ID, mandatory status, or vendor. | `itemId`, `isMandatory`, `vendorId` | `[AttireOption]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createAttireOption` | Adds a new attire option. | `itemId`, `label`, `isMandatory`, `vendorId`, ... | `AttireOption` |
+| `updateAttireOption` | Modifies an existing attire option. | `id`, `label`, `isMandatory`, ... | `AttireOption` |
+| `deleteAttireOption` | Removes an attire option. | `id: UUID!` | `AttireOption` |
+
+---
+## BenefitsData
+*Tracks staff enrollment in vendor benefit plans.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listBenefitsData` | Retrieves all benefits data records. | `offset`, `limit` | `[BenefitsData]` |
+| `getBenefitsDataByKey`| Fetches a record by staff and plan ID. | `staffId`, `vendorBenefitPlanId` | `BenefitsData` |
+| `listBenefitsDataByStaffId`| Lists all benefit records for a staff member. | `staffId`, `offset`, `limit` | `[BenefitsData]` |
+| `listBenefitsDataByVendorBenefitPlanId`| Lists all staff enrolled in a specific benefit plan. | `vendorBenefitPlanId`, `offset`, `limit` | `[BenefitsData]` |
+| `listBenefitsDataByVendorBenefitPlanIds`| Lists records for a set of benefit plans. | `vendorBenefitPlanIds`, `offset`, `limit` | `[BenefitsData]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createBenefitsData` | Creates a new staff benefit enrollment record. | `vendorBenefitPlanId`, `staffId`, `current` | `BenefitsData` |
+| `updateBenefitsData` | Updates a staff benefit enrollment record. | `staffId`, `vendorBenefitPlanId`, `current` | `BenefitsData` |
+| `deleteBenefitsData` | Deletes a staff benefit enrollment record. | `staffId`, `vendorBenefitPlanId` | `BenefitsData` |
+
+---
+## Business
+*Manages client/business entities.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listBusinesses` | Retrieves all businesses. | - | `[Business]` |
+| `getBusinessesByUserId`| Fetches businesses associated with a user. | `userId: String!` | `[Business]` |
+| `getBusinessById` | Fetches a single business by its ID. | `id: UUID!` | `Business` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createBusiness` | Creates a new business profile. | `businessName`, `userId`, `rateGroup`, `status`, ... | `Business` |
+| `updateBusiness` | Modifies an existing business profile. | `id`, `businessName`, `status`, ... | `Business` |
+| `deleteBusiness` | Deletes a business profile. | `id: UUID!` | `Business` |
+
+---
+## Category
+*Manages categories for courses, roles, etc.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listCategories` | Retrieves all categories. | - | `[Category]` |
+| `getCategoryById` | Fetches a single category by ID. | `id: UUID!` | `Category` |
+| `filterCategories` | Searches categories by a custom `categoryId` string or label. | `categoryId`, `label` | `[Category]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createCategory` | Adds a new category. | `categoryId`, `label`, `icon` | `Category` |
+| `updateCategory` | Modifies an existing category. | `id`, `label`, `icon`, ... | `Category` |
+| `deleteCategory` | Removes a category. | `id: UUID!` | `Category` |
+
+---
+## Certificate
+*Manages staff certifications.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listCertificates` | Retrieves all certificates. | - | `[Certificate]` |
+| `getCertificateById`| Fetches a single certificate by ID. | `id: UUID!` | `Certificate` |
+| `listCertificatesByStaffId`| Lists all certificates for a specific staff member. | `staffId: UUID!` | `[Certificate]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `CreateCertificate` | Adds a new certificate for a staff member. | `name`, `status`, `staffId`, ... | `Certificate` |
+| `UpdateCertificate` | Modifies an existing certificate. | `id`, `name`, `status`, `expiry`, ... | `Certificate` |
+| `DeleteCertificate` | Removes a certificate. | `id: UUID!` | `Certificate` |
+
+---
+## ClientFeedback
+*Manages feedback from businesses about vendors.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listClientFeedbacks` | Retrieves all feedback records. | `offset`, `limit` | `[ClientFeedback]` |
+| `getClientFeedbackById`| Fetches a single feedback record by ID. | `id: UUID!` | `ClientFeedback` |
+| `listClientFeedbacksByBusinessId`| Lists all feedback submitted by a business. | `businessId`, `offset`, `limit` | `[ClientFeedback]` |
+| `listClientFeedbacksByVendorId`| Lists all feedback received by a vendor. | `vendorId`, `offset`, `limit` | `[ClientFeedback]` |
+| `listClientFeedbacksByBusinessAndVendor`| Lists feedback between a specific business-vendor pair. | `businessId`, `vendorId`, ... | `[ClientFeedback]` |
+| `filterClientFeedbacks`| Searches feedback by rating and date range. | `ratingMin`, `ratingMax`, `dateFrom`, `dateTo`, ... | `[ClientFeedback]` |
+| `listClientFeedbackRatingsByVendorId`| Retrieves all ratings for a vendor to calculate averages. | `vendorId`, `dateFrom`, `dateTo` | `[ClientFeedback]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createClientFeedback`| Submits new feedback. | `businessId`, `vendorId`, `rating`, `comment`, ... | `ClientFeedback` |
+| `updateClientFeedback`| Modifies existing feedback. | `id`, `rating`, `comment`, ... | `ClientFeedback` |
+| `deleteClientFeedback`| Removes feedback. | `id: UUID!` | `ClientFeedback` |
+
+---
+## Contact
+*Manages staff emergency contacts.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listEmergencyContacts`| Retrieves all emergency contacts. | - | `[EmergencyContact]` |
+| `getEmergencyContactById`| Fetches a single contact by ID. | `id: UUID!` | `EmergencyContact` |
+| `getEmergencyContactsByStaffId`| Lists all emergency contacts for a staff member. | `staffId: UUID!` | `[EmergencyContact]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createEmergencyContact`| Adds a new emergency contact. | `name`, `phone`, `relationship`, `staffId` | `EmergencyContact` |
+| `updateEmergencyContact`| Modifies an existing emergency contact. | `id`, `name`, `phone`, `relationship` | `EmergencyContact` |
+| `deleteEmergencyContact`| Removes an emergency contact. | `id: UUID!` | `EmergencyContact` |
+
+---
+## Conversation
+*Manages conversation metadata.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listConversations` | Retrieves all conversations. | `offset`, `limit` | `[Conversation]` |
+| `getConversationById`| Fetches a single conversation by ID. | `id: UUID!` | `Conversation` |
+| `listConversationsByType`| Lists conversations of a specific type. | `conversationType`, `offset`, `limit` | `[Conversation]` |
+| `listConversationsByStatus`| Lists conversations with a specific status. | `status`, `offset`, `limit` | `[Conversation]` |
+| `filterConversations`| Searches conversations by status, type, and date range. | `status`, `conversationType`, `isGroup`, ... | `[Conversation]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createConversation` | Creates a new conversation thread. | `subject`, `status`, `conversationType`, ... | `Conversation` |
+| `updateConversation` | Modifies an existing conversation. | `id`, `subject`, `status`, ... | `Conversation` |
+| `updateConversationLastMessage`| Updates the last message preview for a conversation. | `id`, `lastMessage`, `lastMessageAt` | `Conversation` |
+| `deleteConversation` | Removes a conversation. | `id: UUID!` | `Conversation` |
+
+---
+## Course
+*Manages training courses.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listCourses` | Retrieves all courses. | - | `[Course]` |
+| `getCourseById` | Fetches a single course by ID. | `id: UUID!` | `Course` |
+| `filterCourses` | Searches courses by category, certification status, or level. | `categoryId`, `isCertification`, `levelRequired`, ... | `[Course]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createCourse` | Adds a new course. | `title`, `categoryId`, `xpReward`, ... | `Course` |
+| `updateCourse` | Modifies an existing course. | `id`, `title`, `description`, ... | `Course` |
+| `deleteCourse` | Removes a course. | `id: UUID!` | `Course` |
+
+---
+## CustomRateCard
+*Manages custom rate cards.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listCustomRateCards`| Retrieves all custom rate cards. | - | `[CustomRateCard]` |
+| `getCustomRateCardById`| Fetches a single rate card by ID. | `id: UUID!` | `CustomRateCard` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createCustomRateCard`| Adds a new rate card. | `name`, `baseBook`, `discount`, `isDefault` | `CustomRateCard` |
+| `updateCustomRateCard`| Modifies an existing rate card. | `id`, `name`, `discount`, ... | `CustomRateCard` |
+| `deleteCustomRateCard`| Removes a rate card. | `id: UUID!` | `CustomRateCard` |
+
+---
+## Document
+*Manages document types and definitions.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listDocuments` | Retrieves all document definitions. | - | `[Document]` |
+| `getDocumentById` | Fetches a single document definition by ID. | `id: UUID!` | `Document` |
+| `filterDocuments` | Searches document definitions by type. | `documentType` | `[Document]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createDocument` | Adds a new document definition. | `documentType`, `name`, `description` | `Document` |
+| `updateDocument` | Modifies an existing document definition. | `id`, `name`, `description`, ... | `Document` |
+| `deleteDocument` | Removes a document definition. | `id: UUID!` | `Document` |
+
+---
+## FaqData
+*Manages Frequently Asked Questions.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listFaqDatas` | Retrieves all FAQ data. | - | `[FaqData]` |
+| `getFaqDataById` | Fetches a single FAQ data set by ID. | `id: UUID!` | `FaqData` |
+| `filterFaqDatas`| Searches FAQ data by category. | `category` | `[FaqData]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createFaqData` | Adds new FAQ data. | `category`, `questions` | `FaqData` |
+| `updateFaqData` | Modifies existing FAQ data. | `id`, `category`, `questions` | `FaqData` |
+| `deleteFaqData` | Removes FAQ data. | `id: UUID!` | `FaqData` |
+
+---
+## Hub
+*Manages physical locations or hubs.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listHubs` | Retrieves all hubs. | - | `[Hub]` |
+| `getHubById` | Fetches a single hub by ID. | `id: UUID!` | `Hub` |
+| `getHubsByOwnerId` | Lists all hubs for a specific owner. | `ownerId: UUID!` | `[Hub]` |
+| `filterHubs` | Searches hubs by owner, name, or NFC tag ID. | `ownerId`, `name`, `nfcTagId` | `[Hub]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createHub` | Adds a new hub. | `name`, `ownerId`, `address`, ... | `Hub` |
+| `updateHub` | Modifies an existing hub. | `id`, `name`, `address`, ... | `Hub` |
+| `deleteHub` | Removes a hub. | `id: UUID!` | `Hub` |
+
+---
+## Invoice
+*Manages billing and invoices.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listInvoices` | Retrieves all invoices. | `offset`, `limit` | `[Invoice]` |
+| `getInvoiceById` | Fetches a single invoice by ID. | `id: UUID!` | `Invoice` |
+| `listInvoicesByVendorId`| Lists invoices for a vendor. | `vendorId`, `offset`, `limit` | `[Invoice]` |
+| `listInvoicesByBusinessId`| Lists invoices for a business. | `businessId`, `offset`, `limit` | `[Invoice]` |
+| `listInvoicesByOrderId`| Lists invoices for an order. | `orderId`, `offset`, `limit` | `[Invoice]` |
+| `listInvoicesByStatus`| Lists invoices by status. | `status`, `offset`, `limit` | `[Invoice]` |
+| `filterInvoices` | Searches invoices by various criteria and date ranges. | `vendorId`, `businessId`, `status`, `issueDateFrom`, ... | `[Invoice]` |
+| `listOverdueInvoices`| Retrieves all overdue, unpaid invoices. | `now: Timestamp!`, `offset`, `limit` | `[Invoice]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createInvoice` | Creates a new invoice. | `status`, `vendorId`, `businessId`, `orderId`, ... | `Invoice` |
+| `updateInvoice` | Modifies an existing invoice. | `id`, `status`, `notes`, `disputeReason`, ... | `Invoice` |
+| `deleteInvoice` | Deletes an invoice. | `id: UUID!` | `Invoice` |
+
+---
+## InvoiceTemplate
+*Manages templates for creating invoices.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listInvoiceTemplates`| Retrieves all invoice templates. | `offset`, `limit` | `[InvoiceTemplate]` |
+| `getInvoiceTemplateById`| Fetches a single template by ID. | `id: UUID!` | `InvoiceTemplate` |
+| `listInvoiceTemplatesByOwnerId`| Lists templates for a specific owner. | `ownerId`, `offset`, `limit` | `[InvoiceTemplate]` |
+| `listInvoiceTemplatesByVendorId`| Lists templates tied to a vendor. | `vendorId`, `offset`, `limit` | `[InvoiceTemplate]` |
+| `listInvoiceTemplatesByBusinessId`| Lists templates tied to a business. | `businessId`, `offset`, `limit` | `[InvoiceTemplate]` |
+| `listInvoiceTemplatesByOrderId`| Lists templates tied to an order. | `orderId`, `offset`, `limit` | `[InvoiceTemplate]` |
+| `searchInvoiceTemplatesByOwnerAndName`| Searches for a template by name for a specific owner. | `ownerId`, `name`, `offset`, `limit` | `[InvoiceTemplate]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createInvoiceTemplate`| Adds a new invoice template. | `name`, `ownerId`, ... | `InvoiceTemplate` |
+| `updateInvoiceTemplate`| Modifies an existing template. | `id`, `name`, ... | `InvoiceTemplate` |
+| `deleteInvoiceTemplate`| Removes a template. | `id: UUID!` | `InvoiceTemplate` |
+
+---
+## Level
+*Manages experience levels for staff.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listLevels` | Retrieves all levels. | - | `[Level]` |
+| `getLevelById` | Fetches a single level by ID. | `id: UUID!` | `Level` |
+| `filterLevels` | Searches levels by name or XP required. | `name`, `xpRequired` | `[Level]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createLevel` | Adds a new level. | `name`, `xpRequired`, `icon`, `colors` | `Level` |
+| `updateLevel` | Modifies an existing level. | `id`, `name`, `xpRequired`, ... | `Level` |
+| `deleteLevel` | Removes a level. | `id: UUID!` | `Level` |
+
+---
+## MemberTask
+*Junction table linking Team Members to Tasks.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `getMyTasks` | Retrieves all tasks assigned to a team member. | `teamMemberId: UUID!` | `[MemberTask]` |
+| `getMemberTaskByIdKey`| Fetches a single assignment by team member and task ID. | `teamMemberId`, `taskId` | `MemberTask` |
+| `getMemberTasksByTaskId`| Lists all members assigned to a specific task. | `taskId: UUID!` | `[MemberTask]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createMemberTask` | Assigns a task to a team member. | `teamMemberId`, `taskId` | `MemberTask` |
+| `deleteMemberTask` | Unassigns a task from a team member. | `teamMemberId`, `taskId` | `MemberTask` |
+
+---
+## Message
+*Manages individual messages within a conversation.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listMessages` | Retrieves all messages. | - | `[Message]` |
+| `getMessageById` | Fetches a single message by ID. | `id: UUID!` | `Message` |
+| `getMessagesByConversationId`| Lists all messages for a specific conversation. | `conversationId: UUID!` | `[Message]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createMessage` | Sends a new message to a conversation. | `conversationId`, `senderId`, `content`, `isSystem` | `Message` |
+| `updateMessage` | Modifies an existing message. | `id`, `content`, ... | `Message` |
+| `deleteMessage` | Deletes a message. | `id: UUID!` | `Message` |
+
+---
+## Order
+*Manages work orders from businesses.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listOrders` | Retrieves all orders. | `offset`, `limit` | `[Order]` |
+| `getOrderById` | Fetches a single order by ID. | `id: UUID!` | `Order` |
+| `getOrdersByBusinessId`| Lists orders for a business. | `businessId`, `offset`, `limit` | `[Order]` |
+| `getOrdersByVendorId`| Lists orders for a vendor. | `vendorId`, `offset`, `limit` | `[Order]` |
+| `getOrdersByStatus`| Lists orders by status. | `status`, `offset`, `limit` | `[Order]` |
+| `getOrdersByDateRange`| Lists orders within a date range. | `start`, `end`, `offset`, `limit` | `[Order]` |
+| `getRapidOrders` | Retrieves all orders marked as "RAPID". | `offset`, `limit` | `[Order]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createOrder` | Creates a new order. | `vendorId`, `businessId`, `orderType`, `eventName`, ... | `Order` |
+| `updateOrder` | Modifies an existing order. | `id`, `status`, `eventName`, ... | `Order` |
+| `deleteOrder` | Deletes an order. | `id: UUID!` | `Order` |
+
+---
+## RecentPayment
+*Tracks recent payments related to invoices and applications.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listRecentPayments` | Retrieves all recent payments. | `offset`, `limit` | `[RecentPayment]` |
+| `getRecentPaymentById`| Fetches a single payment by ID. | `id: UUID!` | `RecentPayment` |
+| `listRecentPaymentsByStaffId`| Lists all recent payments for a staff member. | `staffId`, `offset`, `limit` | `[RecentPayment]` |
+| `listRecentPaymentsByApplicationId`| Lists payments for an application. | `applicationId`, `offset`, `limit` | `[RecentPayment]` |
+| `listRecentPaymentsByInvoiceId`| Lists all payments made for an invoice. | `invoiceId`, `offset`, `limit` | `[RecentPayment]` |
+| `listRecentPaymentsByStatus`| Lists recent payments by status. | `status`, `offset`, `limit` | `[RecentPayment]` |
+| `listRecentPaymentsByInvoiceIds`| Lists payments for a set of invoices. | `invoiceIds`, `offset`, `limit` | `[RecentPayment]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createRecentPayment` | Creates a new recent payment record. | `staffId`, `applicationId`, `invoiceId`, `status`, ... | `RecentPayment` |
+| `updateRecentPayment` | Modifies an existing payment record. | `id`, `status`, ... | `RecentPayment` |
+| `deleteRecentPayment` | Deletes a payment record. | `id: UUID!` | `RecentPayment` |
+
+---
+## Reports
+*Provides source data queries for client-side reports.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listShiftsForCoverage`| Fetches shift data for coverage reports. | `businessId`, `startDate`, `endDate` | `[Shift]` |
+| `listApplicationsForCoverage`| Fetches application data for coverage reports. | `shiftIds` | `[Application]` |
+| `listShiftsForDailyOpsByBusiness`| Fetches shift data for daily ops reports (business view). | `businessId`, `date` | `[Shift]` |
+| `listShiftsForDailyOpsByVendor`| Fetches shift data for daily ops reports (vendor view). | `vendorId`, `date` | `[Shift]` |
+| `listApplicationsForDailyOps`| Fetches application data for daily ops reports. | `shiftIds` | `[Application]` |
+| `listShiftsForForecastByBusiness`| Fetches shift data for forecast reports (business view). | `businessId`, `startDate`, `endDate` | `[Shift]` |
+| `listShiftsForForecastByVendor`| Fetches shift data for forecast reports (vendor view). | `vendorId`, `startDate`, `endDate` | `[Shift]` |
+| `listShiftsForNoShowRangeByBusiness`| Fetches shift IDs for no-show reports (business view). | `businessId`, `startDate`, `endDate` | `[Shift]` |
+| `listShiftsForNoShowRangeByVendor`| Fetches shift IDs for no-show reports (vendor view). | `vendorId`, `startDate`, `endDate` | `[Shift]` |
+| `listApplicationsForNoShowRange`| Fetches application data for no-show reports. | `shiftIds` | `[Application]` |
+| `listStaffForNoShowReport`| Fetches staff data for no-show reports. | `staffIds` | `[Staff]` |
+| `listInvoicesForSpendByBusiness`| Fetches invoice data for spending reports (business view). | `businessId`, `startDate`, `endDate` | `[Invoice]` |
+| `listInvoicesForSpendByVendor`| Fetches invoice data for spending reports (vendor view). | `vendorId`, `startDate`, `endDate` | `[Invoice]` |
+| `listInvoicesForSpendByOrder`| Fetches invoice data for spending reports by order. | `orderId`, `startDate`, `endDate` | `[Invoice]` |
+| `listTimesheetsForSpend`| Fetches timesheet (shift role) data for spending reports. | `startTime`, `endTime` | `[ShiftRole]` |
+| `listShiftsForPerformanceByBusiness`| Fetches shift data for performance reports (business view). | `businessId`, `startDate`, `endDate` | `[Shift]` |
+| `listShiftsForPerformanceByVendor`| Fetches shift data for performance reports (vendor view). | `vendorId`, `startDate`, `endDate` | `[Shift]` |
+| `listApplicationsForPerformance`| Fetches application data for performance reports. | `shiftIds` | `[Application]` |
+| `listStaffForPerformance`| Fetches staff data for performance reports. | `staffIds` | `[Staff]` |
+
+### Mutations
+> No mutations found.
+
+---
+## Role
+*Manages job roles and their pay rates.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listRoles` | Retrieves all roles. | - | `[Role]` |
+| `getRoleById` | Fetches a single role by ID. | `id: UUID!` | `Role` |
+| `listRolesByVendorId`| Lists all roles for a specific vendor. | `vendorId: UUID!` | `[Role]` |
+| `listRolesByroleCategoryId`| Lists all roles within a specific category. | `roleCategoryId: UUID!` | `[Role]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createRole` | Adds a new role. | `name`, `costPerHour`, `vendorId`, `roleCategoryId` | `Role` |
+| `updateRole` | Modifies an existing role. | `id`, `name`, `costPerHour`, `roleCategoryId` | `Role` |
+| `deleteRole` | Removes a role. | `id: UUID!` | `Role` |
+
+---
+## RoleCategory
+*Manages categories for roles.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listRoleCategories` | Retrieves all role categories. | - | `[RoleCategory]` |
+| `getRoleCategoryById`| Fetches a single role category by ID. | `id: UUID!` | `RoleCategory` |
+| `getRoleCategoriesByCategory`| Lists role categories by type. | `category: RoleCategoryType!` | `[RoleCategory]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createRoleCategory` | Adds a new role category. | `roleName`, `category` | `RoleCategory` |
+| `updateRoleCategory` | Modifies an existing role category. | `id`, `roleName`, `category` | `RoleCategory` |
+| `deleteRoleCategory` | Removes a role category. | `id: UUID!` | `RoleCategory` |
+
+---
+## Shift
+*Manages individual shifts within an order.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listShifts` | Retrieves all shifts. | `offset`, `limit` | `[Shift]` |
+| `getShiftById` | Fetches a single shift by ID. | `id: UUID!` | `Shift` |
+| `filterShifts` | Searches shifts by status, order, and date range. | `status`, `orderId`, `dateFrom`, `dateTo`, ... | `[Shift]` |
+| `getShiftsByBusinessId`| Lists shifts for a business within a date range. | `businessId`, `dateFrom`, `dateTo`, ... | `[Shift]` |
+| `getShiftsByVendorId`| Lists shifts for a vendor within a date range. | `vendorId`, `dateFrom`, `dateTo`, ... | `[Shift]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createShift` | Creates a new shift for an order. | `title`, `orderId`, `startTime`, `endTime`, ... | `Shift` |
+| `updateShift` | Modifies an existing shift. | `id`, `title`, `status`, ... | `Shift` |
+| `deleteShift` | Deletes a shift. | `id: UUID!` | `Shift` |
+
+---
+## ShiftRole
+*Junction table for roles needed in a shift.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `getShiftRoleById` | Fetches a single shift role by its composite key. | `shiftId`, `roleId` | `ShiftRole` |
+| `listShiftRolesByShiftId`| Lists all roles needed for a specific shift. | `shiftId`, `offset`, `limit` | `[ShiftRole]` |
+| `listShiftRolesByRoleId`| Lists all shifts that require a specific role. | `roleId`, `offset`, `limit` | `[ShiftRole]` |
+| `listShiftRolesByShiftIdAndTimeRange`| Lists roles for a shift within a time range. | `shiftId`, `start`, `end`, ... | `[ShiftRole]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createShiftRole` | Adds a role requirement to a shift. | `shiftId`, `roleId`, `count`, ... | `ShiftRole` |
+| `updateShiftRole` | Modifies a role requirement on a shift. | `shiftId`, `roleId`, `count`, ... | `ShiftRole` |
+| `deleteShiftRole` | Removes a role requirement from a shift. | `shiftId`, `roleId` | `ShiftRole` |
+
+---
+## Staff
+*Manages staff profiles.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listStaff` | Retrieves all staff members. | - | `[Staff]` |
+| `getStaffById` | Fetches a single staff member by ID. | `id: UUID!` | `Staff` |
+| `getStaffByUserId` | Fetches the staff profile for a user. | `userId: String!` | `[Staff]` |
+| `filterStaff` | Searches for staff by owner, name, level, or email. | `ownerId`, `fullName`, `level`, `email` | `[Staff]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `CreateStaff` | Creates a new staff profile. | `userId`, `fullName`, ... | `Staff` |
+| `UpdateStaff` | Modifies an existing staff profile. | `id`, `fullName`, `phone`, `email`, ... | `Staff` |
+| `DeleteStaff` | Deletes a staff profile. | `id: UUID!` | `Staff` |
+
+---
+## StaffAvailability
+*Manages staff availability schedules.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listStaffAvailabilities`| Retrieves all availability records. | `offset`, `limit` | `[StaffAvailability]` |
+| `listStaffAvailabilitiesByStaffId`| Lists all availability for a staff member. | `staffId`, `offset`, `limit` | `[StaffAvailability]` |
+| `getStaffAvailabilityByKey`| Fetches availability for a specific day and time slot. | `staffId`, `day`, `slot` | `StaffAvailability` |
+| `listStaffAvailabilitiesByDay`| Lists all staff availability for a specific day. | `day`, `offset`, `limit` | `[StaffAvailability]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createStaffAvailability`| Creates a new availability record. | `staffId`, `day`, `slot`, `status`, ... | `StaffAvailability` |
+| `updateStaffAvailability`| Updates an availability record. | `staffId`, `day`, `slot`, `status`, ... | `StaffAvailability` |
+| `deleteStaffAvailability`| Deletes an availability record. | `staffId`, `day`, `slot` | `StaffAvailability` |
+
+---
+## StaffAvailabilityStats
+*Manages staff availability statistics.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listStaffAvailabilityStats`| Retrieves all staff availability stats. | `offset`, `limit` | `[StaffAvailabilityStats]` |
+| `getStaffAvailabilityStatsByStaffId`| Fetches stats for a specific staff member. | `staffId: UUID!` | `StaffAvailabilityStats` |
+| `filterStaffAvailabilityStats`| Searches stats based on various metrics and date ranges. | `needWorkIndexMin`, `utilizationMin`, `lastShiftAfter`, ... | `[StaffAvailabilityStats]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createStaffAvailabilityStats`| Creates a new stats record for a staff member. | `staffId`, `needWorkIndex`, `utilizationPercentage`, ... | `StaffAvailabilityStats` |
+| `updateStaffAvailabilityStats`| Updates a stats record for a staff member. | `staffId`, `needWorkIndex`, `utilizationPercentage`, ... | `StaffAvailabilityStats` |
+| `deleteStaffAvailabilityStats`| Deletes a stats record for a staff member. | `staffId: UUID!` | `StaffAvailabilityStats` |
+
+---
+## StaffCourse
+*Tracks staff progress in courses.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `getStaffCourseById` | Fetches a single staff course record by ID. | `id: UUID!` | `StaffCourse` |
+| `listStaffCoursesByStaffId`| Lists all courses a staff member is enrolled in. | `staffId`, `offset`, `limit` | `[StaffCourse]` |
+| `listStaffCoursesByCourseId`| Lists all staff enrolled in a specific course. | `courseId`, `offset`, `limit` | `[StaffCourse]` |
+| `getStaffCourseByStaffAndCourse`| Fetches the enrollment record for a specific staff/course pair. | `staffId`, `courseId` | `[StaffCourse]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createStaffCourse` | Enrolls a staff member in a course. | `staffId`, `courseId`, `progressPercent`, ... | `StaffCourse` |
+| `updateStaffCourse` | Updates progress for a staff member in a course. | `id`, `progressPercent`, `completed`, ... | `StaffCourse` |
+| `deleteStaffCourse` | Deletes a staff course enrollment. | `id: UUID!` | `StaffCourse` |
+
+---
+## StaffDocument
+*Manages documents submitted by staff.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `getStaffDocumentByKey`| Fetches a submitted document by staff and document ID. | `staffId`, `documentId` | `StaffDocument` |
+| `listStaffDocumentsByStaffId`| Lists all documents submitted by a staff member. | `staffId`, `offset`, `limit` | `[StaffDocument]` |
+| `listStaffDocumentsByDocumentType`| Lists submitted documents of a specific type. | `documentType`, `offset`, `limit` | `[StaffDocument]` |
+| `listStaffDocumentsByStatus`| Lists submitted documents by status. | `status`, `offset`, `limit` | `[StaffDocument]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createStaffDocument` | Creates a record for a document submitted by staff. | `staffId`, `documentId`, `status`, ... | `StaffDocument` |
+| `updateStaffDocument` | Updates the status of a submitted document. | `staffId`, `documentId`, `status`, `documentUrl`, ... | `StaffDocument` |
+| `deleteStaffDocument` | Deletes a submitted document record. | `staffId`, `documentId` | `StaffDocument` |
+
+---
+## StaffRole
+*Junction table linking Staff to Roles.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listStaffRoles` | Retrieves all staff role assignments. | `offset`, `limit` | `[StaffRole]` |
+| `getStaffRoleByKey`| Fetches a single assignment by staff and role ID. | `staffId`, `roleId` | `StaffRole` |
+| `listStaffRolesByStaffId`| Lists all roles for a specific staff member. | `staffId`, `offset`, `limit` | `[StaffRole]` |
+| `listStaffRolesByRoleId`| Lists all staff who have a specific role. | `roleId`, `offset`, `limit` | `[StaffRole]` |
+| `filterStaffRoles` | Searches for assignments by staff and/or role. | `staffId`, `roleId`, `offset`, `limit` | `[StaffRole]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createStaffRole` | Assigns a role to a staff member. | `staffId`, `roleId`, `roleType` | `StaffRole` |
+| `deleteStaffRole` | Removes a role from a staff member. | `staffId`, `roleId` | `StaffRole` |
+
+---
+## Task
+*Manages tasks.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTasks` | Retrieves all tasks. | - | `[Task]` |
+| `getTaskById` | Fetches a single task by ID. | `id: UUID!` | `Task` |
+| `getTasksByOwnerId`| Lists all tasks for a specific owner. | `ownerId: UUID!` | `[Task]` |
+| `filterTasks` | Searches tasks by status or priority. | `status`, `priority` | `[Task]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTask` | Adds a new task. | `taskName`, `priority`, `status`, `ownerId`, ... | `Task` |
+| `updateTask` | Modifies an existing task. | `id`, `taskName`, `status`, ... | `Task` |
+| `deleteTask` | Deletes a task. | `id: UUID!` | `Task` |
+
+---
+## TaskComment
+*Manages comments on tasks.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTaskComments` | Retrieves all task comments. | - | `[TaskComment]` |
+| `getTaskCommentById`| Fetches a single comment by ID. | `id: UUID!` | `TaskComment` |
+| `getTaskCommentsByTaskId`| Lists all comments for a specific task. | `taskId: UUID!` | `[TaskComment]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTaskComment` | Adds a new comment to a task. | `taskId`, `teamMemberId`, `comment`, ... | `TaskComment` |
+| `updateTaskComment` | Modifies an existing comment. | `id`, `comment`, ... | `TaskComment` |
+| `deleteTaskComment` | Deletes a comment. | `id: UUID!` | `TaskComment` |
+
+---
+## TaxForm
+*Manages staff tax forms.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTaxForms` | Retrieves all tax forms. | - | `[TaxForm]` |
+| `getTaxFormById` | Fetches a single tax form by ID. | `id: UUID!` | `TaxForm` |
+| `getTaxFormsBystaffId`| Lists all tax forms for a specific staff member. | `staffId: UUID!` | `[TaxForm]` |
+| `filterTaxForms` | Searches tax forms by type, status, or staff. | `formType`, `status`, `staffId` | `[TaxForm]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTaxForm` | Adds a new tax form record. | `formType`, `title`, `staffId`, `formData`, ... | `TaxForm` |
+| `updateTaxForm` | Modifies an existing tax form record. | `id`, `status`, `formData`, ... | `TaxForm` |
+| `deleteTaxForm` | Deletes a tax form record. | `id: UUID!` | `TaxForm` |
+
+---
+## Team
+*Manages teams.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTeams` | Retrieves all teams. | - | `[Team]` |
+| `getTeamById` | Fetches a single team by ID. | `id: UUID!` | `Team` |
+| `getTeamsByOwnerId`| Lists all teams for a specific owner. | `ownerId: String!` | `[Team]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTeam` | Adds a new team. | `teamName`, `ownerId`, `ownerName`, ... | `Team` |
+| `updateTeam` | Modifies an existing team. | `id`, `teamName`, ... | `Team` |
+| `deleteTeam` | Deletes a team. | `id: UUID!` | `Team` |
+
+---
+## TeamHub
+*Manages hubs within a team.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTeamHubs` | Retrieves all team hubs. | - | `[TeamHub]` |
+| `getTeamHubById` | Fetches a single team hub by ID. | `id: UUID!` | `TeamHub` |
+| `getTeamHubsByTeamId`| Lists all hubs for a specific team. | `teamId: UUID!` | `[TeamHub]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTeamHub` | Adds a new hub to a team. | `teamId`, `hubName`, `address`, ... | `TeamHub` |
+| `updateTeamHub` | Modifies an existing team hub. | `id`, `hubName`, `address`, ... | `TeamHub` |
+| `deleteTeamHub` | Deletes a team hub. | `id: UUID!` | `TeamHub` |
+
+---
+## TeamHudDeparment
+*Manages departments within a Team Hub.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTeamHudDepartments`| Retrieves all team hub departments. | `offset`, `limit` | `[TeamHudDepartment]` |
+| `getTeamHudDepartmentById`| Fetches a single department by ID. | `id: UUID!` | `TeamHudDepartment` |
+| `listTeamHudDepartmentsByTeamHubId`| Lists all departments for a specific team hub. | `teamHubId`, `offset`, `limit` | `[TeamHudDepartment]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTeamHudDepartment`| Adds a new department to a team hub. | `name`, `teamHubId`, `costCenter` | `TeamHudDepartment` |
+| `updateTeamHudDepartment`| Modifies an existing department. | `id`, `name`, `costCenter`, ... | `TeamHudDepartment` |
+| `deleteTeamHudDepartment`| Deletes a department. | `id: UUID!` | `TeamHudDepartment` |
+
+---
+## TeamMember
+*Manages members of a team.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listTeamMembers` | Retrieves all team members. | - | `[TeamMember]` |
+| `getTeamMemberById` | Fetches a single team member by ID. | `id: UUID!` | `TeamMember` |
+| `getTeamMembersByTeamId`| Lists all members for a specific team. | `teamId: UUID!` | `[TeamMember]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createTeamMember` | Adds a new member to a team. | `teamId`, `userId`, `role`, ... | `TeamMember` |
+| `updateTeamMember` | Modifies an existing team member. | `id`, `role`, `title`, ... | `TeamMember` |
+| `updateTeamMemberInviteStatus`| Updates the invitation status for a member. | `id`, `inviteStatus` | `TeamMember` |
+| `acceptInviteByCode`| Accepts an invitation to join a team. | `inviteCode: UUID!` | `TeamMember` |
+| `cancelInviteByCode`| Cancels a pending invitation. | `inviteCode: UUID!` | `TeamMember` |
+| `deleteTeamMember` | Removes a member from a team. | `id: UUID!` | `TeamMember` |
+
+---
+## User
+*Manages system users.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listUsers` | Retrieves all users. | - | `[User]` |
+| `getUserById` | Fetches a single user by their ID (Firebase UID). | `id: String!` | `User` |
+| `filterUsers` | Searches for users by ID, email, or role. | `id`, `email`, `role`, `userRole` | `[User]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `CreateUser` | Creates a new user. | `id`, `email`, `fullName`, `role` | `User` |
+| `UpdateUser` | Modifies an existing user. | `id`, `email`, `fullName`, `role` | `User` |
+| `DeleteUser` | Deletes a user. | `id: String!` | `User` |
+
+---
+## UserConversation
+*Manages user-specific state for conversations.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listUserConversations`| Retrieves all user conversation records. | `offset`, `limit` | `[UserConversation]` |
+| `getUserConversationByKey`| Fetches a record by conversation and user ID. | `conversationId`, `userId` | `UserConversation` |
+| `listUserConversationsByUserId`| Lists all conversations a user is part of. | `userId`, `offset`, `limit` | `[UserConversation]` |
+| `listUnreadUserConversationsByUserId`| Lists conversations with unread messages for a user. | `userId`, `offset`, `limit` | `[UserConversation]` |
+| `listUserConversationsByConversationId`| Lists all participants of a conversation. | `conversationId`, `offset`, `limit` | `[UserConversation]` |
+| `filterUserConversations`| Searches records by user, conversation, and read status. | `userId`, `conversationId`, `unreadMin`, ... | `[UserConversation]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createUserConversation`| Adds a user to a conversation. | `conversationId`, `userId`, `unreadCount`, ... | `UserConversation` |
+| `updateUserConversation`| Updates a user's state in a conversation. | `conversationId`, `userId`, `unreadCount`, ... | `UserConversation` |
+| `markConversationAsRead`| Marks a conversation as read for a user. | `conversationId`, `userId`, `lastReadAt` | `UserConversation` |
+| `incrementUnreadForUser`| Increments the unread count for a user. | `conversationId`, `userId`, `unreadCount` | `UserConversation` |
+| `deleteUserConversation`| Removes a user from a conversation. | `conversationId`, `userId` | `UserConversation` |
+
+---
+## Vendor
+*Manages vendor/partner entities.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listVendors` | Retrieves all vendors. | - | `[Vendor]` |
+| `getVendorById` | Fetches a single vendor by ID. | `id: UUID!` | `Vendor` |
+| `getVendorByUserId` | Fetches vendor profiles for a user. | `userId: String!` | `[Vendor]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createVendor` | Creates a new vendor profile. | `userId`, `companyName`, ... | `Vendor` |
+| `updateVendor` | Modifies an existing vendor profile. | `id`, `companyName`, `email`, ... | `Vendor` |
+| `deleteVendor` | Deletes a vendor profile. | `id: UUID!` | `Vendor` |
+
+---
+## VendorBenefitPlan
+*Manages benefit plans offered by vendors.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listVendorBenefitPlans`| Retrieves all vendor benefit plans. | `offset`, `limit` | `[VendorBenefitPlan]` |
+| `getVendorBenefitPlanById`| Fetches a single benefit plan by ID. | `id: UUID!` | `VendorBenefitPlan` |
+| `listVendorBenefitPlansByVendorId`| Lists all benefit plans for a vendor. | `vendorId`, `offset`, `limit` | `[VendorBenefitPlan]` |
+| `listActiveVendorBenefitPlansByVendorId`| Lists active benefit plans for a vendor. | `vendorId`, `offset`, `limit` | `[VendorBenefitPlan]` |
+| `filterVendorBenefitPlans`| Searches benefit plans by vendor, title, and active status. | `vendorId`, `title`, `isActive`, ... | `[VendorBenefitPlan]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createVendorBenefitPlan`| Adds a new benefit plan. | `vendorId`, `title`, `isActive`, ... | `VendorBenefitPlan` |
+| `updateVendorBenefitPlan`| Modifies an existing benefit plan. | `id`, `title`, `isActive`, ... | `VendorBenefitPlan` |
+| `deleteVendorBenefitPlan`| Deletes a benefit plan. | `id: UUID!` | `VendorBenefitPlan` |
+
+---
+## VendorRate
+*Manages vendor rates.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `listVendorRates` | Retrieves all vendor rates. | - | `[VendorRate]` |
+| `getVendorRateById` | Fetches a single vendor rate by ID. | `id: UUID!` | `VendorRate` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createVendorRate` | Adds a new vendor rate. | `vendorId`, `roleName`, `clientRate`, `employeeWage`, ... | `VendorRate` |
+| `updateVendorRate` | Modifies an existing vendor rate. | `id`, `clientRate`, `employeeWage`, ... | `VendorRate` |
+| `deleteVendorRate` | Deletes a vendor rate. | `id: UUID!` | `VendorRate` |
+
+---
+## WorkForce
+*Manages the workforce, linking staff to vendors.*
+
+### Queries
+| Name | Purpose | Parameters | Returns |
+|---|---|---|---|
+| `getWorkforceById` | Fetches a single workforce member by ID. | `id: UUID!` | `Workforce` |
+| `getWorkforceByVendorAndStaff`| Fetches the workforce record for a specific vendor/staff pair. | `vendorId`, `staffId` | `[Workforce]` |
+| `listWorkforceByVendorId`| Lists all workforce members for a vendor. | `vendorId`, `offset`, `limit` | `[Workforce]` |
+| `listWorkforceByStaffId`| Lists all vendor associations for a staff member. | `staffId`, `offset`, `limit` | `[Workforce]` |
+| `getWorkforceByVendorAndNumber`| Checks for workforce number uniqueness within a vendor. | `vendorId`, `workforceNumber` | `[Workforce]` |
+
+### Mutations
+| Name | Purpose | Parameters | Affects |
+|---|---|---|---|
+| `createWorkforce` | Adds a new staff member to a vendor's workforce. | `vendorId`, `staffId`, `workforceNumber`, ... | `Workforce` |
+| `updateWorkforce` | Modifies a workforce member's details. | `id`, `workforceNumber`, `status`, ... | `Workforce` |
+| `deactivateWorkforce`| Sets a workforce member's status to INACTIVE. | `id: UUID!` | `Workforce` |
diff --git a/internal/launchpad/assets/documents/documents-config.json b/internal/launchpad/assets/documents/documents-config.json
index e86d355e..14f7e61e 100644
--- a/internal/launchpad/assets/documents/documents-config.json
+++ b/internal/launchpad/assets/documents/documents-config.json
@@ -6,5 +6,13 @@
{
"title": "Architecture Document & Migration Plan",
"path": "./assets/documents/legacy/client-mobile-application/architecture.md"
+ },
+ {
+ "title": "Dataconnect guide",
+ "path": "./assets/documents/dataconnect/backend_manual.md"
+ },
+ {
+ "title": "Schema Dataconnect guide",
+ "path": "./assets/documents/dataconnect/schema_dataconnect_guide.md"
}
]
diff --git a/makefiles/dataconnect.mk b/makefiles/dataconnect.mk
index d0e8940d..d1be5e32 100644
--- a/makefiles/dataconnect.mk
+++ b/makefiles/dataconnect.mk
@@ -39,14 +39,29 @@ dataconnect-generate-sdk:
# Unified backend schema update workflow (schema -> deploy -> SDK)
dataconnect-sync:
- @echo "--> [1/3] Applying SQL migrations..."
- @firebase dataconnect:sql:migrate --project=$(FIREBASE_ALIAS)
- @echo "--> [2/3] Deploying Data Connect..."
+ @echo "--> [1/3] Deploying Data Connect..."
@firebase deploy --only dataconnect --project=$(FIREBASE_ALIAS)
+ @echo "--> [2/3] Applying SQL migrations..."
+ @firebase dataconnect:sql:migrate --project=$(FIREBASE_ALIAS)
@echo "--> [3/3] Regenerating SDK..."
@firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS)
@echo "✅ Data Connect SQL, deploy, and SDK generation completed for [$(ENV)]."
+# Execute seed in Firebase Data Connect
+dataconnect-seed:
+ @echo "--> Exec seed in Firebase Data Connect..."
+ @firebase dataconnect:execute seeds/seed_min.graphql --project=$(FIREBASE_ALIAS)
+ @echo "✅ Seed executed successfully."
+
+# Run tests for Data Connect deployment and migrations
+dataconnect-test:
+ @echo "--> Running Data Connect tests..."
+ @echo "--> [1/3] Deploying Data Connect..."
+ @firebase deploy --only dataconnect --project=$(FIREBASE_ALIAS) --dry-run
+ @echo "--> [2/3] Applying SQL migrations..."
+ @firebase dataconnect:sql:diff --project=$(FIREBASE_ALIAS)
+ @echo "✅ Data Connect tests completed."
+
# -------------------------------------------------------------------
# ONE-TIME FULL SETUP FOR CLOUD SQL + DATA CONNECT
# -------------------------------------------------------------------