From 7d61997373a27142d0c745378958e65103e8f60d Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Mon, 12 Jan 2026 17:26:43 -0500 Subject: [PATCH 1/4] doc: doc 05 updated with some changes --- docs/05-project-onboarding-master.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/05-project-onboarding-master.md b/docs/05-project-onboarding-master.md index 0486a87b..7f6091ae 100644 --- a/docs/05-project-onboarding-master.md +++ b/docs/05-project-onboarding-master.md @@ -171,7 +171,7 @@ graph TB ├── apps/ │ ├── web-dashboard/ # Vite + React │ ├── mobile-client/ # Flutter (business app) - │ └── mobile-staff/ # Flutter (worker app) + │ └── mobile-worker/ # Flutter (worker app) ├── backend/ │ ├── dataconnect/ # Firebase Data Connect schemas │ └── functions/ # Cloud Functions @@ -310,7 +310,7 @@ sequenceDiagram participant Client as Client App participant API as Backend API participant Admin as Admin - participant Staff as Staff App + participant Staff as Worker App Note over Client,API: 1. Event Creation Client->>API: Create Event with Shifts & Positions @@ -318,10 +318,12 @@ sequenceDiagram Client->>API: Publish Event API-->>Client: Event Published - Note over Admin,API: 2. Staff Assignment - Admin->>API: Assign Staff to Shift - API-->>Admin: Assignment Confirmed - API->>Staff: Notification: New Shift + opt 2. Staff Assignment (Optional) + Note over Admin,API: Optional Staff Assignment + Admin->>API: Assign Staff to Shift + API-->>Admin: Assignment Confirmed + API->>Staff: Notification: New Shift + end Note over Staff,API: 3. Shift Acceptance Staff->>API: Accept Shift @@ -337,6 +339,7 @@ sequenceDiagram Client->>API: Rate Staff API->>API: Generate Invoice Client->>API: Approve Invoice + ``` #### Workflow 2: Staff Onboarding @@ -370,6 +373,12 @@ sequenceDiagram └── Status: completed_profile → verified ``` +But there is an ambiguity in the workflow. In the legacy application, worker verification happens at the beginning, and all workers are fully verified before they can access the application. In the new version, however, workers are allowed to access the application without being fully verified. This creates ambiguity in the following areas: +- Definition of worker verification in the new system + - Does verification mean the worker has fully completed their profile, or can a worker be considered verified with an incomplete profile? +- Visibility of shifts for unverified workers + - Should unverified workers be able to view the shifts page? + #### Workflow 3: Payroll Calculation ``` @@ -695,7 +704,7 @@ These **must be ported** from legacy: --- -#### 4.7.2 Mobile Staff App (Flutter) +#### 4.7.2 Mobile Worker App (Flutter) **Location:** `internal/launchpad/prototypes-src/mobile/staff/` @@ -797,9 +806,9 @@ These **must be ported** from legacy: |-----------|----------|------| | Web Prototype Source | `internal/launchpad/prototypes-src/web/` | React + TypeScript | | Mobile Client Prototype | `internal/launchpad/prototypes-src/mobile/client/` | Flutter + Dart | -| Mobile Staff Prototype | `internal/launchpad/prototypes-src/mobile/staff/` | Flutter + Dart | +| Mobile Worker Prototype | `internal/launchpad/prototypes-src/mobile/worker/` | Flutter + Dart | | Legacy Client Mobile | `_legacy/apps/krow_client_context.md` | Flutter (context doc) | -| Legacy Staff Mobile | `_legacy/apps/krow_staff_context.md` | Flutter (context doc) | +| Legacy Worker (Legacy Staff) Mobile | `_legacy/apps/krow_staff_context.md` | Flutter (context doc) | | Legacy Backend | `_legacy/apps/php_backend_context.md` | PHP/Laravel | | New Backend | `backend/dataconnect/` | Firebase Data Connect | From ade07eea727e9f5f02fc6c60e2ee4332fb1209c9 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Mon, 12 Jan 2026 17:31:31 -0500 Subject: [PATCH 2/4] chore: update links to name to be worker --- internal/launchpad/assets/data/links.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/launchpad/assets/data/links.json b/internal/launchpad/assets/data/links.json index d64094ea..08bc2bea 100644 --- a/internal/launchpad/assets/data/links.json +++ b/internal/launchpad/assets/data/links.json @@ -39,7 +39,7 @@ "textHoverClass": "group-hover:text-blue-700" }, { - "title": "Mobile Staff MVP", + "title": "Mobile Worker MVP", "url": "/prototypes/mobile/staff/index.html", "badge": "Concept", "badgeColorClass": "bg-green-500", From ef31dbe4147ae0958d66a563c0b2e72ac7e27e4b Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Mon, 12 Jan 2026 21:01:31 -0500 Subject: [PATCH 3/4] docs: update the route of the mobile apps --- docs/05-project-onboarding-master.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/05-project-onboarding-master.md b/docs/05-project-onboarding-master.md index 7f6091ae..723e5444 100644 --- a/docs/05-project-onboarding-master.md +++ b/docs/05-project-onboarding-master.md @@ -170,8 +170,10 @@ graph TB krow-workforce-web/ ├── apps/ │ ├── web-dashboard/ # Vite + React - │ ├── mobile-client/ # Flutter (business app) - │ └── mobile-worker/ # Flutter (worker app) + │ ├── mobile/ + | | ├── apps/ + | | │ ├── client/ # Flutter (business app) + | | │ └── worker/ # Flutter (worker app) ├── backend/ │ ├── dataconnect/ # Firebase Data Connect schemas │ └── functions/ # Cloud Functions @@ -667,7 +669,7 @@ These **must be ported** from legacy: #### 4.7.1 Mobile Client App (Flutter) -**Location:** `internal/launchpad/prototypes-src/mobile/client/` +**Location:** `internal/launchpad/prototypes-src/mobile/apps/client/` **Routes (22 screens):** @@ -706,7 +708,7 @@ These **must be ported** from legacy: #### 4.7.2 Mobile Worker App (Flutter) -**Location:** `internal/launchpad/prototypes-src/mobile/staff/` +**Location:** `internal/launchpad/prototypes-src/mobile/apps/worker/` **Routes (35+ screens):** From 0ce416c81b996880a806f6252b703bf933b46ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Tue, 13 Jan 2026 09:36:31 -0500 Subject: [PATCH 4/4] diagrams --- .../dataconnect/docs/client_app_diagram.mmd | 74 +++++ .../dataconnect-schemas-mutations-queries.mmd | 124 ++++++++ backend/dataconnect/docs/dataconnect.mmd | 271 ++++++++++++++++++ .../dataconnect/docs/staff_app_diagram.mmd | 121 ++++++++ 4 files changed, 590 insertions(+) create mode 100644 backend/dataconnect/docs/client_app_diagram.mmd create mode 100644 backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd create mode 100644 backend/dataconnect/docs/dataconnect.mmd create mode 100644 backend/dataconnect/docs/staff_app_diagram.mmd diff --git a/backend/dataconnect/docs/client_app_diagram.mmd b/backend/dataconnect/docs/client_app_diagram.mmd new file mode 100644 index 00000000..38d4868c --- /dev/null +++ b/backend/dataconnect/docs/client_app_diagram.mmd @@ -0,0 +1,74 @@ +flowchart LR + +subgraph C1["Login"] + S_client_sign_in["client_sign_in_screen.dart"] + S_client_sign_in --> S_client_sign_in_Q["Queries
* user - getUserById
* business - getBusinessesByUserId"] + S_client_sign_in --> S_client_sign_in_F["Firebase
* user - auth"] +end + +subgraph C2["Create account"] + S_client_sign_up["client_sign_up_screen.dart"] + S_client_sign_up --> S_client_sign_up_Q["Queries
* business - getBusinessesByUserId"] + S_client_sign_up --> S_client_sign_up_M["Mutations
* user - createUser
* business - createBusiness"] +end + +subgraph C3["Edit account"] + S_edit_account_na["manual_or_unknown_screen.dart"] + S_edit_account_na --> S_edit_account_na_M["Mutations
* business - updateBusiness"] +end + +subgraph C4["Profile"] + S_client_settings["client_settings_screen.dart"] + S_client_settings --> S_client_settings_Q["Queries
* user - getUserById
* business - getBusinessesByUserId"] +end + +subgraph C5["Hubs"] + S_client_hubs["client_hubs_screen.dart"] + S_client_hubs --> S_client_hubs_Q["Queries
* hub - getHubsByOwnerId"] + S_client_hubs --> S_client_hubs_M["Mutations
* hub - createHub
* hub - updateHub
* hub - deleteHub"] +end + +subgraph C6["Orders"] + S_client_shifts["client_shifts_screen.dart"] + S_client_shifts --> S_client_shifts_Q["Queries
* order - getOrdersByOwnerId"] +end + +subgraph C7["RAPID Order"] + S_rapid_order["rapid_order_flow_page.dart"] + S_rapid_order --> S_rapid_order_M["Mutations
* order - createOrder"] +end + +subgraph C8["One-time Order"] + S_one_time["one_time_order_flow_page.dart"] + S_one_time --> S_one_time_Q["Queries
* role - listRolesByOwnerId"] + S_one_time --> S_one_time_M["Mutations
* position - createPosition
* order - createOrder"] +end + +subgraph C9["Permanent Placement"] + S_permanent["permanent_order_flow_page.dart"] + S_permanent --> S_permanent_Q["Queries
* role - listRolesByOwnerId"] + S_permanent --> S_permanent_M["Mutations
* position - createPosition
* order - createOrder"] +end + +subgraph C10["Recurring Order"] + S_recurring["recurring_order_flow_page.dart"] + S_recurring --> S_recurring_Q["Queries
* role - listRolesByOwnerId"] + S_recurring --> S_recurring_M["Mutations
* position - createPosition
* order - createOrder"] +end + +subgraph C11["Billing"] + S_billing["client_billing_screen.dart"] + S_billing --> S_billing_Q["Queries
* account - getAccountsByOwnerId
* invoice - getInvoicesByOwnerId
* recentPayment - filterRecentPayments"] + S_billing --> S_billing_M["Mutations
* account - createAccount
* account - updateAccount
* account - deleteAccount"] +end + +subgraph C12["Coverage"] + S_coverage["coverage_dashboard.dart"] + S_coverage --> S_coverage_Q["Queries
* order - getOrdersByOwnerId
* shift - filterShifts
* application - getApplicationsByShiftId"] +end + +subgraph C13["Home"] + S_client_home["client_home_screen.dart"] + S_client_home --> S_client_home_Q["Queries
* order - getOrdersByOwnerId
* shift - filterShifts
* application - getApplicationsByShiftId
* recentPayment - filterRecentPayments"] + S_client_home --> S_client_home_M["Mutations
* order - createOrder"] +end diff --git a/backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd b/backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd new file mode 100644 index 00000000..f241b3a5 --- /dev/null +++ b/backend/dataconnect/docs/dataconnect-schemas-mutations-queries.mmd @@ -0,0 +1,124 @@ +flowchart LR + subgraph "Profile & Onboarding" + User --> User_Q["Queries
- listUsers
- getUserById"] + User --> User_M["Mutations
- createUser
- updateUser
- deleteUser"] + Staff --> Staff_Q["Queries
- listStaff
- getStaffById
- getStaffByUserId"] + Staff --> Staff_M["Mutations
- createStaff
- updateStaff
- deleteStaff"] + Contact --> Contact_Q["Queries
- listContacts
- getContactById
- listContactsByStaffId"] + Contact --> Contact_M["Mutations
- createContact
- updateContact
- deleteContact"] + AttireOption --> AttireOption_Q["Queries
- listAttireOptions
- getAttireOptionById"] + AttireOption --> AttireOption_M["Mutations
- createAttireOption
- updateAttireOption
- deleteAttireOption"] + end + + subgraph "Compliance" + Document --> Document_Q["Queries
- listDocuments
- getDocumentById
- listDocumentsByStaffId"] + Document --> Document_M["Mutations
- createDocument
- updateDocument
- deleteDocument"] + Certificate --> Certificate_Q["Queries
- listCertificates
- getCertificateById
- listCertificatesByStaffId"] + Certificate --> Certificate_M["Mutations
- CreateCertificate
- UpdateCertificate
- DeleteCertificate"] + TaxForm --> TaxForm_Q["Queries
- listTaxForms
- getTaxFormById
- getTaxFormsByStaffId
- filterTaxForms"] + TaxForm --> TaxForm_M["Mutations
- createTaxForm
- updateTaxForm
- deleteTaxForm"] + RequiredDoc --> RequiredDoc_Q["Queries
- listRequiredDocs
- getRequiredDocById
- listRequiredDocsByUserId"] + RequiredDoc --> RequiredDoc_M["Mutations
- createRequiredDoc
- updateRequiredDoc
- deleteRequiredDoc"] + end + + subgraph "Finances" + Account --> Account_Q["Queries
- listAccounts
- getAccountById
- listAccountsByOwnerId"] + Account --> Account_M["Mutations
- createAccount
- updateAccount
- deleteAccount"] + TimeSheet --> TimeSheet_Q["Queries
- listTimeSheets
- getTimeSheetById
- listTimeSheetsByStaffId"] + TimeSheet --> TimeSheet_M["Mutations
- createTimeSheet
- updateTimeSheet
- deleteTimeSheet"] + RecentPayment --> RecentPayment_Q["Queries
- listRecentPayments
- getRecentPaymentById
- listRecentPaymentsByUserId"] + RecentPayment --> RecentPayment_M["Mutations
- createRecentPayment
- updateRecentPayment
- deleteRecentPayment"] + Invoice --> Invoice_Q["Queries
- listInvoices
- getInvoiceById"] + Invoice --> Invoice_M["Mutations
- createInvoice
- updateInvoice
- deleteInvoice"] + InvoiceTemplate --> InvoiceTemplate_Q["Queries
- listInvoiceTemplates
- getInvoiceTemplateById"] + InvoiceTemplate --> InvoiceTemplate_M["Mutations
- createInvoiceTemplate
- updateInvoiceTemplate
- deleteInvoiceTemplate"] + VendorRate --> VendorRate_Q["Queries
- listVendorRates
- getVendorRateById"] + VendorRate --> VendorRate_M["Mutations
- createVendorRate
- updateVendorRate
- deleteVendorRate"] + CustomRateCard --> CustomRateCard_Q["Queries
- listCustomRateCards
- getCustomRateCardById"] + CustomRateCard --> CustomRateCard_M["Mutations
- createCustomRateCard
- updateCustomRateCard
- deleteCustomRateCard"] + end + + subgraph "Shifts & Work" + Shift --> Shift_Q["Queries
- listShifts
- getShiftById
- filterShifts"] + Shift --> Shift_M["Mutations
- CreateShift
- UpdateShift
- DeleteShift"] + Application --> Application_Q["Queries
- getApplicationById
- listApplicationsByStaffId"] + Application --> Application_M["Mutations
- createApplication
- updateApplication
- deleteApplication"] + StaffShift --> StaffShift_Q["Queries
- getMyShifts
- getStaffShiftById
- getStaffShiftsByShiftId"] + StaffShift --> StaffShift_M["Mutations
- createStaffShift
- updateStaffShift
- deleteStaffShift"] + StaffAvailability --> StaffAvailability_Q["Queries
- listStaffAvailabilities
- getStaffAvailabilityById
- getStaffAvailabilityByStaffId"] + StaffAvailability --> StaffAvailability_M["Mutations
- createStaffAvailability
- updateStaffAvailability
- deleteStaffAvailability"] + Assignment --> Assignment_Q["Queries
- listAssignments
- getAssignmentById
- listAssignmentsByStaffId"] + Assignment --> Assignment_M["Mutations
- CreateAssignment
- UpdateAssignment
- DeleteAssignment"] + Order --> Order_Q["Queries
- listOrders
- getOrderById"] + Order --> Order_M["Mutations
- createOrder
- updateOrder
- deleteOrder"] + Position --> Position_Q["Queries
- listPositions
- getPositionById
- listPositionsByOrderId"] + Position --> Position_M["Mutations
- createPosition
- updatePosition
- deletePosition"] + Category --> Category_Q["Queries
- listCategories
- getCategoryById"] + Category --> Category_M["Mutations
- createCategory
- updateCategory
- deleteCategory"] + Role --> Role_Q["Queries
- listRoles
- getRoleById"] + Role --> Role_M["Mutations
- createRole
- updateRole
- deleteRole"] + RoleCategory --> RoleCategory_Q["Queries
- listRoleCategories
- getRoleCategoryById"] + RoleCategory --> RoleCategory_M["Mutations
- createRoleCategory
- updateRoleCategory
- deleteRoleCategory"] + Schedule --> Schedule_Q["Queries
- listSchedules
- getScheduleById
- getScheduleByPositionId"] + Schedule --> Schedule_M["Mutations
- createSchedule
- updateSchedule
- deleteSchedule"] + Workforce --> Workforce_Q["Queries"] + Workforce --> Workforce_M["Mutations"] + end + + subgraph "Learning" + Course --> Course_Q["Queries
- listCourses
- getCourseById
- filterCourses"] + Course --> Course_M["Mutations
- createCourse
- updateCourse
- deleteCourse"] + Level --> Level_Q["Queries
- listLevels
- getLevelById"] + Level --> Level_M["Mutations
- createLevel
- updateLevel
- deleteLevel"] + StaffCourse --> StaffCourse_Q["Queries
- getStaffCourseById
- listStaffCoursesByStaffId
- listStaffCoursesByCourseId
- getStaffCourseByStaffAndCourse"] + StaffCourse --> StaffCourse_M["Mutations
- createStaffCourse
- updateStaffCourse
- deleteStaffCourse"] + end + + subgraph "Benefits" + BenefitsData --> BenefitsData_Q["Queries
- listBenefitsData
- getBenefitsDataById
- getBenefitsDataByStaffId"] + BenefitsData --> BenefitsData_M["Mutations
- createBenefitsData
- updateBenefitsData
- deleteBenefitsData"] + end + + subgraph "Business & Vendors" + Business --> Business_Q["Queries
- listBusinesses
- getBusinessById
- getBusinessesByUserId"] + Business --> Business_M["Mutations
- createBusiness
- updateBusiness
- deleteBusiness"] + Vendor --> Vendor_Q["Queries
- listVendors
- getVendorById"] + Vendor --> Vendor_M["Mutations
- createVendor
- updateVendor
- deleteVendor"] + Hub --> Hub_Q["Queries
- listHubs
- getHubById"] + Hub --> Hub_M["Mutations
- createHub
- updateHub
- deleteHub"] + end + + subgraph "Teams" + Team --> Team_Q["Queries
- listTeams
- getTeamById"] + Team --> Team_M["Mutations
- createTeam
- updateTeam
- deleteTeam"] + TeamMember --> TeamMember_Q["Queries
- listTeamMembers
- getTeamMemberById
- listTeamMembersByTeamId"] + TeamMember --> TeamMember_M["Mutations
- createTeamMember
- updateTeamMember
- deleteTeamMember"] + MemberTask --> MemberTask_Q["Queries
- getMyTasks
- getMemberTaskById
- getMemberTasksByTaskId"] + MemberTask --> MemberTask_M["Mutations
- createMemberTask
- updateMemberTask
- deleteMemberTask"] + TeamHub --> TeamHub_Q["Queries
- listTeamHubs
- getTeamHubById
- listTeamHubsByTeamId"] + TeamHub --> TeamHub_M["Mutations
- createTeamHub
- updateTeamHub
- deleteTeamHub"] + Task --> Task_Q["Queries
- listTasks
- getTaskById"] + Task --> Task_M["Mutations
- createTask
- updateTask
- deleteTask"] + TaskComment --> TaskComment_Q["Queries
- listTaskComments
- getTaskCommentById
- listTaskCommentsByTaskId"] + TaskComment --> TaskComment_M["Mutations
- createTaskComment
- updateTaskComment
- deleteTaskComment"] + end + + subgraph "Communication" + Conversation --> Conversation_Q["Queries
- listConversations
- getConversationById
- getConversationsByUserId"] + Conversation --> Conversation_M["Mutations
- createConversation
- updateConversation
- deleteConversation"] + Message --> Message_Q["Queries
- listMessages
- getMessageById
- listMessagesByConversationId"] + Message --> Message_M["Mutations
- createMessage
- updateMessage
- deleteMessage"] + end + + subgraph "Others" + ActivityLog --> ActivityLog_Q["Queries
- listActivityLogs
- getActivityLogById
- listActivityLogsByUserId"] + ActivityLog --> ActivityLog_M["Mutations
- createActivityLog
- updateActivityLog
- deleteActivityLog"] + ClientFeedback --> ClientFeedback_Q["Queries
- listClientFeedbacks
- getClientFeedbackById"] + ClientFeedback --> ClientFeedback_M["Mutations
- createClientFeedback
- updateClientFeedback
- deleteClientFeedback"] + FaqData --> FaqData_Q["Queries
- listFaqDatas
- getFaqDataById"] + FaqData --> FaqData_M["Mutations
- createFaqData
- updateFaqData
- deleteFaqData"] + end + + subgraph "Reporting" + Reports --> Reports_Q["Queries
- getCoverageReport
- getNoShowReport
- getSpendReport
- getForecastReport
- getPerformanceReport
- getDailyOpsReport"] + end diff --git a/backend/dataconnect/docs/dataconnect.mmd b/backend/dataconnect/docs/dataconnect.mmd new file mode 100644 index 00000000..b67267f0 --- /dev/null +++ b/backend/dataconnect/docs/dataconnect.mmd @@ -0,0 +1,271 @@ +erDiagram + User { + String id PK + String email + String fullName + Timestamp createdDate + } + Business { + UUID id PK + String userId FK + String businessName + Timestamp createdAt + } + Vendor { + UUID id PK + String userId FK + String companyName + Timestamp createdAt + } + Staff { + UUID id PK + String userId FK + UUID hubId FK + UUID ownerId FK + String fullName + Timestamp createdAt + } + Shift { + UUID id PK + UUID orderId FK + UUID ownerId FK + ShiftStatus status + Timestamp createdAt + } + Order { + UUID id PK + UUID ownerId FK + UUID hubId FK + OrderStatus status + Timestamp createdAt + } + Position { + UUID id PK + UUID orderId FK + UUID roleId FK + UUID ownerId FK + Timestamp createdAt + } + Task { + UUID id PK + UUID ownerId FK + TaskStatus status + Timestamp createdAt + } + Team { + UUID id PK + String ownerId FK + String teamName + Timestamp createdAt + } + TeamMember { + UUID id PK + UUID teamId FK + UUID hubId FK + String memberName + Timestamp createdAt + } + Hub { + UUID id PK + UUID ownerId FK + String name + Timestamp createdAt + } + Account { + UUID id PK + UUID ownerId FK "polymorphic ownerId" + String bank + Timestamp createdAt + } + Document { + UUID id PK + UUID staffId FK + DocumentStatus status + Timestamp createdAt + } + Certificate { + UUID id PK + UUID staffId FK + CertificateStatus status + Timestamp createdAt + } + Contact { + UUID id PK + UUID staffId FK + String name + Timestamp createdAt + } + BenefitsData { + UUID id PK + UUID staffId FK + String title + Timestamp createdAt + } + Course { + UUID id PK + String title + Timestamp createdAt + } + TaxForm { + UUID id PK + UUID staffId FK + TaxFormStatus status + Timestamp createdAt + } + TimeSheet { + UUID id PK + UUID staffId FK + UUID shiftId FK + TimeSheetStatus status + Timestamp createdAt + } + Invoice { + UUID id PK + UUID ownerId FK + InvoiceStatus status + Timestamp createdAt + } + Assignment { + UUID id PK + UUID staffId FK + UUID ownerId FK + AssignmentStatus status + Timestamp createdAt + } + Conversation { + UUID id PK + String subject + Timestamp createdAt + } + Message { + UUID id PK + UUID conversationId FK + String senderId + Timestamp createdAt + } + Role { + UUID id PK + UUID ownerId FK + String name + Timestamp createdAt + } + RecentPayment { + UUID id PK + UUID payedUserId FK + UUID ownerId FK + RecentPaymentStatus status + Timestamp createdAt + } + RequiredDoc { + UUID id PK + UUID ownerId FK + ReqDocumentStatus status + Timestamp createdAt + } + VendorRate { + UUID id PK + UUID vendorId FK + String roleName + Timestamp createdAt + } + Schedule { + UUID id PK + UUID positionId FK + Timestamp createdAt + } + TaskComment { + UUID id PK + UUID taskId FK + String authorName + Timestamp createdAt + } + TeamHub { + UUID id PK + UUID teamId FK + String hubName + Timestamp createdAt + } + Application { + UUID id PK + UUID shiftId FK + UUID staffId FK + ApplicationStatus status + Timestamp createdAt + } + StaffShift { + UUID id PK + UUID staffId FK + UUID shiftId FK + Timestamp createdAt + } + MemberTask { + UUID id PK + UUID teamMemberId FK + UUID taskId FK + Timestamp createdAt + } + StaffCourse { + UUID id PK + UUID staffId FK + UUID courseId FK + Timestamp createdAt + } + + User ||--|{ Staff : "has profile" + User ||--|{ Vendor : "can be" + User ||--|{ Business : "can be" + User ||--o{ ActivityLog : "generates" + + Business ||--o{ "Order" : "creates" + Business ||--o{ Invoice : "receives" + Business ||--o{ Task : "owns" + Business ||--o{ Hub : "owns" + Business ||--o{ Role : "defines" + Business ||--o{ Shift : "posts" + Business ||--o{ Staff : "employs" + Business ||--o{ Account : "owns" + + Vendor ||--o{ VendorRate : "defines" + Vendor ||--o{ Task : "owns" + Vendor ||--o{ Hub : "owns" + Vendor ||--o{ Role : "defines" + Vendor ||--o{ Shift : "posts" + Vendor ||--o{ Staff : "employs" + Vendor ||--o{ Account : "owns" + + Staff ||--o{ Document : "has" + Staff ||--o{ Certificate : "holds" + Staff ||--o{ Contact : "has emergency" + Staff ||--o{ BenefitsData : "accrues" + Staff ||--o{ TaxForm : "submits" + Staff ||--o{ TimeSheet : "fills" + Staff ||--o{ Assignment : "receives" + Staff ||--o{ Account : "owns" + Staff ||--o{ RecentPayment : "is paid to" + Staff ||--o{ RequiredDoc : "owns" + Staff ||--o{ Application : "submits" + Hub ||--o{ Staff : "is based at" + + Shift ||--o{ TimeSheet : "generates" + Shift ||--o{ Application : "receives" + + "Order" ||--o{ Shift : "contains" + "Order" ||--o{ Position : "requires" + + Task ||--o{ TaskComment : "has" + + Team ||--o{ TeamMember : "has" + Team ||--o{ TeamHub : "operates in" + + Conversation ||--o{ Message : "contains" + + Position ||--o{ Schedule : "has" + Role ||--o{ Position : "is for" + + %% Join Tables + Staff ||--|{ StaffShift : "works" + Shift ||--|{ StaffShift : "is worked by" + Staff ||--|{ StaffCourse : "enrolls in" + Course ||--|{ StaffCourse : "is taken by" + TeamMember ||--|{ MemberTask : "assigned to" + Task ||--|{ MemberTask : "is assigned to" diff --git a/backend/dataconnect/docs/staff_app_diagram.mmd b/backend/dataconnect/docs/staff_app_diagram.mmd new file mode 100644 index 00000000..d251a18e --- /dev/null +++ b/backend/dataconnect/docs/staff_app_diagram.mmd @@ -0,0 +1,121 @@ +flowchart LR + +subgraph L1["login/create user"] + S_auth_phone["phone_verification_screen.dart"] + S_auth_phone --> S_auth_phone_Q["Queries
* user - getUserById
* staff - getStaffByUserId"] + S_auth_phone --> S_auth_phone_M["Mutations
* user - createUser"] + S_auth_phone --> S_auth_phone_F["Firebase
* user - auth"] +end + +subgraph L2["Profile"] + S_worker_profile["worker_profile_screen.dart"] + S_worker_profile --> S_worker_profile_Q["Queries
* user - getUserById
* staff - getStaffByUserId"] +end + +subgraph L3["Personal info"] + S_personal_info["personal_info_screen.dart"] + S_personal_info --> S_personal_info_Q["Queries
* staff - getStaffByUserId"] + S_personal_info --> S_personal_info_M["Mutations
* staff - UpdateStaff"] +end + +subgraph L4["Emergency Contact"] + S_emergency["emergency_contact_screen.dart"] + S_emergency --> S_emergency_Q["Queries
* contact - getContactsByStaffId"] + S_emergency --> S_emergency_M["Mutations
* contact - updateContact
* contact - createContact
* contact - deleteContact"] +end + +subgraph L5["Experience & skills"] + S_experience["experience_screen.dart"] + S_experience --> S_experience_Q["Queries
* staff - getStaffByUserId"] + S_experience --> S_experience_M["Mutations
* staff - UpdateStaff"] +end + +subgraph L6["Attire"] + S_attire["attire_screen.dart"] + S_attire --> S_attire_Q["Queries
* attireOption - listAttireOptions
* staff - getStaffByUserId"] + S_attire --> S_attire_M["Mutations
* staff - UpdateStaff"] +end + +subgraph L7["Documents"] + S_documents["documents_screen.dart"] + S_documents --> S_documents_Q["Queries
* document - getDocumentsByStaffId"] + S_documents --> S_documents_M["Mutations
* document - updateDocument"] +end + +subgraph L8["Certificates"] + S_certificates["certificates_screen.dart"] + S_certificates --> S_certificates_Q["Queries
* certificate - listCertificatesByStaffId"] + S_certificates --> S_certificates_M["Mutations
* certificate - UpdateCertificate
* certificate - CreateCertificate
* certificate - DeleteCertificate"] +end + +subgraph L9["Tax Documents"] + S_tax_forms["tax_forms_screen.dart"] + S_tax_forms --> S_tax_forms_Q["Queries
* taxForm - getTaxFormsBystaffId"] + S_tax_forms --> S_tax_forms_M["Mutations
* taxForm - createTaxForm
* taxForm - updateTaxForm"] +end + +subgraph L10["KROW University"] + S_uni["krow_university_screen.dart"] + S_uni --> S_uni_Q["Queries
* course - listCourses
* staffCourse - listStaffCoursesByStaffId
* staff - getStaffByUserId
* level - listLevels
* certificate - listCertificatesByStaffId"] +end + +subgraph L11["Trainings"] + S_trainings["trainings_screen.dart"] + S_trainings --> S_trainings_Q["Queries
* course - listCourses
* staffCourse - listStaffCoursesByStaffId"] +end + +subgraph L12["Leaderboard"] + S_leaderboard["leaderboard_screen.dart"] + S_leaderboard --> S_leaderboard_Q["Queries
* staffCourse - missing"] +end + +subgraph L13["Bank Account"] + S_bank["bank_account_screen.dart"] + S_bank --> S_bank_Q["Queries
* account - getAccountsByOwnerId"] + S_bank --> S_bank_M["Mutations
* account - createAccount
* account - updateAccount
* account - deleteAccount"] +end + +subgraph L14["Earnings/Payments"] + S_payments["payments_screen.dart"] + S_payments --> S_payments_Q["Queries
* recentPayment - getRecentPaymentsByPayedUserId"] +end + +subgraph L15["Timecard"] + S_timecard["time_card_screen.dart"] + S_timecard --> S_timecard_Q["Queries
* timeSheet - getTimeSheetsByStaffId"] +end + +subgraph L16["Clock in"] + S_clockin["clock_in_screen.dart"] + S_clockin --> S_clockin_Q["Queries
* application - getApplicationsByStaffId"] + S_clockin --> S_clockin_M["Mutations
* application - createApplication
* application - updateApplicationStatus"] +end + +subgraph L17["Shifts"] + S_shifts["shifts_screen.dart"] + S_shifts --> S_shifts_Q["Queries
* application - getApplicationsByStaffId
* shift - filterShifts
* timeSheet - getTimeSheetsByStaffId"] + S_shifts --> S_shifts_M["Mutations
* application - updateApplicationStatus
* shift - CreateShift
* application - createApplication
* staffShift - createStaffShift"] +end + +subgraph L18["My availability"] + S_availability["availability_screen.dart"] + S_availability --> S_availability_Q["Queries
* staffAvailability - getStaffAvailabilityByStaffId"] + S_availability --> S_availability_M["Mutations
* staffAvailability - updateStaffAvailability
* staffAvailability - createStaffAvailability
* staffAvailability - deleteStaffAvailability"] +end + +subgraph L19["Your Benefits Overview"] + S_benefits["benefits_screen.dart"] + S_benefits --> S_benefits_Q["Queries
* benefitsData - getBenefitsDataByStaffId"] + S_benefits --> S_benefits_M["Mutations
* benefitsData - updateBenefitsData"] +end + +subgraph L20["Home"] + S_home["worker_home_screen.dart"] + S_home --> S_home_Q["Queries
* application - getApplicationsByStaffId
* shift - filterShifts
* benefitsData - getBenefitsDataByStaffId"] +end + +subgraph L21["Shift detail"] + S_shift_detail["shift_details_screen.dart"] + S_shift_detail --> S_shift_detail_Q["Queries
* application - getApplicationsByStaffId"] + S_shift_detail --> S_shift_detail_M["Mutations
* application - updateApplicationStatus"] +end