diff --git a/backend/dataconnect/connector/application/queries.gql b/backend/dataconnect/connector/application/queries.gql index 44c66795..dba8ae5d 100644 --- a/backend/dataconnect/connector/application/queries.gql +++ b/backend/dataconnect/connector/application/queries.gql @@ -551,6 +551,7 @@ query listAcceptedApplicationsByBusinessForDay( applications( where: { status: { in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE] } + staff: { isProfileVisible: { eq: true } } shift: { date: { ge: $dayStart, le: $dayEnd } order: { businessId: { eq: $businessId } } @@ -581,6 +582,7 @@ query listStaffsApplicationsByBusinessForDay( applications( where: { status: {in: [ CONFIRMED, CHECKED_IN, CHECKED_OUT, LATE]} + staff: { isProfileVisible: { eq: true } } shift: { date: { ge: $dayStart, le: $dayEnd } order: { businessId: { eq: $businessId } } diff --git a/backend/dataconnect/connector/staff/mutations.gql b/backend/dataconnect/connector/staff/mutations.gql index f76caeae..797ca1bd 100644 --- a/backend/dataconnect/connector/staff/mutations.gql +++ b/backend/dataconnect/connector/staff/mutations.gql @@ -38,6 +38,7 @@ mutation CreateStaff( $employmentType: EmploymentType $initial: String $englishRequired: Boolean + $isProfileVisible: Boolean $city: String $addres: String $placeId: String @@ -87,6 +88,7 @@ mutation CreateStaff( employmentType: $employmentType initial: $initial englishRequired: $englishRequired + isProfileVisible: $isProfileVisible city: $city addres: $addres placeId: $placeId @@ -143,6 +145,7 @@ mutation UpdateStaff( $employmentType: EmploymentType $initial: String $englishRequired: Boolean + $isProfileVisible: Boolean $city: String $addres: String $placeId: String @@ -193,6 +196,7 @@ mutation UpdateStaff( employmentType: $employmentType initial: $initial englishRequired: $englishRequired + isProfileVisible: $isProfileVisible city: $city addres: $addres placeId: $placeId diff --git a/backend/dataconnect/schema/staff.gql b/backend/dataconnect/schema/staff.gql index 9c1efab9..96aea342 100644 --- a/backend/dataconnect/schema/staff.gql +++ b/backend/dataconnect/schema/staff.gql @@ -85,6 +85,8 @@ type Staff @table(name: "staffs") { initial: String englishRequired: Boolean @default(expr: "false") + isProfileVisible: Boolean @default(expr: "true") + addres: String placeId: String latitude: Float diff --git a/docs/DATACONNECT_GUIDES/DOCUMENTS/schema_dataconnect_guide.md b/docs/DATACONNECT_GUIDES/DOCUMENTS/schema_dataconnect_guide.md index df36c7c4..7585a341 100644 --- a/docs/DATACONNECT_GUIDES/DOCUMENTS/schema_dataconnect_guide.md +++ b/docs/DATACONNECT_GUIDES/DOCUMENTS/schema_dataconnect_guide.md @@ -1,26 +1,26 @@ -# Data Connect Architecture Guide +# Data Connect Architecture Guide V.3 ## 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. +This guide consolidates the Data Connect domain documentation into a single reference for engineers, product stakeholders, and QA. Use it to understand the entity relationships, operational flows, and available API operations across the platform. ## 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) +- [System Overview](#system-overview) +- [Identity Domain](#identity-domain) +- [Operations Domain](#operations-domain) +- [Billing Domain](#billing-domain) +- [Teams Domain](#teams-domain) +- [Messaging Domain](#messaging-domain) +- [Compliance Domain](#compliance-domain) +- [Learning Domain](#learning-domain) +- [Sequence Diagrams](#sequence-diagrams) +- [API Catalog](#api-catalog) ---- - -## 3. System Overview +## 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). +Summarizes the high-level relationships between core entities in the system. +Highlights the user role model and how orders progress into staffing, assignments, and invoices. +Includes the communication entities that connect users, conversations, and messages. ### Full Content # System Overview Flowchart @@ -58,12 +58,12 @@ flowchart LR style B fill:#cfc,stroke:#333,stroke-width:2px ``` ---- - -## 4. Identity Domain +## 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. +Explains how users map to staff, vendors, and businesses in the identity model. +Shows the role hierarchy from staff roles to roles and role categories. +Focuses on the core identity relationships used across the platform. ### Full Content # Identity Domain Flowchart @@ -88,12 +88,12 @@ flowchart LR style B fill:#ffc,stroke:#333,stroke-width:2px ``` ---- - -## 5. Operations Domain +## 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`. +Describes the operational lifecycle from orders through shifts and applications. +Connects staffing and workforce records to assignments and invoicing outcomes. +Illustrates the end-to-end flow for fulfillment and billing readiness. ### Full Content # Operations Domain Flowchart @@ -119,12 +119,12 @@ flowchart TD style I fill:#f99,stroke:#333,stroke-width:2px ``` ---- - -## 6. Billing Domain +## 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`. +Centers the billing process on invoices linked to orders, businesses, and vendors. +Shows how recent payments attach to invoices and reference applications for context. +Provides the upstream operational context that feeds billing records. ### Full Content # Billing Domain Flowchart @@ -142,19 +142,35 @@ Based on the repository's schema, the billing process centers around the `Invoic ## Flowchart ```mermaid flowchart TD - O(Order) --> I(Invoice) - B(Business) --> I - V(Vendor) --> I - I --> RP(RecentPayment) - A(Application) --> RP + %% ----------------------------- + %% Billing Core + %% ----------------------------- + B(Business) --> O(Order) + V(Vendor) --> O + O --> I(Invoice) + I --> RP(RecentPayment) + A(Application) --> RP + + %% ----------------------------- + %% Upstream Operations (Context) + %% ----------------------------- + subgraph OPS[Upstream Operations Context] + O --> S(Shift) + S --> SR(ShiftRole) + SR --> A + ST(Staff) --> A + A --> AS(Assignment) + W(Workforce) --> AS + ST --> W + end ``` ---- - -## 7. Teams Domain +## 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. +Details how teams, members, hubs, and departments structure organizational data. +Covers task management via tasks, member assignments, and task comments. +Notes verified and missing relationships that affect traceability in the schema. ### Full Content # Teams Domain Flowchart @@ -186,28 +202,38 @@ The Teams domain in this repository organizes users and their associated tasks. ## Flowchart ```mermaid -flowchart TD - T(Team) - U(User) - TK(Task) - - T --> TM(TeamMember) - U --> TM +--- +config: + layout: elk +--- +--- +config: + layout: elk +--- +flowchart TB + subgraph STRUCTURE[Team Structure] + T(Team) --> TM(TeamMember) T --> TH(TeamHub) TH --> THD(TeamHudDepartment) - - TM --> MT(MemberTask) - TK --> MT - + U(User) --> TM + TM --> TH + end + + subgraph WORK[Work & Tasks] + TK(Task) --> MT(MemberTask) + TM --> MT TM --> TC(TaskComment) + TK --> TC + end + ``` ---- - -## 8. Messaging Domain +## 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. +Defines conversations as the container for chat metadata and history. +Links messages and user participation through user conversations. +Distinguishes verified and inferred relationships between entities. ### Full Content # Messaging Domain Flowchart @@ -249,12 +275,12 @@ flowchart TB U -- Verified --- M ``` ---- - -## 9. Compliance Domain +## 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. +Explains how staff compliance is tracked through documents and submissions. +Includes required documents, tax forms, and certificates tied to staff records. +Separates verified links from inferred relationships for compliance entities. ### Full Content # Compliance Domain Flowchart @@ -282,32 +308,26 @@ The compliance domain manages the necessary documentation and certifications for ## 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 - + subgraph subGraph0["Compliance Requirements"] + D("Document") + end + subgraph subGraph1["Staff Submissions & Documents"] + S("Staff") + SD("StaffDocument") + TF("TaxForm") + C("Certificate") + end D -- Verified --> SD - - S -- Inferred --> SD - S -- Inferred --> RD - S -- Inferred --> TF + S -- Inferred --> SD & TF S -- Verified --> C ``` ---- - -## 10. Learning Domain +## 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. +Outlines the training model with courses, categories, and levels. +Shows how staff progress is captured via staff course records. +Calls out relationships that are inferred versus explicitly modeled. ### Full Content # Learning Domain Flowchart @@ -345,16 +365,16 @@ flowchart TB CAT -- Verified --> C - S -- Inferred --> SC - C -- Inferred --> SC + S -- Verified --> SC + C -- Verified --> SC ``` ---- - -## 11. Operations Sequence Diagrams +## 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`. +Walks through the order-to-invoice sequence based on connector operations. +Lists the verified mutation steps that drive the operational flow. +Visualizes participant interactions from creation through billing. ### Full Content # Operations Sequence Diagrams @@ -367,6 +387,7 @@ Based on the repository's connector operations, the operational flow begins when ### Verified Steps (Evidence) - `createOrder` (source: `dataconnect/connector/order/mutations.gql`) - `createShift` (source: `dataconnect/connector/shift/mutations.gql`) +- `createShiftRole` (source: `dataconnect/connector/shiftRole/mutations.gql`) - `createApplication` (source: `dataconnect/connector/application/mutations.gql`) - `CreateAssignment` (source: `dataconnect/connector/assignment/mutations.gql`) - `createInvoice` (source: `dataconnect/connector/invoice/mutations.gql`) @@ -374,981 +395,906 @@ Based on the repository's connector operations, the operational flow begins when ### Sequence Diagram ```mermaid sequenceDiagram - participant User + participant Business as Business (Client) + participant Vendor as Vendor (Provider) participant Order participant Shift + participant ShiftRole + participant Staff participant Application + participant Workforce participant Assignment participant Invoice - User->>Order: createOrder() - activate Order - Order-->>User: new Order - deactivate Order + Business->>Order: createOrder(businessId, vendorId, ...) + Order-->>Business: Order created (orderId) - User->>Shift: createShift(orderId) - activate Shift - Shift-->>User: new Shift - deactivate Shift - - User->>Application: createApplication(shiftId) - activate Application - Application-->>User: new Application - deactivate Application + Vendor->>Shift: createShift(orderId, ...) + Shift-->>Vendor: Shift created (shiftId) - User->>Assignment: CreateAssignment(shiftId, workforceId) - activate Assignment - Assignment-->>User: new Assignment - deactivate Assignment + Vendor->>ShiftRole: createShiftRole(shiftId, roleId, workersNeeded, rate, ...) + ShiftRole-->>Vendor: ShiftRole created (shiftRoleId) + + Staff->>Application: createApplication(shiftId OR shiftRoleId, staffId, ...) + Application-->>Staff: Application submitted (applicationId) + + Vendor->>Workforce: createWorkforce(applicationId / staffId / shiftId, ...) + Workforce-->>Vendor: Workforce created (workforceId) + + Vendor->>Assignment: createAssignment(shiftId, workforceId, staffId, ...) + Assignment-->>Vendor: Assignment created (assignmentId) + + Vendor->>Invoice: createInvoice(orderId, businessId, vendorId, ...) + Invoice-->>Vendor: Invoice created (invoiceId) - User->>Invoice: createInvoice(orderId) - activate Invoice - Invoice-->>User: new Invoice - deactivate Invoice ``` ---- - -## 12. API Catalog +## 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. +Lists every GraphQL query and mutation in the Data Connect connectors. +Provides parameters and top-level return/affect fields for each operation. +Organizes operations by entity folder for quick discovery and reference. ### 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. +This catalog enumerates every GraphQL query and mutation defined in the Data Connect connector folders under `prototypes/dataconnect/connector/`. Use it to discover available operations, required parameters, and the top-level fields returned or affected by each operation. ---- -## Account -*Manages bank accounts for owners (vendors/businesses).* +## account ### 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]` | +|------|---------|------------|---------| +| `listAccounts` | List accounts | — | `accounts` | +| `getAccountById` | Get account by id | `$id: UUID!` | `account` | +| `getAccountsByOwnerId` | Get accounts by owner id | `$ownerId: UUID!` | `accounts` | +| `filterAccounts` | Filter accounts | `$bank: String`
`$type: AccountType`
`$isPrimary: Boolean`
`$ownerId: UUID` | `accounts` | ### 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` | +|------|---------|------------|---------| +| `createAccount` | Create account | `$bank: String!`
`$type: AccountType!`
`$last4: String!`
`$isPrimary: Boolean`
`$ownerId: UUID!`
`$accountNumber: String`
`$routeNumber: String`
`$expiryTime: Timestamp` | `account_insert` | +| `updateAccount` | Update account | `$id: UUID!`
`$bank: String`
`$type: AccountType`
`$last4: String`
`$isPrimary: Boolean`
`$accountNumber: String`
`$routeNumber: String`
`$expiryTime: Timestamp` | `account_update` | +| `deleteAccount` | Delete account | `$id: UUID!` | `account_delete` | ---- -## ActivityLog -*Tracks user activities and notifications.* +## activityLog ### 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]` | +|------|---------|------------|---------| +| `listActivityLogs` | List activity logs | `$offset: Int`
`$limit: Int` | `activityLogs` | +| `getActivityLogById` | Get activity log by id | `$id: UUID!` | `activityLog` | +| `listActivityLogsByUserId` | List activity logs by user id | `$userId: String!`
`$offset: Int`
`$limit: Int` | `activityLogs` | +| `listUnreadActivityLogsByUserId` | List unread activity logs by user id | `$userId: String!`
`$offset: Int`
`$limit: Int` | `activityLogs` | +| `filterActivityLogs` | Filter activity logs | `$userId: String`
`$dateFrom: Timestamp`
`$dateTo: Timestamp`
`$isRead: Boolean`
`$activityType: ActivityType`
`$iconType: ActivityIconType`
`$offset: Int`
`$limit: Int` | `activityLogs` | ### 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` | +|------|---------|------------|---------| +| `createActivityLog` | Create activity log | `$userId: String!`
`$date: Timestamp!`
`$hourStart: String`
`$hourEnd: String`
`$totalhours: String`
`$iconType: ActivityIconType`
`$iconColor: String`
`$title: String!`
`$description: String!`
`$isRead: Boolean`
`$activityType: ActivityType!` | `activityLog_insert` | +| `updateActivityLog` | Update activity log | `$id: UUID!`
`$userId: String`
`$date: Timestamp`
`$hourStart: String`
`$hourEnd: String`
`$totalhours: String`
`$iconType: ActivityIconType`
`$iconColor: String`
`$title: String`
`$description: String`
`$isRead: Boolean`
`$activityType: ActivityType` | `activityLog_update` | +| `markActivityLogAsRead` | Mark activity log as read | `$id: UUID!` | `activityLog_update` | +| `markActivityLogsAsRead` | Mark activity logs as read | `$ids: [UUID!]!` | `activityLog_updateMany` | +| `deleteActivityLog` | Delete activity log | `$id: UUID!` | `activityLog_delete` | ---- -## Application -*Manages staff applications for shifts.* +## application ### 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]` | +|------|---------|------------|---------| +| `listApplications` | List applications | — | `applications` | +| `getApplicationById` | Get application by id | `$id: UUID!` | `application` | +| `getApplicationsByShiftId` | Get applications by shift id | `$shiftId: UUID!` | `applications` | +| `getApplicationsByShiftIdAndStatus` | Get applications by shift id and status | `$shiftId: UUID!`
`$status: ApplicationStatus!`
`$offset: Int`
`$limit: Int` | `applications` | +| `getApplicationsByStaffId` | Get applications by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int`
`$dayStart: Timestamp`
`$dayEnd: Timestamp` | `applications` | +| `vaidateDayStaffApplication` | Vaidate day staff application | `$staffId: UUID!`
`$offset: Int`
`$limit: Int`
`$dayStart: Timestamp`
`$dayEnd: Timestamp` | `applications` | +| `getApplicationByStaffShiftAndRole` | Get application by staff shift and role | `$staffId: UUID!`
`$shiftId: UUID!`
`$roleId: UUID!`
`$offset: Int`
`$limit: Int` | `applications` | +| `listAcceptedApplicationsByShiftRoleKey` | List accepted applications by shift role key | `$shiftId: UUID!`
`$roleId: UUID!`
`$offset: Int`
`$limit: Int` | `applications` | +| `listAcceptedApplicationsByBusinessForDay` | List accepted applications by business for day | `$businessId: UUID!`
`$dayStart: Timestamp!`
`$dayEnd: Timestamp!`
`$offset: Int`
`$limit: Int` | `applications` | +| `listStaffsApplicationsByBusinessForDay` | List staffs applications by business for day | `$businessId: UUID!`
`$dayStart: Timestamp!`
`$dayEnd: Timestamp!`
`$offset: Int`
`$limit: Int` | `applications` | +| `listCompletedApplicationsByStaffId` | List completed applications by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `applications` | ### 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` | +|------|---------|------------|---------| +| `createApplication` | Create application | `$shiftId: UUID!`
`$staffId: UUID!`
`$status: ApplicationStatus!`
`$checkInTime: Timestamp`
`$checkOutTime: Timestamp`
`$origin: ApplicationOrigin!`
`$roleId: UUID!` | `application_insert` | +| `updateApplicationStatus` | Update application status | `$id: UUID!`
`$shiftId: UUID`
`$staffId: UUID`
`$status: ApplicationStatus`
`$checkInTime: Timestamp`
`$checkOutTime: Timestamp`
`$roleId: UUID` | `application_update` | +| `deleteApplication` | Delete application | `$id: UUID!` | `application_delete` | ---- -## Assignment -*Manages staff assignments to shifts.* +## assignment ### 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]` | +|------|---------|------------|---------| +| `listAssignments` | List assignments | `$offset: Int`
`$limit: Int` | `assignments` | +| `getAssignmentById` | Get assignment by id | `$id: UUID!` | `assignment` | +| `listAssignmentsByWorkforceId` | List assignments by workforce id | `$workforceId: UUID!`
`$offset: Int`
`$limit: Int` | `assignments` | +| `listAssignmentsByWorkforceIds` | List assignments by workforce ids | `$workforceIds: [UUID!]!`
`$offset: Int`
`$limit: Int` | `assignments` | +| `listAssignmentsByShiftRole` | List assignments by shift role | `$shiftId: UUID!`
`$roleId: UUID!`
`$offset: Int`
`$limit: Int` | `assignments` | +| `represents` | Represents | — | `assignments` | +| `filterAssignments` | Filter assignments | `$shiftIds: [UUID!]!`
`$roleIds: [UUID!]!`
`$status: AssignmentStatus`
`$offset: Int`
`$limit: Int` | `assignments` | ### 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` | +|------|---------|------------|---------| +| `CreateAssignment` | Create assignment | `$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!` | `assignment_insert` | +| `UpdateAssignment` | Update assignment | `$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!` | `assignment_update` | +| `DeleteAssignment` | Delete assignment | `$id: UUID!` | `assignment_delete` | ---- -## AttireOption -*Manages attire options for vendors.* +## attireOption ### 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]` | +|------|---------|------------|---------| +| `listAttireOptions` | List attire options | — | `attireOptions` | +| `getAttireOptionById` | Get attire option by id | `$id: UUID!` | `attireOption` | +| `filterAttireOptions` | Filter attire options | `$itemId: String`
`$isMandatory: Boolean`
`$vendorId: UUID` | `attireOptions` | ### 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` | +|------|---------|------------|---------| +| `createAttireOption` | Create attire option | `$itemId: String!`
`$label: String!`
`$icon: String`
`$imageUrl: String`
`$isMandatory: Boolean`
`$vendorId: UUID` | `attireOption_insert` | +| `updateAttireOption` | Update attire option | `$id: UUID!`
`$itemId: String`
`$label: String`
`$icon: String`
`$imageUrl: String`
`$isMandatory: Boolean`
`$vendorId: UUID` | `attireOption_update` | +| `deleteAttireOption` | Delete attire option | `$id: UUID!` | `attireOption_delete` | ---- -## BenefitsData -*Tracks staff enrollment in vendor benefit plans.* +## benefitsData ### 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]` | +|------|---------|------------|---------| +| `listBenefitsData` | List benefits data | `$offset: Int`
`$limit: Int` | `benefitsDatas` | +| `getBenefitsDataByKey` | Get benefits data by key | `$staffId: UUID!`
`$vendorBenefitPlanId: UUID!` | `benefitsData` | +| `listBenefitsDataByStaffId` | List benefits data by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `benefitsDatas` | +| `listBenefitsDataByVendorBenefitPlanId` | List benefits data by vendor benefit plan id | `$vendorBenefitPlanId: UUID!`
`$offset: Int`
`$limit: Int` | `benefitsDatas` | +| `listBenefitsDataByVendorBenefitPlanIds` | List benefits data by vendor benefit plan ids | `$vendorBenefitPlanIds: [UUID!]!`
`$offset: Int`
`$limit: Int` | `benefitsDatas` | ### 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` | +|------|---------|------------|---------| +| `createBenefitsData` | Create benefits data | `$vendorBenefitPlanId: UUID!`
`$staffId: UUID!`
`$current: Int!` | `benefitsData_insert` | +| `updateBenefitsData` | Update benefits data | `$staffId: UUID!`
`$vendorBenefitPlanId: UUID!`
`$current: Int` | `benefitsData_update` | +| `deleteBenefitsData` | Delete benefits data | `$staffId: UUID!`
`$vendorBenefitPlanId: UUID!` | `benefitsData_delete` | ---- -## Business -*Manages client/business entities.* +## business ### 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` | +|------|---------|------------|---------| +| `listBusinesses` | List businesses | — | `businesses` | +| `getBusinessesByUserId` | Get businesses by user id | `$userId: String!` | `businesses` | +| `getBusinessById` | Get business by 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` | +|------|---------|------------|---------| +| `createBusiness` | Create business | `$businessName: String!`
`$contactName: String`
`$userId: String!`
`$companyLogoUrl: String`
`$phone: String`
`$email: String`
`$hubBuilding: String`
`$address: String`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$city: String`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String`
`$area: BusinessArea`
`$sector: BusinessSector`
`$rateGroup: BusinessRateGroup!`
`$status: BusinessStatus!`
`$notes: String` | `business_insert` | +| `updateBusiness` | Update business | `$id: UUID!`
`$businessName: String`
`$contactName: String`
`$companyLogoUrl: String`
`$phone: String`
`$email: String`
`$hubBuilding: String`
`$address: String`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$city: String`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String`
`$area: BusinessArea`
`$sector: BusinessSector`
`$rateGroup: BusinessRateGroup`
`$status: BusinessStatus`
`$notes: String` | `business_update` | +| `deleteBusiness` | Delete business | `$id: UUID!` | `business_delete` | ---- -## Category -*Manages categories for courses, roles, etc.* +## category ### 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]` | +|------|---------|------------|---------| +| `listCategories` | List categories | — | `categories` | +| `getCategoryById` | Get category by id | `$id: UUID!` | `category` | +| `filterCategories` | Filter categories | `$categoryId: String`
`$label: String` | `categories` | ### 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` | +|------|---------|------------|---------| +| `createCategory` | Create category | `$categoryId: String!`
`$label: String!`
`$icon: String` | `category_insert` | +| `updateCategory` | Update category | `$id: UUID!`
`$categoryId: String`
`$label: String`
`$icon: String` | `category_update` | +| `deleteCategory` | Delete category | `$id: UUID!` | `category_delete` | ---- -## Certificate -*Manages staff certifications.* +## certificate ### 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]` | +|------|---------|------------|---------| +| `listCertificates` | List certificates | — | `certificates` | +| `getCertificateById` | Get certificate by id | `$id: UUID!` | `certificate` | +| `listCertificatesByStaffId` | List certificates by staff id | `$staffId: UUID!` | `certificates` | ### 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` | +|------|---------|------------|---------| +| `CreateCertificate` | Create certificate | `$name: String!`
`$description: String`
`$expiry: Timestamp`
`$status: CertificateStatus!`
`$fileUrl: String`
`$icon: String`
`$certificationType: ComplianceType`
`$issuer: String`
`$staffId: UUID!`
`$validationStatus: ValidationStatus`
`$certificateNumber: String` | `certificate_insert` | +| `UpdateCertificate` | Update certificate | `$id: UUID!`
`$name: String`
`$description: String`
`$expiry: Timestamp`
`$status: CertificateStatus`
`$fileUrl: String`
`$icon: String`
`$staffId: UUID`
`$certificationType: ComplianceType`
`$issuer: String`
`$validationStatus: ValidationStatus`
`$certificateNumber: String` | `certificate_update` | +| `DeleteCertificate` | Delete certificate | `$id: UUID!` | `certificate_delete` | ---- -## ClientFeedback -*Manages feedback from businesses about vendors.* +## clientFeedback ### 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]` | +|------|---------|------------|---------| +| `listClientFeedbacks` | List client feedbacks | `$offset: Int`
`$limit: Int` | `clientFeedbacks` | +| `getClientFeedbackById` | Get client feedback by id | `$id: UUID!` | `clientFeedback` | +| `listClientFeedbacksByBusinessId` | List client feedbacks by business id | `$businessId: UUID!`
`$offset: Int`
`$limit: Int` | `clientFeedbacks` | +| `listClientFeedbacksByVendorId` | List client feedbacks by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `clientFeedbacks` | +| `listClientFeedbacksByBusinessAndVendor` | List client feedbacks by business and vendor | `$businessId: UUID!`
`$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `clientFeedbacks` | +| `filterClientFeedbacks` | Filter client feedbacks | `$businessId: UUID`
`$vendorId: UUID`
`$ratingMin: Int`
`$ratingMax: Int`
`$dateFrom: Timestamp`
`$dateTo: Timestamp`
`$offset: Int`
`$limit: Int` | `clientFeedbacks` | +| `listClientFeedbackRatingsByVendorId` | List client feedback ratings by vendor id | `$vendorId: UUID!`
`$dateFrom: Timestamp`
`$dateTo: Timestamp` | `clientFeedbacks` | ### 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` | +|------|---------|------------|---------| +| `createClientFeedback` | Create client feedback | `$businessId: UUID!`
`$vendorId: UUID!`
`$rating: Int`
`$comment: String`
`$date: Timestamp`
`$createdBy: String` | `clientFeedback_insert` | +| `updateClientFeedback` | Update client feedback | `$id: UUID!`
`$businessId: UUID`
`$vendorId: UUID`
`$rating: Int`
`$comment: String`
`$date: Timestamp`
`$createdBy: String` | `clientFeedback_update` | +| `deleteClientFeedback` | Delete client feedback | `$id: UUID!` | `clientFeedback_delete` | ---- -## Contact -*Manages staff emergency contacts.* +## conversation ### 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]` | +|------|---------|------------|---------| +| `listConversations` | List conversations | `$offset: Int`
`$limit: Int` | `conversations` | +| `getConversationById` | Get conversation by id | `$id: UUID!` | `conversation` | +| `listConversationsByType` | List conversations by type | `$conversationType: ConversationType!`
`$offset: Int`
`$limit: Int` | `conversations` | +| `listConversationsByStatus` | List conversations by status | `$status: ConversationStatus!`
`$offset: Int`
`$limit: Int` | `conversations` | +| `filterConversations` | Filter conversations | `$status: ConversationStatus`
`$conversationType: ConversationType`
`$isGroup: Boolean`
`$lastMessageAfter: Timestamp`
`$lastMessageBefore: Timestamp`
`$offset: Int`
`$limit: Int` | `conversations` | ### 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` | +|------|---------|------------|---------| +| `createConversation` | Create conversation | `$subject: String`
`$status: ConversationStatus`
`$conversationType: ConversationType`
`$isGroup: Boolean`
`$groupName: String`
`$lastMessage: String`
`$lastMessageAt: Timestamp` | `conversation_insert` | +| `updateConversation` | Update conversation | `$id: UUID!`
`$subject: String`
`$status: ConversationStatus`
`$conversationType: ConversationType`
`$isGroup: Boolean`
`$groupName: String`
`$lastMessage: String`
`$lastMessageAt: Timestamp` | `conversation_update` | +| `updateConversationLastMessage` | Update conversation last message | `$id: UUID!`
`$lastMessage: String`
`$lastMessageAt: Timestamp` | `conversation_update` | +| `deleteConversation` | Delete conversation | `$id: UUID!` | `conversation_delete` | ---- -## Conversation -*Manages conversation metadata.* +## course ### 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]` | +|------|---------|------------|---------| +| `listCourses` | List courses | — | `courses` | +| `getCourseById` | Get course by id | `$id: UUID!` | `course` | +| `filterCourses` | Filter courses | `$categoryId: UUID`
`$isCertification: Boolean`
`$levelRequired: String`
`$completed: Boolean` | `courses` | ### 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` | +|------|---------|------------|---------| +| `createCourse` | Create course | `$title: String`
`$description: String`
`$thumbnailUrl: String`
`$durationMinutes: Int`
`$xpReward: Int`
`$categoryId: UUID!`
`$levelRequired: String`
`$isCertification: Boolean` | `course_insert` | +| `updateCourse` | Update course | `$id: UUID!`
`$title: String`
`$description: String`
`$thumbnailUrl: String`
`$durationMinutes: Int`
`$xpReward: Int`
`$categoryId: UUID!`
`$levelRequired: String`
`$isCertification: Boolean` | `course_update` | +| `deleteCourse` | Delete course | `$id: UUID!` | `course_delete` | ---- -## Course -*Manages training courses.* +## customRateCard ### 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]` | +|------|---------|------------|---------| +| `listCustomRateCards` | List custom rate cards | — | `customRateCards` | +| `getCustomRateCardById` | Get custom rate card by id | `$id: UUID!` | `customRateCard` | ### 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` | +|------|---------|------------|---------| +| `createCustomRateCard` | Create custom rate card | `$name: String!`
`$baseBook: String`
`$discount: Float`
`$isDefault: Boolean` | `customRateCard_insert` | +| `updateCustomRateCard` | Update custom rate card | `$id: UUID!`
`$name: String`
`$baseBook: String`
`$discount: Float`
`$isDefault: Boolean` | `customRateCard_update` | +| `deleteCustomRateCard` | Delete custom rate card | `$id: UUID!` | `customRateCard_delete` | ---- -## CustomRateCard -*Manages custom rate cards.* +## document ### Queries | Name | Purpose | Parameters | Returns | -|---|---|---|---| -| `listCustomRateCards`| Retrieves all custom rate cards. | - | `[CustomRateCard]` | -| `getCustomRateCardById`| Fetches a single rate card by ID. | `id: UUID!` | `CustomRateCard` | +|------|---------|------------|---------| +| `listDocuments` | List documents | — | `documents` | +| `getDocumentById` | Get document by id | `$id: UUID!` | `document` | +| `filterDocuments` | Filter documents | `$documentType: DocumentType` | `documents` | ### 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` | +|------|---------|------------|---------| +| `createDocument` | Create document | `$documentType: DocumentType!`
`$name: String!`
`$description: String` | `document_insert` | +| `updateDocument` | Update document | `$id: UUID!`
`$documentType: DocumentType`
`$name: String`
`$description: String` | `document_update` | +| `deleteDocument` | Delete document | `$id: UUID!` | `document_delete` | ---- -## Document -*Manages document types and definitions.* +## emergencyContact ### 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]` | +|------|---------|------------|---------| +| `listEmergencyContacts` | List emergency contacts | — | `emergencyContacts` | +| `getEmergencyContactById` | Get emergency contact by id | `$id: UUID!` | `emergencyContact` | +| `getEmergencyContactsByStaffId` | Get emergency contacts by staff id | `$staffId: UUID!` | `emergencyContacts` | ### 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` | +|------|---------|------------|---------| +| `createEmergencyContact` | Create emergency contact | `$name: String!`
`$phone: String!`
`$relationship: RelationshipType!`
`$staffId: UUID!` | `emergencyContact_insert` | +| `updateEmergencyContact` | Update emergency contact | `$id: UUID!`
`$name: String`
`$phone: String`
`$relationship: RelationshipType` | `emergencyContact_update` | +| `deleteEmergencyContact` | Delete emergency contact | `$id: UUID!` | `emergencyContact_delete` | ---- -## FaqData -*Manages Frequently Asked Questions.* +## faqData ### 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]` | +|------|---------|------------|---------| +| `listFaqDatas` | List faq datas | — | `faqDatas` | +| `getFaqDataById` | Get faq data by id | `$id: UUID!` | `faqData` | +| `filterFaqDatas` | Filter faq datas | `$category: String` | `faqDatas` | ### 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` | +|------|---------|------------|---------| +| `createFaqData` | Create faq data | `$category: String!`
`$questions: [Any!]` | `faqData_insert` | +| `updateFaqData` | Update faq data | `$id: UUID!`
`$category: String`
`$questions: [Any!]` | `faqData_update` | +| `deleteFaqData` | Delete faq data | `$id: UUID!` | `faqData_delete` | ---- -## Hub -*Manages physical locations or hubs.* +## hub ### 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]` | +|------|---------|------------|---------| +| `listHubs` | List hubs | — | `hubs` | +| `getHubById` | Get hub by id | `$id: UUID!` | `hub` | +| `getHubsByOwnerId` | Get hubs by owner id | `$ownerId: UUID!` | `hubs` | +| `filterHubs` | Filter hubs | `$ownerId: UUID`
`$name: String`
`$nfcTagId: String` | `hubs` | ### 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` | +|------|---------|------------|---------| +| `createHub` | Create hub | `$name: String!`
`$locationName: String`
`$address: String`
`$nfcTagId: String`
`$ownerId: UUID!` | `hub_insert` | +| `updateHub` | Update hub | `$id: UUID!`
`$name: String`
`$locationName: String`
`$address: String`
`$nfcTagId: String`
`$ownerId: UUID` | `hub_update` | +| `deleteHub` | Delete hub | `$id: UUID!` | `hub_delete` | ---- -## Invoice -*Manages billing and invoices.* +## invoice ### 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]` | +|------|---------|------------|---------| +| `listInvoices` | List invoices | `$offset: Int`
`$limit: Int` | `invoices` | +| `getInvoiceById` | Get invoice by id | `$id: UUID!` | `invoice` | +| `listInvoicesByVendorId` | List invoices by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `invoices` | +| `listInvoicesByBusinessId` | List invoices by business id | `$businessId: UUID!`
`$offset: Int`
`$limit: Int` | `invoices` | +| `listInvoicesByOrderId` | List invoices by order id | `$orderId: UUID!`
`$offset: Int`
`$limit: Int` | `invoices` | +| `listInvoicesByStatus` | List invoices by status | `$status: InvoiceStatus!`
`$offset: Int`
`$limit: Int` | `invoices` | +| `filterInvoices` | Filter invoices | `$vendorId: UUID`
`$businessId: UUID`
`$orderId: UUID`
`$status: InvoiceStatus`
`$issueDateFrom: Timestamp`
`$issueDateTo: Timestamp`
`$dueDateFrom: Timestamp`
`$dueDateTo: Timestamp`
`$offset: Int`
`$limit: Int` | `invoices` | +| `listOverdueInvoices` | List overdue invoices | `$now: Timestamp!`
`$offset: Int`
`$limit: Int` | `invoices` | ### 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` | +|------|---------|------------|---------| +| `createInvoice` | Create invoice | `$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` | `invoice_insert` | +| `updateInvoice` | Update invoice | `$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` | `invoice_update` | +| `deleteInvoice` | Delete invoice | `$id: UUID!` | `invoice_delete` | ---- -## InvoiceTemplate -*Manages templates for creating invoices.* +## invoiceTemplate ### 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]` | +|------|---------|------------|---------| +| `listInvoiceTemplates` | List invoice templates | `$offset: Int`
`$limit: Int` | `invoiceTemplates` | +| `getInvoiceTemplateById` | Get invoice template by id | `$id: UUID!` | `invoiceTemplate` | +| `listInvoiceTemplatesByOwnerId` | List invoice templates by owner id | `$ownerId: UUID!`
`$offset: Int`
`$limit: Int` | `invoiceTemplates` | +| `listInvoiceTemplatesByVendorId` | List invoice templates by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `invoiceTemplates` | +| `listInvoiceTemplatesByBusinessId` | List invoice templates by business id | `$businessId: UUID!`
`$offset: Int`
`$limit: Int` | `invoiceTemplates` | +| `listInvoiceTemplatesByOrderId` | List invoice templates by order id | `$orderId: UUID!`
`$offset: Int`
`$limit: Int` | `invoiceTemplates` | +| `searchInvoiceTemplatesByOwnerAndName` | Search invoice templates by owner and name | `$ownerId: UUID!`
`$name: String!`
`$offset: Int`
`$limit: Int` | `invoiceTemplates` | ### 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` | +|------|---------|------------|---------| +| `createInvoiceTemplate` | Create invoice template | `$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` | `invoiceTemplate_insert` | +| `updateInvoiceTemplate` | Update invoice template | `$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` | `invoiceTemplate_update` | +| `deleteInvoiceTemplate` | Delete invoice template | `$id: UUID!` | `invoiceTemplate_delete` | ---- -## Level -*Manages experience levels for staff.* +## level ### 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]` | +|------|---------|------------|---------| +| `listLevels` | List levels | — | `levels` | +| `getLevelById` | Get level by id | `$id: UUID!` | `level` | +| `filterLevels` | Filter levels | `$name: String`
`$xpRequired: Int` | `levels` | ### 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` | +|------|---------|------------|---------| +| `createLevel` | Create level | `$name: String!`
`$xpRequired: Int!`
`$icon: String`
`$colors: Any` | `level_insert` | +| `updateLevel` | Update level | `$id: UUID!`
`$name: String`
`$xpRequired: Int`
`$icon: String`
`$colors: Any` | `level_update` | +| `deleteLevel` | Delete level | `$id: UUID!` | `level_delete` | ---- -## MemberTask -*Junction table linking Team Members to Tasks.* +## memberTask ### 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]` | +|------|---------|------------|---------| +| `getMyTasks` | Get my tasks | `$teamMemberId: UUID!` | `memberTasks` | +| `getMemberTaskByIdKey` | Get member task by id key | `$teamMemberId: UUID!`
`$taskId: UUID!` | `memberTask` | +| `getMemberTasksByTaskId` | Get member tasks by task id | `$taskId: UUID!` | `memberTasks` | ### 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` | +|------|---------|------------|---------| +| `createMemberTask` | Create member task | `$teamMemberId: UUID!`
`$taskId: UUID!` | `memberTask_insert` | +| `deleteMemberTask` | Delete member task | `$teamMemberId: UUID!`
`$taskId: UUID!` | `memberTask_delete` | ---- -## Message -*Manages individual messages within a conversation.* +## message ### 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]` | +|------|---------|------------|---------| +| `listMessages` | List messages | — | `messages` | +| `getMessageById` | Get message by id | `$id: UUID!` | `message` | +| `getMessagesByConversationId` | Get messages by conversation id | `$conversationId: UUID!` | `messages` | ### 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` | +|------|---------|------------|---------| +| `createMessage` | Create message | `$conversationId: UUID!`
`$senderId: String!`
`$content: String!`
`$isSystem: Boolean` | `message_insert` | +| `updateMessage` | Update message | `$id: UUID!`
`$conversationId: UUID`
`$senderId: String`
`$content: String`
`$isSystem: Boolean` | `message_update` | +| `deleteMessage` | Delete message | `$id: UUID!` | `message_delete` | ---- -## Order -*Manages work orders from businesses.* +## order ### 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]` | +|------|---------|------------|---------| +| `listOrders` | List orders | `$offset: Int`
`$limit: Int` | `orders` | +| `getOrderById` | Get order by id | `$id: UUID!` | `order` | +| `getOrdersByBusinessId` | Get orders by business id | `$businessId: UUID!`
`$offset: Int`
`$limit: Int` | `orders` | +| `getOrdersByVendorId` | Get orders by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `orders` | +| `getOrdersByStatus` | Get orders by status | `$status: OrderStatus!`
`$offset: Int`
`$limit: Int` | `orders` | +| `getOrdersByDateRange` | Get orders by date range | `$start: Timestamp!`
`$end: Timestamp!`
`$offset: Int`
`$limit: Int` | `orders` | +| `getRapidOrders` | Get rapid orders | `$offset: Int`
`$limit: Int` | `orders` | +| `listOrdersByBusinessAndTeamHub` | List orders by business and team hub | `$businessId: UUID!`
`$teamHubId: UUID!`
`$offset: Int`
`$limit: Int` | `orders` | ### 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` | +|------|---------|------------|---------| +| `createOrder` | Create order | `$vendorId: UUID`
`$businessId: UUID!`
`$orderType: OrderType!`
`$status: OrderStatus`
`$date: Timestamp`
`$startDate: Timestamp`
`$endDate: Timestamp`
`$duration: OrderDuration`
`$lunchBreak: Int`
`$total: Float`
`$eventName: String`
`$assignedStaff: Any`
`$shifts: Any`
`$requested: Int`
`$teamHubId: UUID!`
`$recurringDays: Any`
`$permanentStartDate: Timestamp`
`$permanentDays: Any`
`$notes: String`
`$detectedConflicts: Any`
`$poReference: String` | `order_insert` | +| `updateOrder` | Update order | `$id: UUID!`
`$vendorId: UUID`
`$businessId: UUID`
`$status: OrderStatus`
`$date: Timestamp`
`$startDate: Timestamp`
`$endDate: Timestamp`
`$total: Float`
`$eventName: String`
`$assignedStaff: Any`
`$shifts: Any`
`$requested: Int`
`$teamHubId: UUID!`
`$recurringDays: Any`
`$permanentDays: Any`
`$notes: String`
`$detectedConflicts: Any`
`$poReference: String` | `order_update` | +| `deleteOrder` | Delete order | `$id: UUID!` | `order_delete` | ---- -## RecentPayment -*Tracks recent payments related to invoices and applications.* +## recentPayment ### 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]` | +|------|---------|------------|---------| +| `listRecentPayments` | List recent payments | `$offset: Int`
`$limit: Int` | `recentPayments` | +| `getRecentPaymentById` | Get recent payment by id | `$id: UUID!` | `recentPayment` | +| `listRecentPaymentsByStaffId` | List recent payments by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `recentPayments` | +| `listRecentPaymentsByApplicationId` | List recent payments by application id | `$applicationId: UUID!`
`$offset: Int`
`$limit: Int` | `recentPayments` | +| `listRecentPaymentsByInvoiceId` | List recent payments by invoice id | `$invoiceId: UUID!`
`$offset: Int`
`$limit: Int` | `recentPayments` | +| `listRecentPaymentsByStatus` | List recent payments by status | `$status: RecentPaymentStatus!`
`$offset: Int`
`$limit: Int` | `recentPayments` | +| `listRecentPaymentsByInvoiceIds` | List recent payments by invoice ids | `$invoiceIds: [UUID!]!`
`$offset: Int`
`$limit: Int` | `recentPayments` | +| `listRecentPaymentsByBusinessId` | List recent payments by business id | `$businessId: UUID!`
`$offset: Int`
`$limit: Int` | `recentPayments` | ### 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` | +|------|---------|------------|---------| +| `createRecentPayment` | Create recent payment | `$workedTime: String`
`$status: RecentPaymentStatus`
`$staffId: UUID!`
`$applicationId: UUID!`
`$invoiceId: UUID!` | `recentPayment_insert` | +| `updateRecentPayment` | Update recent payment | `$id: UUID!`
`$workedTime: String`
`$status: RecentPaymentStatus`
`$staffId: UUID`
`$applicationId: UUID`
`$invoiceId: UUID` | `recentPayment_update` | +| `deleteRecentPayment` | Delete recent payment | `$id: UUID!` | `recentPayment_delete` | ---- -## Reports -*Provides source data queries for client-side reports.* +## 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]` | +|------|---------|------------|---------| +| `listShiftsForCoverage` | List shifts for coverage | `$businessId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listApplicationsForCoverage` | List applications for coverage | `$shiftIds: [UUID!]!` | `applications` | +| `listShiftsForDailyOpsByBusiness` | List shifts for daily ops by business | `$businessId: UUID!`
`$date: Timestamp!` | `shifts` | +| `listShiftsForDailyOpsByVendor` | List shifts for daily ops by vendor | `$vendorId: UUID!`
`$date: Timestamp!` | `shifts` | +| `listApplicationsForDailyOps` | List applications for daily ops | `$shiftIds: [UUID!]!` | `applications` | +| `listShiftsForForecastByBusiness` | List shifts for forecast by business | `$businessId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listShiftsForForecastByVendor` | List shifts for forecast by vendor | `$vendorId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listShiftsForNoShowRangeByBusiness` | List shifts for no show range by business | `$businessId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listShiftsForNoShowRangeByVendor` | List shifts for no show range by vendor | `$vendorId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listApplicationsForNoShowRange` | List applications for no show range | `$shiftIds: [UUID!]!` | `applications` | +| `listStaffForNoShowReport` | List staff for no show report | `$staffIds: [UUID!]!` | `staffs` | +| `listInvoicesForSpendByBusiness` | List invoices for spend by business | `$businessId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `invoices` | +| `listInvoicesForSpendByVendor` | List invoices for spend by vendor | `$vendorId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `invoices` | +| `listInvoicesForSpendByOrder` | List invoices for spend by order | `$orderId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `invoices` | +| `listTimesheetsForSpend` | List timesheets for spend | `$startTime: Timestamp!`
`$endTime: Timestamp!` | `shiftRoles` | +| `listShiftsForPerformanceByBusiness` | List shifts for performance by business | `$businessId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listShiftsForPerformanceByVendor` | List shifts for performance by vendor | `$vendorId: UUID!`
`$startDate: Timestamp!`
`$endDate: Timestamp!` | `shifts` | +| `listApplicationsForPerformance` | List applications for performance | `$shiftIds: [UUID!]!` | `applications` | +| `listStaffForPerformance` | List staff for performance | `$staffIds: [UUID!]!` | `staffs` | ### 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.* +Notes: Used by Reports. + +## role ### 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]` | +|------|---------|------------|---------| +| `listRoles` | List roles | — | `roles` | +| `getRoleById` | Get role by id | `$id: UUID!` | `role` | +| `listRolesByVendorId` | List roles by vendor id | `$vendorId: UUID!` | `roles` | +| `listRolesByroleCategoryId` | List roles byrole category id | `$roleCategoryId: UUID!` | `roles` | ### 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` | +|------|---------|------------|---------| +| `createRole` | Create role | `$name: String!`
`$costPerHour: Float!`
`$vendorId: UUID!`
`$roleCategoryId: UUID!` | `role_insert` | +| `updateRole` | Update role | `$id: UUID!`
`$name: String`
`$costPerHour: Float`
`$roleCategoryId: UUID!` | `role_update` | +| `deleteRole` | Delete role | `$id: UUID!` | `role_delete` | ---- -## Shift -*Manages individual shifts within an order.* +## roleCategory ### 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]` | +|------|---------|------------|---------| +| `listRoleCategories` | List role categories | — | `roleCategories` | +| `getRoleCategoryById` | Get role category by id | `$id: UUID!` | `roleCategory` | +| `getRoleCategoriesByCategory` | Get role categories by category | `$category: RoleCategoryType!` | `roleCategories` | ### 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` | +|------|---------|------------|---------| +| `createRoleCategory` | Create role category | `$roleName: String!`
`$category: RoleCategoryType!` | `roleCategory_insert` | +| `updateRoleCategory` | Update role category | `$id: UUID!`
`$roleName: String`
`$category: RoleCategoryType` | `roleCategory_update` | +| `deleteRoleCategory` | Delete role category | `$id: UUID!` | `roleCategory_delete` | ---- -## ShiftRole -*Junction table for roles needed in a shift.* +## 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]` | +|------|---------|------------|---------| +| `listShifts` | List shifts | `$offset: Int`
`$limit: Int` | `shifts` | +| `getShiftById` | Get shift by id | `$id: UUID!` | `shift` | +| `filterShifts` | Filter shifts | `$status: ShiftStatus`
`$orderId: UUID`
`$dateFrom: Timestamp`
`$dateTo: Timestamp`
`$offset: Int`
`$limit: Int` | `shifts` | +| `getShiftsByBusinessId` | Get shifts by business id | `$businessId: UUID!`
`$dateFrom: Timestamp`
`$dateTo: Timestamp`
`$offset: Int`
`$limit: Int` | `shifts` | +| `getShiftsByVendorId` | Get shifts by vendor id | `$vendorId: UUID!`
`$dateFrom: Timestamp`
`$dateTo: Timestamp`
`$offset: Int`
`$limit: Int` | `shifts` | ### 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` | +|------|---------|------------|---------| +| `createShift` | Create shift | `$title: String!`
`$orderId: UUID!`
`$date: Timestamp`
`$startTime: Timestamp`
`$endTime: Timestamp`
`$hours: Float`
`$cost: Float`
`$location: String`
`$locationAddress: String`
`$latitude: Float`
`$longitude: Float`
`$placeId: String`
`$city: String`
`$state: String`
`$street: String`
`$country: String`
`$description: String`
`$status: ShiftStatus`
`$workersNeeded: Int`
`$filled: Int`
`$filledAt: Timestamp`
`$managers: [Any!]`
`$durationDays: Int`
`$createdBy: String` | `shift_insert` | +| `updateShift` | Update shift | `$id: UUID!`
`$title: String`
`$orderId: UUID`
`$date: Timestamp`
`$startTime: Timestamp`
`$endTime: Timestamp`
`$hours: Float`
`$cost: Float`
`$location: String`
`$locationAddress: String`
`$latitude: Float`
`$longitude: Float`
`$placeId: String`
`$city: String`
`$state: String`
`$street: String`
`$country: String`
`$description: String`
`$status: ShiftStatus`
`$workersNeeded: Int`
`$filled: Int`
`$filledAt: Timestamp`
`$managers: [Any!]`
`$durationDays: Int` | `shift_update` | +| `deleteShift` | Delete shift | `$id: UUID!` | `shift_delete` | ---- -## Staff -*Manages staff profiles.* +## shiftRole ### 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]` | +|------|---------|------------|---------| +| `getShiftRoleById` | Get shift role by id | `$shiftId: UUID!`
`$roleId: UUID!` | `shiftRole` | +| `listShiftRolesByShiftId` | List shift roles by shift id | `$shiftId: UUID!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `listShiftRolesByRoleId` | List shift roles by role id | `$roleId: UUID!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `listShiftRolesByShiftIdAndTimeRange` | List shift roles by shift id and time range | `$shiftId: UUID!`
`$start: Timestamp!`
`$end: Timestamp!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `listShiftRolesByVendorId` | List shift roles by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `listShiftRolesByBusinessAndDateRange` | List shift roles by business and date range | `$businessId: UUID!`
`$start: Timestamp!`
`$end: Timestamp!`
`$offset: Int`
`$limit: Int`
`$status: ShiftStatus` | `shiftRoles` | +| `listShiftRolesByBusinessAndOrder` | List shift roles by business and order | `$businessId: UUID!`
`$orderId: UUID!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `listShiftRolesByBusinessDateRangeCompletedOrders` | List shift roles by business date range completed orders | `$businessId: UUID!`
`$start: Timestamp!`
`$end: Timestamp!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `listShiftRolesByBusinessAndDatesSummary` | List shift roles by business and dates summary | `$businessId: UUID!`
`$start: Timestamp!`
`$end: Timestamp!`
`$offset: Int`
`$limit: Int` | `shiftRoles` | +| `getCompletedShiftsByBusinessId` | Get completed shifts by business id | `$businessId: UUID!`
`$dateFrom: Timestamp!`
`$dateTo: Timestamp!`
`$offset: Int`
`$limit: Int` | `shifts` | ### 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` | +|------|---------|------------|---------| +| `createShiftRole` | Create shift role | `$shiftId: UUID!`
`$roleId: UUID!`
`$count: Int!`
`$assigned: Int`
`$startTime: Timestamp`
`$endTime: Timestamp`
`$hours: Float`
`$department: String`
`$uniform: String`
`$breakType: BreakDuration`
`$isBreakPaid: Boolean`
`$totalValue: Float` | `shiftRole_insert` | +| `updateShiftRole` | Update shift role | `$shiftId: UUID!`
`$roleId: UUID!`
`$count: Int`
`$assigned: Int`
`$startTime: Timestamp`
`$endTime: Timestamp`
`$hours: Float`
`$department: String`
`$uniform: String`
`$breakType: BreakDuration`
`$isBreakPaid: Boolean`
`$totalValue: Float` | `shiftRole_update` | +| `deleteShiftRole` | Delete shift role | `$shiftId: UUID!`
`$roleId: UUID!` | `shiftRole_delete` | ---- -## StaffAvailability -*Manages staff availability schedules.* +## staff ### 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]` | +|------|---------|------------|---------| +| `listStaff` | List staff | — | `staffs` | +| `getStaffById` | Get staff by id | `$id: UUID!` | `staff` | +| `getStaffByUserId` | Get staff by user id | `$userId: String!` | `staffs` | +| `filterStaff` | Filter staff | `$ownerId: UUID`
`$fullName: String`
`$level: String`
`$email: String` | `staffs` | ### 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` | +|------|---------|------------|---------| +| `CreateStaff` | Create staff | `$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: [String!]`
`$industries: [String!]`
`$preferredLocations: [String!]`
`$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`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String` | `staff_insert` | +| `UpdateStaff` | Update staff | `$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: [String!]`
`$industries: [String!]`
`$preferredLocations: [String!]`
`$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`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String` | `staff_update` | +| `DeleteStaff` | Delete staff | `$id: UUID!` | `staff_delete` | ---- -## StaffAvailabilityStats -*Manages staff availability statistics.* +## staffAvailability ### 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]` | +|------|---------|------------|---------| +| `listStaffAvailabilities` | List staff availabilities | `$offset: Int`
`$limit: Int` | `staffAvailabilities` | +| `listStaffAvailabilitiesByStaffId` | List staff availabilities by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `staffAvailabilities` | +| `getStaffAvailabilityByKey` | Get staff availability by key | `$staffId: UUID!`
`$day: DayOfWeek!`
`$slot: AvailabilitySlot!` | `staffAvailability` | +| `listStaffAvailabilitiesByDay` | List staff availabilities by day | `$day: DayOfWeek!`
`$offset: Int`
`$limit: Int` | `staffAvailabilities` | ### 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` | +|------|---------|------------|---------| +| `createStaffAvailability` | Create staff availability | `$staffId: UUID!`
`$day: DayOfWeek!`
`$slot: AvailabilitySlot!`
`$status: AvailabilityStatus`
`$notes: String` | `staffAvailability_insert` | +| `updateStaffAvailability` | Update staff availability | `$staffId: UUID!`
`$day: DayOfWeek!`
`$slot: AvailabilitySlot!`
`$status: AvailabilityStatus`
`$notes: String` | `staffAvailability_update` | +| `deleteStaffAvailability` | Delete staff availability | `$staffId: UUID!`
`$day: DayOfWeek!`
`$slot: AvailabilitySlot!` | `staffAvailability_delete` | ---- -## StaffCourse -*Tracks staff progress in courses.* +## staffAvailabilityStats ### 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]` | +|------|---------|------------|---------| +| `listStaffAvailabilityStats` | List staff availability stats | `$offset: Int`
`$limit: Int` | `staffAvailabilityStatss` | +| `getStaffAvailabilityStatsByStaffId` | Get staff availability stats by staff id | `$staffId: UUID!` | `staffAvailabilityStats` | +| `filterStaffAvailabilityStats` | Filter staff availability stats | `$needWorkIndexMin: Int`
`$needWorkIndexMax: Int`
`$utilizationMin: Int`
`$utilizationMax: Int`
`$acceptanceRateMin: Int`
`$acceptanceRateMax: Int`
`$lastShiftAfter: Timestamp`
`$lastShiftBefore: Timestamp`
`$offset: Int`
`$limit: Int` | `staffAvailabilityStatss` | ### 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` | +|------|---------|------------|---------| +| `createStaffAvailabilityStats` | Create staff availability stats | `$staffId: UUID!`
`$needWorkIndex: Int`
`$utilizationPercentage: Int`
`$predictedAvailabilityScore: Int`
`$scheduledHoursThisPeriod: Int`
`$desiredHoursThisPeriod: Int`
`$lastShiftDate: Timestamp`
`$acceptanceRate: Int` | `staffAvailabilityStats_insert` | +| `updateStaffAvailabilityStats` | Update staff availability stats | `$staffId: UUID!`
`$needWorkIndex: Int`
`$utilizationPercentage: Int`
`$predictedAvailabilityScore: Int`
`$scheduledHoursThisPeriod: Int`
`$desiredHoursThisPeriod: Int`
`$lastShiftDate: Timestamp`
`$acceptanceRate: Int` | `staffAvailabilityStats_update` | +| `deleteStaffAvailabilityStats` | Delete staff availability stats | `$staffId: UUID!` | `staffAvailabilityStats_delete` | ---- -## StaffDocument -*Manages documents submitted by staff.* +## staffCourse ### 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]` | +|------|---------|------------|---------| +| `getStaffCourseById` | Get staff course by id | `$id: UUID!` | `staffCourse` | +| `listStaffCoursesByStaffId` | List staff courses by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `staffCourses` | +| `listStaffCoursesByCourseId` | List staff courses by course id | `$courseId: UUID!`
`$offset: Int`
`$limit: Int` | `staffCourses` | +| `getStaffCourseByStaffAndCourse` | Get staff course by staff and course | `$staffId: UUID!`
`$courseId: UUID!` | `staffCourses` | ### 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` | +|------|---------|------------|---------| +| `createStaffCourse` | Create staff course | `$staffId: UUID!`
`$courseId: UUID!`
`$progressPercent: Int`
`$completed: Boolean`
`$completedAt: Timestamp`
`$startedAt: Timestamp`
`$lastAccessedAt: Timestamp` | `staffCourse_insert` | +| `updateStaffCourse` | Update staff course | `$id: UUID!`
`$progressPercent: Int`
`$completed: Boolean`
`$completedAt: Timestamp`
`$startedAt: Timestamp`
`$lastAccessedAt: Timestamp` | `staffCourse_update` | +| `deleteStaffCourse` | Delete staff course | `$id: UUID!` | `staffCourse_delete` | ---- -## StaffRole -*Junction table linking Staff to Roles.* +## staffDocument ### 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]` | +|------|---------|------------|---------| +| `getStaffDocumentByKey` | Get staff document by key | `$staffId: UUID!`
`$documentId: UUID!` | `staffDocument` | +| `listStaffDocumentsByStaffId` | List staff documents by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `staffDocuments` | +| `listStaffDocumentsByDocumentType` | List staff documents by document type | `$documentType: DocumentType!`
`$offset: Int`
`$limit: Int` | `staffDocuments` | +| `listStaffDocumentsByStatus` | List staff documents by status | `$status: DocumentStatus!`
`$offset: Int`
`$limit: Int` | `staffDocuments` | ### 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` | +|------|---------|------------|---------| +| `createStaffDocument` | Create staff document | `$staffId: UUID!`
`$staffName: String!`
`$documentId: UUID!`
`$status: DocumentStatus!`
`$documentUrl: String`
`$expiryDate: Timestamp` | `staffDocument_insert` | +| `updateStaffDocument` | Update staff document | `$staffId: UUID!`
`$documentId: UUID!`
`$status: DocumentStatus`
`$documentUrl: String`
`$expiryDate: Timestamp` | `staffDocument_update` | +| `deleteStaffDocument` | Delete staff document | `$staffId: UUID!`
`$documentId: UUID!` | `staffDocument_delete` | ---- -## Task -*Manages tasks.* +## staffRole ### 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]` | +|------|---------|------------|---------| +| `listStaffRoles` | List staff roles | `$offset: Int`
`$limit: Int` | `staffRoles` | +| `getStaffRoleByKey` | Get staff role by key | `$staffId: UUID!`
`$roleId: UUID!` | `staffRole` | +| `listStaffRolesByStaffId` | List staff roles by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `staffRoles` | +| `listStaffRolesByRoleId` | List staff roles by role id | `$roleId: UUID!`
`$offset: Int`
`$limit: Int` | `staffRoles` | +| `filterStaffRoles` | Filter staff roles | `$staffId: UUID`
`$roleId: UUID`
`$offset: Int`
`$limit: Int` | `staffRoles` | ### 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` | +|------|---------|------------|---------| +| `createStaffRole` | Create staff role | `$staffId: UUID!`
`$roleId: UUID!`
`$roleType: RoleType` | `staffRole_insert` | +| `deleteStaffRole` | Delete staff role | `$staffId: UUID!`
`$roleId: UUID!` | `staffRole_delete` | ---- -## TaskComment -*Manages comments on tasks.* +## task ### 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]` | +|------|---------|------------|---------| +| `listTasks` | List tasks | — | `tasks` | +| `getTaskById` | Get task by id | `$id: UUID!` | `task` | +| `getTasksByOwnerId` | Get tasks by owner id | `$ownerId: UUID!` | `tasks` | +| `filterTasks` | Filter tasks | `$status: TaskStatus`
`$priority: TaskPriority` | `tasks` | ### 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` | +|------|---------|------------|---------| +| `createTask` | Create task | `$taskName: String!`
`$description: String`
`$priority: TaskPriority!`
`$status: TaskStatus!`
`$dueDate: Timestamp`
`$progress: Int`
`$orderIndex: Int`
`$commentCount: Int`
`$attachmentCount: Int`
`$files: Any`
`$ownerId:UUID!` | `task_insert` | +| `updateTask` | Update task | `$id: UUID!`
`$taskName: String`
`$description: String`
`$priority: TaskPriority`
`$status: TaskStatus`
`$dueDate: Timestamp`
`$progress: Int`
`$assignedMembers: Any`
`$orderIndex: Int`
`$commentCount: Int`
`$attachmentCount: Int`
`$files: Any` | `task_update` | +| `deleteTask` | Delete task | `$id: UUID!` | `task_delete` | ---- -## TaxForm -*Manages staff tax forms.* +## task_comment ### 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]` | +|------|---------|------------|---------| +| `listTaskComments` | List task comments | — | `taskComments` | +| `getTaskCommentById` | Get task comment by id | `$id: UUID!` | `taskComment` | +| `getTaskCommentsByTaskId` | Get task comments by task id | `$taskId: UUID!` | `taskComments` | ### 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` | +|------|---------|------------|---------| +| `createTaskComment` | Create task comment | `$taskId: UUID!`
`$teamMemberId: UUID!`
`$comment: String!`
`$isSystem: Boolean` | `taskComment_insert` | +| `updateTaskComment` | Update task comment | `$id: UUID!`
`$comment: String`
`$isSystem: Boolean` | `taskComment_update` | +| `deleteTaskComment` | Delete task comment | `$id: UUID!` | `taskComment_delete` | ---- -## Team -*Manages teams.* +## taxForm ### 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]` | +|------|---------|------------|---------| +| `listTaxForms` | List tax forms | `$offset: Int`
`$limit: Int` | `taxForms` | +| `getTaxFormById` | Get tax form by id | `$id: UUID!` | `taxForm` | +| `getTaxFormsByStaffId` | Get tax forms by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `taxForms` | +| `listTaxFormsWhere` | List tax forms where | `$formType: TaxFormType`
`$status: TaxFormStatus`
`$staffId: UUID`
`$offset: Int`
`$limit: Int` | `taxForms` | ### 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` | +|------|---------|------------|---------| +| `createTaxForm` | Create tax form | `$formType: TaxFormType!`
`$firstName: String!`
`$lastName: String!`
`$mInitial: String`
`$oLastName: String`
`$dob: Timestamp`
`$socialSN: Int!`
`$email: String`
`$phone: String`
`$address: String!`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$city: String`
`$apt: String`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String`
`$marital: MaritalStatus`
`$multipleJob: Boolean`
`$childrens: Int`
`$otherDeps: Int`
`$totalCredits: Float`
`$otherInconme: Float`
`$deductions: Float`
`$extraWithholding: Float`
`$citizen: CitizenshipStatus`
`$uscis: String`
`$passportNumber: String`
`$countryIssue: String`
`$prepartorOrTranslator: Boolean`
`$signature: String`
`$date: Timestamp`
`$status: TaxFormStatus!`
`$staffId: UUID!`
`$createdBy: String` | `taxForm_insert` | +| `updateTaxForm` | Update tax form | `$id: UUID!`
`$formType: TaxFormType`
`$firstName: String`
`$lastName: String`
`$mInitial: String`
`$oLastName: String`
`$dob: Timestamp`
`$socialSN: Int`
`$email: String`
`$phone: String`
`$address: String`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$city: String`
`$apt: String`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String`
`$marital: MaritalStatus`
`$multipleJob: Boolean`
`$childrens: Int`
`$otherDeps: Int`
`$totalCredits: Float`
`$otherInconme: Float`
`$deductions: Float`
`$extraWithholding: Float`
`$citizen: CitizenshipStatus`
`$uscis: String`
`$passportNumber: String`
`$countryIssue: String`
`$prepartorOrTranslator: Boolean`
`$signature: String`
`$date: Timestamp`
`$status: TaxFormStatus` | `taxForm_update` | +| `deleteTaxForm` | Delete tax form | `$id: UUID!` | `taxForm_delete` | ---- -## TeamHub -*Manages hubs within a team.* +## 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]` | +|------|---------|------------|---------| +| `listTeams` | List teams | — | `teams` | +| `getTeamById` | Get team by id | `$id: UUID!` | `team` | +| `getTeamsByOwnerId` | Get teams by owner id | `$ownerId: UUID!` | `teams` | ### 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` | +|------|---------|------------|---------| +| `createTeam` | Create team | `$teamName: String!`
`$ownerId: UUID!`
`$ownerName: String!`
`$ownerRole: String!`
`$email: String`
`$companyLogo: String`
`$totalMembers: Int`
`$activeMembers: Int`
`$totalHubs: Int`
`$departments: Any`
`$favoriteStaffCount: Int`
`$blockedStaffCount: Int`
`$favoriteStaff: Any`
`$blockedStaff: Any` | `team_insert` | +| `updateTeam` | Update team | `$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` | `team_update` | +| `deleteTeam` | Delete team | `$id: UUID!` | `team_delete` | ---- -## TeamHudDeparment -*Manages departments within a Team Hub.* +## teamHub ### 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]` | +|------|---------|------------|---------| +| `listTeamHubs` | List team hubs | `$offset: Int`
`$limit: Int` | `teamHubs` | +| `getTeamHubById` | Get team hub by id | `$id: UUID!` | `teamHub` | +| `getTeamHubsByTeamId` | Get team hubs by team id | `$teamId: UUID!`
`$offset: Int`
`$limit: Int` | `teamHubs` | +| `listTeamHubsByOwnerId` | List team hubs by owner id | `$ownerId: UUID!`
`$offset: Int`
`$limit: Int` | `teamHubs` | ### 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` | +|------|---------|------------|---------| +| `createTeamHub` | Create team hub | `$teamId: UUID!`
`$hubName: String!`
`$address: String!`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$city: String`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String`
`$managerName: String`
`$isActive: Boolean`
`$departments: Any` | `teamHub_insert` | +| `updateTeamHub` | Update team hub | `$id: UUID!`
`$teamId: UUID`
`$hubName: String`
`$address: String`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$city: String`
`$state: String`
`$street: String`
`$country: String`
`$zipCode: String`
`$managerName: String`
`$isActive: Boolean`
`$departments: Any` | `teamHub_update` | +| `deleteTeamHub` | Delete team hub | `$id: UUID!` | `teamHub_delete` | ---- -## TeamMember -*Manages members of a team.* +## teamHudDeparment ### 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]` | +|------|---------|------------|---------| +| `listTeamHudDepartments` | List team hud departments | `$offset: Int`
`$limit: Int` | `teamHudDepartments` | +| `getTeamHudDepartmentById` | Get team hud department by id | `$id: UUID!` | `teamHudDepartment` | +| `listTeamHudDepartmentsByTeamHubId` | List team hud departments by team hub id | `$teamHubId: UUID!`
`$offset: Int`
`$limit: Int` | `teamHudDepartments` | ### 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` | +|------|---------|------------|---------| +| `createTeamHudDepartment` | Create team hud department | `$name: String!`
`$costCenter: String`
`$teamHubId: UUID!` | `teamHudDepartment_insert` | +| `updateTeamHudDepartment` | Update team hud department | `$id: UUID!`
`$name: String`
`$costCenter: String`
`$teamHubId: UUID` | `teamHudDepartment_update` | +| `deleteTeamHudDepartment` | Delete team hud department | `$id: UUID!` | `teamHudDepartment_delete` | ---- -## User -*Manages system users.* +## teamMember ### 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]` | +|------|---------|------------|---------| +| `listTeamMembers` | List team members | — | `teamMembers` | +| `getTeamMemberById` | Get team member by id | `$id: UUID!` | `teamMember` | +| `getTeamMembersByTeamId` | Get team members by team id | `$teamId: UUID!` | `teamMembers` | ### 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` | +|------|---------|------------|---------| +| `createTeamMember` | Create team member | `$teamId: UUID!`
`$role: TeamMemberRole!`
`$title: String`
`$department: String`
`$teamHubId: UUID`
`$isActive: Boolean`
`$userId: String!`
`$inviteStatus: TeamMemberInviteStatus` | `teamMember_insert` | +| `updateTeamMember` | Update team member | `$id: UUID!`
`$role: TeamMemberRole`
`$title: String`
`$department: String`
`$teamHubId: UUID`
`$isActive: Boolean`
`$inviteStatus: TeamMemberInviteStatus` | `teamMember_update` | +| `updateTeamMemberInviteStatus` | Update team member invite status | `$id: UUID!`
`$inviteStatus: TeamMemberInviteStatus!` | `teamMember_update` | +| `acceptInviteByCode` | Accept invite by code | `$inviteCode: UUID!` | `teamMember_updateMany` | +| `cancelInviteByCode` | Cancel invite by code | `$inviteCode: UUID!` | `teamMember_updateMany` | +| `deleteTeamMember` | Delete team member | `$id: UUID!` | `teamMember_delete` | ---- -## UserConversation -*Manages user-specific state for conversations.* +## user ### 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]` | +|------|---------|------------|---------| +| `listUsers` | List users | — | `users` | +| `getUserById` | Get user by id | `$id: String!` | `user` | +| `filterUsers` | Filter users | `$id: String`
`$email: String`
`$role: UserBaseRole`
`$userRole: String` | `users` | ### 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` | +|------|---------|------------|---------| +| `CreateUser` | Create user | `$id: String!`
`$email: String`
`$fullName: String`
`$role: UserBaseRole!`
`$userRole: String`
`$photoUrl: String` | `user_insert` | +| `UpdateUser` | Update user | `$id: String!`
`$email: String`
`$fullName: String`
`$role: UserBaseRole`
`$userRole: String`
`$photoUrl: String` | `user_update` | +| `DeleteUser` | Delete user | `$id: String!` | `user_delete` | ---- -## Vendor -*Manages vendor/partner entities.* +## userConversation ### 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]` | +|------|---------|------------|---------| +| `listUserConversations` | List user conversations | `$offset: Int`
`$limit: Int` | `userConversations` | +| `getUserConversationByKey` | Get user conversation by key | `$conversationId: UUID!`
`$userId: String!` | `userConversation` | +| `listUserConversationsByUserId` | List user conversations by user id | `$userId: String!`
`$offset: Int`
`$limit: Int` | `userConversations` | +| `listUnreadUserConversationsByUserId` | List unread user conversations by user id | `$userId: String!`
`$offset: Int`
`$limit: Int` | `userConversations` | +| `listUserConversationsByConversationId` | List user conversations by conversation id | `$conversationId: UUID!`
`$offset: Int`
`$limit: Int` | `userConversations` | +| `filterUserConversations` | Filter user conversations | `$userId: String`
`$conversationId: UUID`
`$unreadMin: Int`
`$unreadMax: Int`
`$lastReadAfter: Timestamp`
`$lastReadBefore: Timestamp`
`$offset: Int`
`$limit: Int` | `userConversations` | ### 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` | +|------|---------|------------|---------| +| `createUserConversation` | Create user conversation | `$conversationId: UUID!`
`$userId: String!`
`$unreadCount: Int`
`$lastReadAt: Timestamp` | `userConversation_insert` | +| `updateUserConversation` | Update user conversation | `$conversationId: UUID!`
`$userId: String!`
`$unreadCount: Int`
`$lastReadAt: Timestamp` | `userConversation_update` | +| `markConversationAsRead` | Mark conversation as read | `$conversationId: UUID!`
`$userId: String!`
`$lastReadAt: Timestamp` | `userConversation_update` | +| `incrementUnreadForUser` | Increment unread for user | `$conversationId: UUID!`
`$userId: String!`
`$unreadCount: Int!` | `userConversation_update` | +| `deleteUserConversation` | Delete user conversation | `$conversationId: UUID!`
`$userId: String!` | `userConversation_delete` | ---- -## VendorBenefitPlan -*Manages benefit plans offered by vendors.* +## vendor ### 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]` | +|------|---------|------------|---------| +| `getVendorById` | Get vendor by id | `$id: UUID!` | `vendor` | +| `getVendorByUserId` | Get vendor by user id | `$userId: String!` | `vendors` | +| `listVendors` | List vendors | — | `vendors` | ### 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` | +|------|---------|------------|---------| +| `createVendor` | Create vendor | `$userId: String!`
`$companyName: String!`
`$email: String`
`$phone: String`
`$photoUrl: String`
`$address: String`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$street: String`
`$country: String`
`$zipCode: 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` | `vendor_insert` | +| `updateVendor` | Update vendor | `$id: UUID!`
`$companyName: String`
`$email: String`
`$phone: String`
`$photoUrl: String`
`$address: String`
`$placeId: String`
`$latitude: Float`
`$longitude: Float`
`$street: String`
`$country: String`
`$zipCode: 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` | `vendor_update` | +| `deleteVendor` | Delete vendor | `$id: UUID!` | `vendor_delete` | ---- -## VendorRate -*Manages vendor rates.* +## vendorBenefitPlan ### Queries | Name | Purpose | Parameters | Returns | -|---|---|---|---| -| `listVendorRates` | Retrieves all vendor rates. | - | `[VendorRate]` | -| `getVendorRateById` | Fetches a single vendor rate by ID. | `id: UUID!` | `VendorRate` | +|------|---------|------------|---------| +| `listVendorBenefitPlans` | List vendor benefit plans | `$offset: Int`
`$limit: Int` | `vendorBenefitPlans` | +| `getVendorBenefitPlanById` | Get vendor benefit plan by id | `$id: UUID!` | `vendorBenefitPlan` | +| `listVendorBenefitPlansByVendorId` | List vendor benefit plans by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `vendorBenefitPlans` | +| `listActiveVendorBenefitPlansByVendorId` | List active vendor benefit plans by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `vendorBenefitPlans` | +| `filterVendorBenefitPlans` | Filter vendor benefit plans | `$vendorId: UUID`
`$title: String`
`$isActive: Boolean`
`$offset: Int`
`$limit: Int` | `vendorBenefitPlans` | ### 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` | +|------|---------|------------|---------| +| `createVendorBenefitPlan` | Create vendor benefit plan | `$vendorId: UUID!`
`$title: String!`
`$description: String`
`$requestLabel: String`
`$total: Int`
`$isActive: Boolean`
`$createdBy: String` | `vendorBenefitPlan_insert` | +| `updateVendorBenefitPlan` | Update vendor benefit plan | `$id: UUID!`
`$vendorId: UUID`
`$title: String`
`$description: String`
`$requestLabel: String`
`$total: Int`
`$isActive: Boolean`
`$createdBy: String` | `vendorBenefitPlan_update` | +| `deleteVendorBenefitPlan` | Delete vendor benefit plan | `$id: UUID!` | `vendorBenefitPlan_delete` | ---- -## WorkForce -*Manages the workforce, linking staff to vendors.* +## vendorRate ### 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]` | +|------|---------|------------|---------| +| `listVendorRates` | List vendor rates | — | `vendorRates` | +| `getVendorRateById` | Get vendor rate by id | `$id: UUID!` | `vendorRate` | ### 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` | +|------|---------|------------|---------| +| `createVendorRate` | Create vendor rate | `$vendorId: UUID!`
`$roleName: String`
`$category: CategoryType`
`$clientRate: Float`
`$employeeWage: Float`
`$markupPercentage: Float`
`$vendorFeePercentage: Float`
`$isActive: Boolean`
`$notes: String` | `vendorRate_insert` | +| `updateVendorRate` | Update vendor rate | `$id: UUID!`
`$vendorId: UUID`
`$roleName: String`
`$category: CategoryType`
`$clientRate: Float`
`$employeeWage: Float`
`$markupPercentage: Float`
`$vendorFeePercentage: Float`
`$isActive: Boolean`
`$notes: String` | `vendorRate_update` | +| `deleteVendorRate` | Delete vendor rate | `$id: UUID!` | `vendorRate_delete` | + +## workForce + +### Queries +| Name | Purpose | Parameters | Returns | +|------|---------|------------|---------| +| `getWorkforceById` | Get workforce by id | `$id: UUID!` | `workforce` | +| `getWorkforceByVendorAndStaff` | Get workforce by vendor and staff | `$vendorId: UUID!`
`$staffId: UUID!` | `workforces` | +| `listWorkforceByVendorId` | List workforce by vendor id | `$vendorId: UUID!`
`$offset: Int`
`$limit: Int` | `workforces` | +| `listWorkforceByStaffId` | List workforce by staff id | `$staffId: UUID!`
`$offset: Int`
`$limit: Int` | `workforces` | +| `getWorkforceByVendorAndNumber` | Get workforce by vendor and number | `$vendorId: UUID!`
`$workforceNumber: String!` | `workforces` | + +### Mutations +| Name | Purpose | Parameters | Affects | +|------|---------|------------|---------| +| `createWorkforce` | Create workforce | `$vendorId: UUID!`
`$staffId: UUID!`
`$workforceNumber: String!`
`$employmentType: WorkforceEmploymentType` | `workforce_insert` | +| `updateWorkforce` | Update workforce | `$id: UUID!`
`$workforceNumber: String`
`$employmentType: WorkforceEmploymentType`
`$status: WorkforceStatus` | `workforce_update` | +| `deactivateWorkforce` | Deactivate workforce | `$id: UUID!` | `workforce_update` |