diff --git a/apps/mobile/analysis_options.yaml b/apps/mobile/analysis_options.yaml index cec4e925..2b4df59c 100644 --- a/apps/mobile/analysis_options.yaml +++ b/apps/mobile/analysis_options.yaml @@ -6,6 +6,7 @@ analyzer: - "**/*.g.dart" - "**/*.freezed.dart" - "**/*.config.dart" + - "apps/mobile/prototypes/**" errors: # Set the severity of the always_specify_types rule to warning as requested. always_specify_types: warning diff --git a/apps/mobile/apps/client/android/app/build.gradle.kts b/apps/mobile/apps/client/android/app/build.gradle.kts index 202bc20b..593af2c7 100644 --- a/apps/mobile/apps/client/android/app/build.gradle.kts +++ b/apps/mobile/apps/client/android/app/build.gradle.kts @@ -1,3 +1,5 @@ +import java.util.Base64 + plugins { id("com.android.application") id("kotlin-android") @@ -6,6 +8,18 @@ plugins { id("com.google.gms.google-services") } +val dartDefinesString = project.findProperty("dart-defines") as? String ?: "" +val dartEnvironmentVariables = mutableMapOf() +dartDefinesString.split(",").forEach { + if (it.isNotEmpty()) { + val decoded = String(Base64.getDecoder().decode(it)) + val components = decoded.split("=") + if (components.size == 2) { + dartEnvironmentVariables[components[0]] = components[1] + } + } +} + android { namespace = "com.krowwithus.client" compileSdk = flutter.compileSdkVersion @@ -29,6 +43,8 @@ android { targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName + + manifestPlaceholders["GOOGLE_MAPS_API_KEY"] = dartEnvironmentVariables["GOOGLE_MAPS_API_KEY"] ?: "" } buildTypes { diff --git a/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml b/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml index 5bf8f125..da643f20 100644 --- a/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml +++ b/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml @@ -30,6 +30,9 @@ + 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` | diff --git a/docs/MILESTONES/M4/planning/m4-planning.md b/docs/MILESTONES/M4/planning/m4-planning.md index 91c54af7..596f8992 100644 --- a/docs/MILESTONES/M4/planning/m4-planning.md +++ b/docs/MILESTONES/M4/planning/m4-planning.md @@ -1,417 +1,648 @@ -# **M4 Milestone Planning** - -## **BE** - -### Validate shift acceptance by a worker - -- **Goal**: Prevent workers from accepting shifts they are not eligible to accept. -- **Where**: Backend validation (server-side). -- **Key rules (M4)** - - Prevent accepting overlapping shifts. - - If a shift is already accepted in that time window, reject the accept action. -- **Design requirement** - - Make the algorithm scalable so future shift-acceptance rules can be added without rewriting core logic. -- **Acceptance criteria** - - Backend rejects overlapping acceptance with a clear error reason. - - Validation is enforced even if the client app is bypassed. - -### Validate shift creation by a client - -- **Goal**: Ensure shifts/orders created by clients meet required criteria. -- **Where**: Backend validation (server-side). -- **Key rules (M4)** - - Add a *soft check* for minimum shift hours when creating an order. - - When a client creates an order, check if shift hours are below the vendor minimum. - - Current minimum hours: **5 hours**. -- **FE dependency** - - Also add a FE validation (user feedback) in addition to BE enforcement. -- **Design requirement** - - Make the algorithm scalable so future creation rules can be added. -- **Acceptance criteria** - - Backend returns a consistent validation response when the minimum-hours check fails. - - FE shows a clear validation message before submission (soft check). - -### Enforce cancellation policy (no cancellations within 24 hours) - -- **Goal**: Prevent cancellations within 24 hours of shift start time. -- **Where**: Backend enforcement. -- **Open decision** - - Finalize the penalty for cancellations within this window. -- **Acceptance criteria** - - Backend blocks cancellation attempts inside the 24-hour window. - - API response communicates the policy reason and references the penalty (once finalized). - -### Implement worker documentation upload process - -- **Goal**: Allow workers to upload required documents (e.g., certifications, tax forms) securely. -- **Where**: Backend (storage + linking). -- **Scope** - - Upload flow. - - Store documents. - - Link documents to the worker profile. -- **Acceptance criteria** - - Uploaded documents are stored securely and retrievable by authorized parties. - - Each upload is reliably associated with the correct worker profile. - -### Parse uploaded documentation for verification - -- **Goal**: Extract relevant info from uploaded documents to assist verification. -- **Where**: Backend. -- **Policy requirement** - - Manual verification by the client must still exist even if AI verification passes. -- **Acceptance criteria** - - Parsed fields are stored in a structured format for review. - - Client can manually verify/override AI results. - -### Support attire upload for workers - -- **Goal**: Allow workers to upload attire images for verification. -- **Where**: Backend. -- **Acceptance criteria** - - Attire images can be uploaded and linked to the worker profile. - -### Verify attire images against shift dress code - -- **Goal**: Verify uploaded attire meets dress code requirements. -- **Where**: Backend. -- **Policy requirement** - - Manual verification by the client must still exist even if AI verification passes. -- **Acceptance criteria** - - Verification results are stored and visible to the client for manual review. - -### Support shifts requiring "awaiting confirmation" status - -- **Goal**: Support shifts where the worker must manually confirm before the shift becomes active. -- **Where**: Backend. -- **Acceptance criteria** - - Shift can enter an "awaiting confirmation" state. - - Worker confirmation transitions the shift to the next expected active state. - -### Enable NFC-based clock-in and clock-out - -- **Goal**: Allow attendance via NFC. -- **Where**: Backend tasks (APIs/events/storage to support NFC clock-in/out). -- **Acceptance criteria** - - Backend can record NFC clock-in/out events with appropriate validation and auditing. - -### Implement worker profile visibility settings - -- **Goal**: Allow workers to hide their profile from clients if they choose. -- **Where**: Backend tasks (visibility settings + enforcement). -- **Acceptance criteria** - - Worker can change visibility setting. - - Backend enforces visibility in client-facing queries. - -### Support rapid order parsing (voice and text) using AI - -- **Goal**: Let clients create orders by describing needs in voice/text. -- **Where**: Backend tasks (parsing + mapping). -- **Notes** - - Always map the output similar to **one-time order creation**. -- **Acceptance criteria** - - Backend returns a structured draft order that matches the one-time order model. - -### Personalize shifts shown to workers (auto match) - -- **Goal**: Show worker-personalized shifts. -- **Where**: Backend matching/filtering logic. -- **Inputs (M4)** - - Preferred locations. - - Experience. -- **Acceptance criteria** - - Worker shift feed is personalized based on these inputs. - -### What backend work is needed to support recurring order and reorder? - -- **Goal**: Enable recurring orders and reorder. -- **Where**: Backend. -- **Acceptance criteria** - - Backend can create and manage recurring orders and support reorder actions. +# M4 Milestone Planning -### What backend work is needed to support permanent order and reorder? +--- -- **Goal**: Enable permanent orders and reorder. -- **Where**: Backend. -- **Acceptance criteria** - - Backend can create and manage permanent orders and support reorder actions. - -### Backend support for reports page (client mobile) - -- **Goal**: Provide APIs/data needed to render the main reports entry and summary experience. -- **Where**: Backend. -- **Acceptance criteria** - - Reports API contracts are defined and documented. - - Client can load the reports page without placeholder data. +## Backend (BE) -### Backend support for "Daily ops" report (client mobile) +### Make Order creation flow a transaction using cloud functions -- **Goal**: Provide the data required for the Daily ops report. -- **Where**: Backend. -- **Acceptance criteria** - - Daily ops report API returns all fields required by the UI. - - Response is documented (including filters/date ranges, if applicable). +**Goal:** Make Order creation flow a transaction using cloud functions -### Backend support for "Spend report" (client mobile) +**Based on:** https://github.com/Oloodi/krow-workforce/issues/420 -- **Goal**: Provide the data required for the Spend report. -- **Where**: Backend. -- **Acceptance criteria** - - Spend report API returns all fields required by the UI. - - Response is documented (including filters/date ranges, if applicable). +--- -### Backend support for "Coverage report" (client mobile) +### Validate Shift Acceptance by a Worker -- **Goal**: Provide the data required for the Coverage report. -- **Where**: Backend. -- **Acceptance criteria** - - Coverage report API returns all fields required by the UI. - - Response is documented (including filters/date ranges, if applicable). +**Goal:** Prevent workers from accepting shifts they are not eligible to accept. -### Backend support for "No-show" report (client mobile) +**Where:** Backend validation (server-side). -- **Goal**: Provide the data required for the No-show report. -- **Where**: Backend. -- **Acceptance criteria** - - No-show report API returns all fields required by the UI. - - Response is documented (including filters/date ranges, if applicable). +#### Key Rules (M4) +- Prevent accepting overlapping shifts. If a shift is already accepted in that time window, reject the accept action. -### Backend support for "Performance report" (client mobile) +#### Design Requirement +Make the algorithm scalable so future shift-acceptance rules can be added without rewriting core logic. -- **Goal**: Provide the data required for the Performance report. -- **Where**: Backend. -- **Acceptance criteria** - - Performance report API returns all fields required by the UI. - - Response is documented (including filters/date ranges, if applicable). +#### Acceptance Criteria +- Backend rejects overlapping acceptance with a clear error reason. +- Validation is enforced even if the client app is bypassed. -### Calculate the 3 AI insights for the client mobile reports page +--- -- **Goal**: Produce the three AI insights shown on the reports page. -- **Where**: Backend. -- **Acceptance criteria** - - Insights are generated consistently and returned in the reports API response. +### Validate Shift Creation by a Client -## **FE** +**Goal:** Ensure shifts/orders created by clients meet required criteria. -### **Staff mobile application** +**Where:** Backend validation (server-side). -### Show Google Maps location in worker shift details +#### Key Rules (M4) +- Add a soft check for minimum shift hours when creating an order. +- When a client creates an order, check if shift hours are below the vendor minimum. +- Current minimum hours: **5 hours**. -- **Goal**: Display shift location on a map. -- **Acceptance criteria** - - Shift details page shows the correct location using Google Maps. +#### FE Dependency +Also add a FE validation (user feedback) in addition to BE enforcement. -### Show shift requirements in worker shift details +#### Design Requirement +Make the algorithm scalable so future creation rules can be added. -- **Goal**: Make requirements visible before acceptance. -- **Acceptance criteria** - - Shift details page includes a requirements section for that shift. -- **Details** - - The main goal is to have list the the required attires in the requirement section but if there are any other requirements we can also list them there. +#### Acceptance Criteria +- Backend returns a consistent validation response when the minimum-hours check fails. +- FE shows a clear validation message before submission (soft check). -### Implement attire screen in worker app +--- -- **Goal**: Let workers understand attire requirements and submit attire for review. -- **Scope (M4)** - - Show the list of **MUST HAVE** attire items. - - Show the list of **NICE TO HAVE** attire items. - - Allow workers to upload images of their attire for verification. - - Show uploaded attire images in the worker profile. -- **Acceptance criteria** - - Attire screen renders required lists and supports image upload flow. - - Uploaded images appear in the worker profile UI. +### Enforce Cancellation Policy (No Cancellations Within 24 Hours) -### Implement FAQ screen in worker app +**Goal:** Prevent cancellations within 24 hours of shift start time. -- **Goal**: Provide common answers in-app. -- **Acceptance criteria** - - Worker app includes an FAQ screen accessible from appropriate navigation. +**Where:** Backend enforcement. -### Implement Privacy and Security screen in worker app +#### Open Decision +Finalize the penalty for cancellations within this window. -- **Goal**: Provide key privacy/security controls and documents. -- **Scope (M4)** - - Profile visibility setting. - - Terms of service (use a generated placeholder for now; replace with final for launch). - - Privacy policy (use a generated placeholder for now; replace with final for launch). -- **Acceptance criteria** - - Screen is accessible and displays all items above. +#### Acceptance Criteria +- Backend blocks cancellation attempts inside the 24-hour window. +- API response communicates the policy reason and references the penalty (once finalized). -### Restrict navigation when worker profile is incomplete +--- -- **Goal**: Reduce access until onboarding/profile completion. -- **Acceptance criteria** - - If the user has not completed their profile, only show **Profile** and **Home**. +### Implement Worker Documentation Upload Process -### **Client mobile application** +**Goal:** Allow workers to upload required documents (e.g., certifications, tax forms) securely. -### Implement rapid order creation (voice + text) in client mobile app +**Where:** Backend (storage + linking). -- **Goal**: Allow clients to quickly create same-day orders by describing needs via voice/text. -- **Scope (M4)** - - Capture voice/text input. - - Send input for parsing. - - Populate a screen equivalent to the one-time order creation screen so the client can adjust before finalizing. - - Always map similar to one-time order creation (handles same-day orders). -- **Acceptance criteria** - - Parsed output populates the one-time order creation UI correctly. - - Client can edit and successfully submit the order. +#### Scope +- Upload flow. +- Store documents. +- Link documents to the worker profile. -### Implement recurring order in client mobile app +#### Acceptance Criteria +- Uploaded documents are stored securely and retrievable by authorized parties. +- Each upload is reliably associated with the correct worker profile. -- **Goal**: Allow clients to create recurring orders. -- **Scope (M4)** - - Create a recurring order UI flow. -- **Acceptance criteria** - - Client can create and submit a recurring order successfully. +--- -### Implement permanent order in client mobile app +### Parse Uploaded Documentation for Verification -- **Goal**: Allow clients to create permanent orders. -- **Scope (M4)** - - Create a permanent order UI flow. -- **Acceptance criteria** - - Client can create and submit a permanent order successfully. +**Goal:** Extract relevant info from uploaded documents to assist verification. -### Update reorder modal to support order types +**Where:** Backend. -- **Goal**: Ensure reorder works across supported order types. -- **Acceptance criteria** - - Reorder modal reflects the correct order type and fields. +#### Policy Requirement +Manual verification by the client must still exist even if AI verification passes. -### Complete reports interface with AI insights (client mobile) +#### Acceptance Criteria +- Parsed fields are stored in a structured format for review. +- Client can manually verify/override AI results. -- **Goal**: Implement the main reports UI and display AI insights. -- **Dependencies** - - Requires backend reports APIs and AI insights availability. -- **Acceptance criteria** - - Reports interface is complete and shows AI insights (no placeholder UI). +--- -### Complete "Daily ops" report UI (client mobile) +### Support Attire Upload for Workers -- **Goal**: Implement the Daily ops report screen. -- **Dependencies** - - Requires backend Daily ops report support. -- **Acceptance criteria** - - Daily ops report UI is complete and renders real data. +**Goal:** Allow workers to upload attire images for verification. -### Complete "Spend report" UI (client mobile) +**Where:** Backend. -- **Goal**: Implement the Spend report screen. -- **Dependencies** - - Requires backend Spend report support. -- **Acceptance criteria** - - Spend report UI is complete and renders real data. +#### Acceptance Criteria +- Attire images can be uploaded and linked to the worker profile. -### Complete "Coverage report" UI (client mobile) +--- -- **Goal**: Implement the Coverage report screen. -- **Dependencies** - - Requires backend Coverage report support. -- **Acceptance criteria** - - Coverage report UI is complete and renders real data. +### Verify Attire Images Against Shift Dress Code -### Complete "No-show" report UI (client mobile) +**Goal:** Verify uploaded attire meets dress code requirements. -- **Goal**: Implement the No-show report screen. -- **Dependencies** - - Requires backend No-show report support. -- **Acceptance criteria** - - No-show report UI is complete and renders real data. +**Where:** Backend. -### Complete "Performance report" UI (client mobile) +#### Policy Requirement +Manual verification by the client must still exist even if AI verification passes. -- **Goal**: Implement the Performance report screen. -- **Dependencies** - - Requires backend Performance report support. -- **Acceptance criteria** - - Performance report UI is complete and renders real data. +#### Acceptance Criteria +- Verification results are stored and visible to the client for manual review. -### Build dedicated interface to display hub details +--- -- **Goal**: Show hub details in a dedicated UI. -- **Acceptance criteria** - - Hub details page exists and displays hub information. +### Support Shifts Requiring "Awaiting Confirmation" Status -### Enable hub editing (separate page) +**Goal:** Support shifts where the worker must manually confirm before the shift becomes active. -- **Goal**: Allow hub editing via a dedicated screen. -- **Acceptance criteria** - - Separate edit hub page exists and updates the hub data. +**Where:** Backend. -# **Research Tasks** +#### Acceptance Criteria +- Shift can enter an "awaiting confirmation" state. +- Worker confirmation transitions the shift to the next expected active state. -### Validate worker SSN number in the US +--- -- **Goal**: Identify a viable SSN validation approach. -- **Scope (research)** - - Research third-party services/APIs that provide SSN validation. - - Evaluate cost, reliability, and integration effort. - - Outline an integration plan and highlight risks. +### Enable NFC-Based Clock-In and Clock-Out -### Validate worker bank account details in the US +**Goal:** Allow attendance via NFC. -- **Goal**: Identify a viable bank account validation approach. -- **Scope (research)** - - Research third-party services/APIs for bank account validation. - - Evaluate cost, reliability, and integration effort. - - Outline an integration plan and highlight risks. - - Note: legacy app only uses soft FE checks; M4 aims for a proper validation process. +**Where:** Backend tasks (APIs/events/storage to support NFC clock-in/out). -### What payment platforms do we want to integrate for processing payments to workers? +#### Acceptance Criteria +- Backend can record NFC clock-in/out events with appropriate validation and auditing. -- **Goal**: Select a payout/payment platform. -- **Scope (research)** - - Research platforms (e.g., Stripe, PayPal, Square) that support payouts. - - Evaluate cost, reliability, and integration effort. - - Outline an integration plan and highlight risks. +--- -### Implement test cases for 2 web dashboard features using agent-browser +### Implement Worker Profile Visibility Settings ✅ -- **Goal**: Add automated test coverage runnable via . -- **Scope (research + spike)** - - Research how to implement test cases for web apps using the agent browser. +**Goal:** Allow workers to hide their profile from clients if they choose. -# **Business Tasks** +**Where:** Backend tasks (visibility settings + enforcement). -### Create template model for PDF reports in client and web apps +#### Acceptance Criteria +- Worker can change visibility setting. +- Backend enforces visibility in client-facing queries. -- **Goal**: Align report format across platforms. -- **Acceptance criteria** - - A shared template model is defined and ready to implement. +--- -### Handle operational risk scenarios that disadvantage clients +### Support Rapid Order Parsing (Voice and Text) Using AI -- **Goal**: Define policies for common operational issues. -- **Scenarios (M4)** - - Worker is a no-show. - - Shifts are not getting enough applicants. -- **Acceptance criteria** - - Written policy decisions exist and are ready to translate into product rules. +**Goal:** Let clients create orders by describing needs in voice/text. -### Finalize terms of service and privacy policy for mobile apps +**Where:** Backend tasks (parsing + mapping). -- **Goal**: Provide legal documents for launch readiness. -- **Acceptance criteria** - - Terms of service and privacy policy drafts exist and are approved for implementation. +#### Notes +Always map the output similar to one-time order creation. -### Handle worker data requests +#### Acceptance Criteria +- Backend returns a structured draft order that matches the one-time order model. -- **Goal**: Define a process for worker data requests. -- **Acceptance criteria** - - A documented workflow exists (intake, verification, fulfillment, timelines). +--- -### How should we rephrase key terminology in the app (for clarity and accuracy)? +### Personalize Shifts Shown to Workers (Auto Match) -- **Goal**: Use consistent product language. -- **Topics (M4)** - - Worker registration: is it "signup" or "onboarding"? - - Context: workers are expected to be attached to a vendor; the flow is closer to onboarding (phone number + OTP) than self-service signup. - - Worker profile visibility: is it "profile visibility" or "availability status"? - - Context: workers are not fully invisible; they are marking themselves unavailable. - - What do we mean by "auto match"? - - Should this exist by default anyway? - - Is this only a marketing item? - - These are just examples; the discussion may surface additional terminology decisions. -- **Acceptance criteria** - - A terminology decision list exists with approved wording. +**Goal:** Show worker-personalized shifts. +**Where:** Backend matching/filtering logic. + +#### Inputs (M4) +- Preferred locations. +- Experience. + +#### Acceptance Criteria +- Worker shift feed is personalized based on these inputs. + +--- + +### Recurring Order and Reorder — Backend Support + +**Goal:** Enable recurring orders and reorder. + +**Where:** Backend. + +#### Acceptance Criteria +- Backend can create and manage recurring orders and support reorder actions. + +--- + +### Permanent Order and Reorder — Backend Support + +**Goal:** Enable permanent orders and reorder. + +**Where:** Backend. + +#### Acceptance Criteria +- Backend can create and manage permanent orders and support reorder actions. + +--- + +### Backend Support for Reports Page (Client Mobile) + +**Goal:** Provide APIs/data needed to render the main reports entry and summary experience. + +**Where:** Backend. + +#### Acceptance Criteria +- Reports API contracts are defined and documented. +- Client can load the reports page without placeholder data. + +--- + +### Backend Support for "Daily Ops" Report (Client Mobile) + +**Goal:** Provide the data required for the Daily Ops report. + +**Where:** Backend. + +#### Acceptance Criteria +- Daily Ops report API returns all fields required by the UI. +- Response is documented (including filters/date ranges, if applicable). + +--- + +### Backend Support for "Spend Report" (Client Mobile) + +**Goal:** Provide the data required for the Spend report. + +**Where:** Backend. + +#### Acceptance Criteria +- Spend report API returns all fields required by the UI. +- Response is documented (including filters/date ranges, if applicable). + +--- + +### Backend Support for "Coverage Report" (Client Mobile) + +**Goal:** Provide the data required for the Coverage report. + +**Where:** Backend. + +#### Acceptance Criteria +- Coverage report API returns all fields required by the UI. +- Response is documented (including filters/date ranges, if applicable). + +--- + +### Backend Support for "No-Show" Report (Client Mobile) + +**Goal:** Provide the data required for the No-show report. + +**Where:** Backend. + +#### Acceptance Criteria +- No-show report API returns all fields required by the UI. +- Response is documented (including filters/date ranges, if applicable). + +--- + +### Backend Support for "Performance Report" (Client Mobile) + +**Goal:** Provide the data required for the Performance report. + +**Where:** Backend. + +#### Acceptance Criteria +- Performance report API returns all fields required by the UI. +- Response is documented (including filters/date ranges, if applicable). + +--- + +### Calculate the 3 AI Insights for Client Mobile Reports Page + +**Goal:** Produce the three AI insights shown on the reports page. + +**Where:** Backend. + +#### Acceptance Criteria +- Insights are generated consistently and returned in the reports API response. + +--- + +## Frontend (FE) + +### Maintain Auth Session (Client and Staff Mobile) + +**Goal:** Maintain the authentication session of the client and staff mobile application. + +#### Details +Currently when the user restarts the application they are prompted to login. This UX barrier should be removed — if a valid authentication session is available, use it instead of prompting the user to re-login. + +#### Acceptance Criteria +- The authentication session of the client and staff mobile applications is maintained across restarts. + +--- + +### Enable iOS Deployment + +**Goal:** Enable iOS deployment of both applications. + +--- + +## Staff Mobile Application + +### Show Google Maps Location in Worker Shift Details ✅ + +**Goal:** Display shift location on a map. + +#### Acceptance Criteria +- Shift details page shows the correct location using Google Maps. + +--- + +### Show Shift Requirements in Worker Shift Details + +**Goal:** Make requirements visible before acceptance. + +#### Details +The main goal is to list the required attires in the requirements section, but any other requirements can also be listed there. + +#### Acceptance Criteria +- Shift details page includes a requirements section for that shift. + +--- + +### Implement Attire Screen in Worker App + +**Goal:** Let workers understand attire requirements and submit attire for review. + +#### Scope (M4) +- Show the list of MUST HAVE attire items. +- Show the list of NICE TO HAVE attire items. +- Allow workers to upload images of their attire for verification. +- Show uploaded attire images in the worker profile. + +#### Acceptance Criteria +- Attire screen renders required lists and supports image upload flow. +- Uploaded images appear in the worker profile UI. + +--- + +### Implement FAQ Screen in Worker App + +**Goal:** Provide common answers in-app. + +#### Acceptance Criteria +- Worker app includes an FAQ screen accessible from appropriate navigation. + +--- + +### Implement Privacy and Security Screen in Worker App + +**Goal:** Provide key privacy/security controls and documents. + +#### Scope (M4) +- Profile visibility setting. +- Terms of service (use a generated placeholder for now; replace with final for launch). +- Privacy policy (use a generated placeholder for now; replace with final for launch). + +#### Acceptance Criteria +- Screen is accessible and displays all items above. + +--- + +### Restrict Navigation When Worker Profile Is Incomplete + +**Goal:** Reduce access until onboarding/profile completion. + +#### Acceptance Criteria +- If the user has not completed their profile, only show **Profile** and **Home**. + +--- + +### Preferred Location Edit + +**Goal:** Create a separate page to edit the preferred locations of the staff. + +--- + +## Client Mobile Application + +### Hide Edit Icon for Past or Completed Orders + +**Goal:** In the client application view order screen, hide the edit icon for orders that are in the past or completed. + +--- + +### Implement Rapid Order Creation (Voice + Text) + +**Goal:** Allow clients to quickly create same-day orders by describing needs via voice/text. + +#### Scope (M4) +- Capture voice/text input. +- Send input for parsing. +- Populate a screen equivalent to the one-time order creation screen so the client can adjust before finalizing. +- Always map similar to one-time order creation (handles same-day orders). + +#### Acceptance Criteria +- Parsed output populates the one-time order creation UI correctly. +- Client can edit and successfully submit the order. + +--- + +### Implement Recurring Order + +**Goal:** Allow clients to create recurring orders. + +#### Scope (M4) +- Create a recurring order UI flow. + +#### Acceptance Criteria +- Client can create and submit a recurring order successfully. + +--- + +### Implement Permanent Order + +**Goal:** Allow clients to create permanent orders. + +#### Scope (M4) +- Create a permanent order UI flow. + +#### Acceptance Criteria +- Client can create and submit a permanent order successfully. + +--- + +### Update Reorder Modal to Support Order Types + +**Goal:** Ensure reorder works across supported order types. + +#### Acceptance Criteria +- Reorder modal reflects the correct order type and fields. + +--- + +### Complete Reports Interface with AI Insights + +**Goal:** Implement the main reports UI and display AI insights. + +#### Dependencies +Requires backend reports APIs and AI insights availability. + +#### Acceptance Criteria +- Reports interface is complete and shows AI insights (no placeholder UI). + +--- + +### Complete "Daily Ops" Report UI + +**Goal:** Implement the Daily Ops report screen. + +#### Dependencies +Requires backend Daily Ops report support. + +#### Acceptance Criteria +- Daily Ops report UI is complete and renders real data. + +--- + +### Complete "Spend Report" UI + +**Goal:** Implement the Spend report screen. + +#### Dependencies +Requires backend Spend report support. + +#### Acceptance Criteria +- Spend report UI is complete and renders real data. + +--- + +### Complete "Coverage Report" UI + +**Goal:** Implement the Coverage report screen. + +#### Dependencies +Requires backend Coverage report support. + +#### Acceptance Criteria +- Coverage report UI is complete and renders real data. + +--- + +### Complete "No-Show" Report UI + +**Goal:** Implement the No-show report screen. + +#### Dependencies +Requires backend No-show report support. + +#### Acceptance Criteria +- No-show report UI is complete and renders real data. + +--- + +### Complete "Performance Report" UI + +**Goal:** Implement the Performance report screen. + +#### Dependencies +Requires backend Performance report support. + +#### Acceptance Criteria +- Performance report UI is complete and renders real data. + +--- + +### Build Dedicated Interface to Display Hub Details + +**Goal:** Show hub details in a dedicated UI. + +#### Acceptance Criteria +- Hub details page exists and displays hub information. + +--- + +### Enable Hub Editing (Separate Page) + +**Goal:** Allow hub editing via a dedicated screen. + +#### Acceptance Criteria +- Separate edit hub page exists and updates the hub data. + +--- + +## Research Tasks + +### Validate Worker SSN Number in the US + +**Goal:** Identify a viable SSN validation approach. + +#### Scope (Research) +- Research third-party services/APIs that provide SSN validation. +- Evaluate cost, reliability, and integration effort. +- Outline an integration plan and highlight risks. + +--- + +### Validate Worker Bank Account Details in the US + +**Goal:** Identify a viable bank account validation approach. + +#### Scope (Research) +- Research third-party services/APIs for bank account validation. +- Evaluate cost, reliability, and integration effort. +- Outline an integration plan and highlight risks. + +> **Note:** Legacy app only uses soft FE checks; M4 aims for a proper validation process. + +--- + +### Payment Platform Research for Worker Payouts + +**Goal:** Select a payout/payment platform. + +#### Scope (Research) +- Research platforms (e.g., Stripe, PayPal, Square) that support payouts. +- Evaluate cost, reliability, and integration effort. +- Outline an integration plan and highlight risks. + +--- + +### Implement Test Cases for 2 Web Dashboard Features Using Agent Browser + +**Goal:** Add automated test coverage runnable via [agent-browser.dev](https://agent-browser.dev/). + +#### Scope (Research + Spike) +- Research how to implement test cases for web apps using the agent browser. + +--- + +## Business Tasks + +### Create Template Model for PDF Reports (Client and Web Apps) + +**Goal:** Align report format across platforms. + +#### Acceptance Criteria +- A shared template model is defined and ready to implement. + +--- + +### Handle Operational Risk Scenarios That Disadvantage Clients + +**Goal:** Define policies for common operational issues. + +#### Scenarios (M4) +- Worker is a no-show. +- Shifts are not getting enough applicants. + +#### Acceptance Criteria +- Written policy decisions exist and are ready to translate into product rules. + +--- + +### Finalize Terms of Service and Privacy Policy for Mobile Apps + +**Goal:** Provide legal documents for launch readiness. + +#### Acceptance Criteria +- Terms of service and privacy policy drafts exist and are approved for implementation. + +--- + +### Handle Worker Data Requests + +**Goal:** Define a process for worker data requests. + +#### Acceptance Criteria +- A documented workflow exists (intake, verification, fulfillment, timelines). + +--- + +### Rephrase Key Terminology in the App + +**Goal:** Use consistent product language. + +#### Topics (M4) + +- **Worker registration:** Is it "signup" or "onboarding"? + - Context: Workers are expected to be attached to a vendor; the flow is closer to onboarding (phone number + OTP) than self-service signup. + +- **Worker profile visibility:** Is it "profile visibility" or "availability status"? + - Context: Workers are not fully invisible; they are marking themselves unavailable. + +- **"Auto match":** What do we mean by this? + - Should this exist by default anyway? + - Is this only a marketing item? + +> These are just examples; the discussion may surface additional terminology decisions. + +#### Acceptance Criteria +- A terminology decision list exists with approved wording. diff --git a/internal/api-harness/src/api/krowSDK.js b/internal/api-harness/src/api/krowSDK.js index 7c9ec177..c47392ed 100644 --- a/internal/api-harness/src/api/krowSDK.js +++ b/internal/api-harness/src/api/krowSDK.js @@ -303,14 +303,19 @@ const dataconnectEntityConfig = { Order:{ list: 'listOrder', get: 'getOrderById', - create: 'UpdateOrder', - update: 'updateEnterprise', - delete: 'deleteEnterprise', + create: 'createOrder', + update: 'updateOrder', + delete: 'deleteOrder', filter: 'filterOrder', }, Shift:{ - + list: 'listShifts', + get: 'getShiftById', + create: 'createShift', + update: 'updateShift', + delete: 'deleteShift', + filter: 'filterShifts', } }; diff --git a/makefiles/mobile.mk b/makefiles/mobile.mk index ce8f4645..43c3d618 100644 --- a/makefiles/mobile.mk +++ b/makefiles/mobile.mk @@ -1,6 +1,6 @@ # --- Mobile App Development --- -.PHONY: mobile-install mobile-info mobile-analyze mobile-test mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart +.PHONY: mobile-install mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart MOBILE_DIR := apps/mobile @@ -20,12 +20,8 @@ mobile-info: @cd $(MOBILE_DIR) && melos run info mobile-analyze: - @echo "--> Running mobile static analysis for client and staff..." - @cd $(MOBILE_DIR) && melos run analyze:all - -mobile-test: - @echo "--> Running mobile tests for client and staff..." - @cd $(MOBILE_DIR) && melos run test:all + @echo "--> Analyzing mobile workspace for compile-time errors..." + @cd $(MOBILE_DIR) && flutter analyze # --- Hot Reload & Restart --- mobile-hot-reload: