Merge pull request #197 from Oloodi/prep-sprint-3-doc-05-update
chore: Update the sprint 3 document
This commit is contained in:
74
backend/dataconnect/docs/client_app_diagram.mmd
Normal file
74
backend/dataconnect/docs/client_app_diagram.mmd
Normal file
@@ -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<br/>* user - getUserById<br/>* business - getBusinessesByUserId"]
|
||||
S_client_sign_in --> S_client_sign_in_F["Firebase<br/>* 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<br/>* business - getBusinessesByUserId"]
|
||||
S_client_sign_up --> S_client_sign_up_M["Mutations<br/>* user - createUser<br/>* 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<br/>* business - updateBusiness"]
|
||||
end
|
||||
|
||||
subgraph C4["Profile"]
|
||||
S_client_settings["client_settings_screen.dart"]
|
||||
S_client_settings --> S_client_settings_Q["Queries<br/>* user - getUserById<br/>* business - getBusinessesByUserId"]
|
||||
end
|
||||
|
||||
subgraph C5["Hubs"]
|
||||
S_client_hubs["client_hubs_screen.dart"]
|
||||
S_client_hubs --> S_client_hubs_Q["Queries<br/>* hub - getHubsByOwnerId"]
|
||||
S_client_hubs --> S_client_hubs_M["Mutations<br/>* hub - createHub<br/>* hub - updateHub<br/>* hub - deleteHub"]
|
||||
end
|
||||
|
||||
subgraph C6["Orders"]
|
||||
S_client_shifts["client_shifts_screen.dart"]
|
||||
S_client_shifts --> S_client_shifts_Q["Queries<br/>* order - getOrdersByOwnerId"]
|
||||
end
|
||||
|
||||
subgraph C7["RAPID Order"]
|
||||
S_rapid_order["rapid_order_flow_page.dart"]
|
||||
S_rapid_order --> S_rapid_order_M["Mutations<br/>* 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<br/>* role - listRolesByOwnerId"]
|
||||
S_one_time --> S_one_time_M["Mutations<br/>* position - createPosition<br/>* order - createOrder"]
|
||||
end
|
||||
|
||||
subgraph C9["Permanent Placement"]
|
||||
S_permanent["permanent_order_flow_page.dart"]
|
||||
S_permanent --> S_permanent_Q["Queries<br/>* role - listRolesByOwnerId"]
|
||||
S_permanent --> S_permanent_M["Mutations<br/>* position - createPosition<br/>* order - createOrder"]
|
||||
end
|
||||
|
||||
subgraph C10["Recurring Order"]
|
||||
S_recurring["recurring_order_flow_page.dart"]
|
||||
S_recurring --> S_recurring_Q["Queries<br/>* role - listRolesByOwnerId"]
|
||||
S_recurring --> S_recurring_M["Mutations<br/>* position - createPosition<br/>* order - createOrder"]
|
||||
end
|
||||
|
||||
subgraph C11["Billing"]
|
||||
S_billing["client_billing_screen.dart"]
|
||||
S_billing --> S_billing_Q["Queries<br/>* account - getAccountsByOwnerId<br/>* invoice - getInvoicesByOwnerId<br/>* recentPayment - filterRecentPayments"]
|
||||
S_billing --> S_billing_M["Mutations<br/>* account - createAccount<br/>* account - updateAccount<br/>* account - deleteAccount"]
|
||||
end
|
||||
|
||||
subgraph C12["Coverage"]
|
||||
S_coverage["coverage_dashboard.dart"]
|
||||
S_coverage --> S_coverage_Q["Queries<br/>* order - getOrdersByOwnerId<br/>* shift - filterShifts<br/>* application - getApplicationsByShiftId"]
|
||||
end
|
||||
|
||||
subgraph C13["Home"]
|
||||
S_client_home["client_home_screen.dart"]
|
||||
S_client_home --> S_client_home_Q["Queries<br/>* order - getOrdersByOwnerId<br/>* shift - filterShifts<br/>* application - getApplicationsByShiftId<br/>* recentPayment - filterRecentPayments"]
|
||||
S_client_home --> S_client_home_M["Mutations<br/>* order - createOrder"]
|
||||
end
|
||||
@@ -0,0 +1,124 @@
|
||||
flowchart LR
|
||||
subgraph "Profile & Onboarding"
|
||||
User --> User_Q["Queries<br/>- listUsers<br/>- getUserById"]
|
||||
User --> User_M["Mutations<br/>- createUser<br/>- updateUser<br/>- deleteUser"]
|
||||
Staff --> Staff_Q["Queries<br/>- listStaff<br/>- getStaffById<br/>- getStaffByUserId"]
|
||||
Staff --> Staff_M["Mutations<br/>- createStaff<br/>- updateStaff<br/>- deleteStaff"]
|
||||
Contact --> Contact_Q["Queries<br/>- listContacts<br/>- getContactById<br/>- listContactsByStaffId"]
|
||||
Contact --> Contact_M["Mutations<br/>- createContact<br/>- updateContact<br/>- deleteContact"]
|
||||
AttireOption --> AttireOption_Q["Queries<br/>- listAttireOptions<br/>- getAttireOptionById"]
|
||||
AttireOption --> AttireOption_M["Mutations<br/>- createAttireOption<br/>- updateAttireOption<br/>- deleteAttireOption"]
|
||||
end
|
||||
|
||||
subgraph "Compliance"
|
||||
Document --> Document_Q["Queries<br/>- listDocuments<br/>- getDocumentById<br/>- listDocumentsByStaffId"]
|
||||
Document --> Document_M["Mutations<br/>- createDocument<br/>- updateDocument<br/>- deleteDocument"]
|
||||
Certificate --> Certificate_Q["Queries<br/>- listCertificates<br/>- getCertificateById<br/>- listCertificatesByStaffId"]
|
||||
Certificate --> Certificate_M["Mutations<br/>- CreateCertificate<br/>- UpdateCertificate<br/>- DeleteCertificate"]
|
||||
TaxForm --> TaxForm_Q["Queries<br/>- listTaxForms<br/>- getTaxFormById<br/>- getTaxFormsByStaffId<br/>- filterTaxForms"]
|
||||
TaxForm --> TaxForm_M["Mutations<br/>- createTaxForm<br/>- updateTaxForm<br/>- deleteTaxForm"]
|
||||
RequiredDoc --> RequiredDoc_Q["Queries<br/>- listRequiredDocs<br/>- getRequiredDocById<br/>- listRequiredDocsByUserId"]
|
||||
RequiredDoc --> RequiredDoc_M["Mutations<br/>- createRequiredDoc<br/>- updateRequiredDoc<br/>- deleteRequiredDoc"]
|
||||
end
|
||||
|
||||
subgraph "Finances"
|
||||
Account --> Account_Q["Queries<br/>- listAccounts<br/>- getAccountById<br/>- listAccountsByOwnerId"]
|
||||
Account --> Account_M["Mutations<br/>- createAccount<br/>- updateAccount<br/>- deleteAccount"]
|
||||
TimeSheet --> TimeSheet_Q["Queries<br/>- listTimeSheets<br/>- getTimeSheetById<br/>- listTimeSheetsByStaffId"]
|
||||
TimeSheet --> TimeSheet_M["Mutations<br/>- createTimeSheet<br/>- updateTimeSheet<br/>- deleteTimeSheet"]
|
||||
RecentPayment --> RecentPayment_Q["Queries<br/>- listRecentPayments<br/>- getRecentPaymentById<br/>- listRecentPaymentsByUserId"]
|
||||
RecentPayment --> RecentPayment_M["Mutations<br/>- createRecentPayment<br/>- updateRecentPayment<br/>- deleteRecentPayment"]
|
||||
Invoice --> Invoice_Q["Queries<br/>- listInvoices<br/>- getInvoiceById"]
|
||||
Invoice --> Invoice_M["Mutations<br/>- createInvoice<br/>- updateInvoice<br/>- deleteInvoice"]
|
||||
InvoiceTemplate --> InvoiceTemplate_Q["Queries<br/>- listInvoiceTemplates<br/>- getInvoiceTemplateById"]
|
||||
InvoiceTemplate --> InvoiceTemplate_M["Mutations<br/>- createInvoiceTemplate<br/>- updateInvoiceTemplate<br/>- deleteInvoiceTemplate"]
|
||||
VendorRate --> VendorRate_Q["Queries<br/>- listVendorRates<br/>- getVendorRateById"]
|
||||
VendorRate --> VendorRate_M["Mutations<br/>- createVendorRate<br/>- updateVendorRate<br/>- deleteVendorRate"]
|
||||
CustomRateCard --> CustomRateCard_Q["Queries<br/>- listCustomRateCards<br/>- getCustomRateCardById"]
|
||||
CustomRateCard --> CustomRateCard_M["Mutations<br/>- createCustomRateCard<br/>- updateCustomRateCard<br/>- deleteCustomRateCard"]
|
||||
end
|
||||
|
||||
subgraph "Shifts & Work"
|
||||
Shift --> Shift_Q["Queries<br/>- listShifts<br/>- getShiftById<br/>- filterShifts"]
|
||||
Shift --> Shift_M["Mutations<br/>- CreateShift<br/>- UpdateShift<br/>- DeleteShift"]
|
||||
Application --> Application_Q["Queries<br/>- getApplicationById<br/>- listApplicationsByStaffId"]
|
||||
Application --> Application_M["Mutations<br/>- createApplication<br/>- updateApplication<br/>- deleteApplication"]
|
||||
StaffShift --> StaffShift_Q["Queries<br/>- getMyShifts<br/>- getStaffShiftById<br/>- getStaffShiftsByShiftId"]
|
||||
StaffShift --> StaffShift_M["Mutations<br/>- createStaffShift<br/>- updateStaffShift<br/>- deleteStaffShift"]
|
||||
StaffAvailability --> StaffAvailability_Q["Queries<br/>- listStaffAvailabilities<br/>- getStaffAvailabilityById<br/>- getStaffAvailabilityByStaffId"]
|
||||
StaffAvailability --> StaffAvailability_M["Mutations<br/>- createStaffAvailability<br/>- updateStaffAvailability<br/>- deleteStaffAvailability"]
|
||||
Assignment --> Assignment_Q["Queries<br/>- listAssignments<br/>- getAssignmentById<br/>- listAssignmentsByStaffId"]
|
||||
Assignment --> Assignment_M["Mutations<br/>- CreateAssignment<br/>- UpdateAssignment<br/>- DeleteAssignment"]
|
||||
Order --> Order_Q["Queries<br/>- listOrders<br/>- getOrderById"]
|
||||
Order --> Order_M["Mutations<br/>- createOrder<br/>- updateOrder<br/>- deleteOrder"]
|
||||
Position --> Position_Q["Queries<br/>- listPositions<br/>- getPositionById<br/>- listPositionsByOrderId"]
|
||||
Position --> Position_M["Mutations<br/>- createPosition<br/>- updatePosition<br/>- deletePosition"]
|
||||
Category --> Category_Q["Queries<br/>- listCategories<br/>- getCategoryById"]
|
||||
Category --> Category_M["Mutations<br/>- createCategory<br/>- updateCategory<br/>- deleteCategory"]
|
||||
Role --> Role_Q["Queries<br/>- listRoles<br/>- getRoleById"]
|
||||
Role --> Role_M["Mutations<br/>- createRole<br/>- updateRole<br/>- deleteRole"]
|
||||
RoleCategory --> RoleCategory_Q["Queries<br/>- listRoleCategories<br/>- getRoleCategoryById"]
|
||||
RoleCategory --> RoleCategory_M["Mutations<br/>- createRoleCategory<br/>- updateRoleCategory<br/>- deleteRoleCategory"]
|
||||
Schedule --> Schedule_Q["Queries<br/>- listSchedules<br/>- getScheduleById<br/>- getScheduleByPositionId"]
|
||||
Schedule --> Schedule_M["Mutations<br/>- createSchedule<br/>- updateSchedule<br/>- deleteSchedule"]
|
||||
Workforce --> Workforce_Q["Queries"]
|
||||
Workforce --> Workforce_M["Mutations"]
|
||||
end
|
||||
|
||||
subgraph "Learning"
|
||||
Course --> Course_Q["Queries<br/>- listCourses<br/>- getCourseById<br/>- filterCourses"]
|
||||
Course --> Course_M["Mutations<br/>- createCourse<br/>- updateCourse<br/>- deleteCourse"]
|
||||
Level --> Level_Q["Queries<br/>- listLevels<br/>- getLevelById"]
|
||||
Level --> Level_M["Mutations<br/>- createLevel<br/>- updateLevel<br/>- deleteLevel"]
|
||||
StaffCourse --> StaffCourse_Q["Queries<br/>- getStaffCourseById<br/>- listStaffCoursesByStaffId<br/>- listStaffCoursesByCourseId<br/>- getStaffCourseByStaffAndCourse"]
|
||||
StaffCourse --> StaffCourse_M["Mutations<br/>- createStaffCourse<br/>- updateStaffCourse<br/>- deleteStaffCourse"]
|
||||
end
|
||||
|
||||
subgraph "Benefits"
|
||||
BenefitsData --> BenefitsData_Q["Queries<br/>- listBenefitsData<br/>- getBenefitsDataById<br/>- getBenefitsDataByStaffId"]
|
||||
BenefitsData --> BenefitsData_M["Mutations<br/>- createBenefitsData<br/>- updateBenefitsData<br/>- deleteBenefitsData"]
|
||||
end
|
||||
|
||||
subgraph "Business & Vendors"
|
||||
Business --> Business_Q["Queries<br/>- listBusinesses<br/>- getBusinessById<br/>- getBusinessesByUserId"]
|
||||
Business --> Business_M["Mutations<br/>- createBusiness<br/>- updateBusiness<br/>- deleteBusiness"]
|
||||
Vendor --> Vendor_Q["Queries<br/>- listVendors<br/>- getVendorById"]
|
||||
Vendor --> Vendor_M["Mutations<br/>- createVendor<br/>- updateVendor<br/>- deleteVendor"]
|
||||
Hub --> Hub_Q["Queries<br/>- listHubs<br/>- getHubById"]
|
||||
Hub --> Hub_M["Mutations<br/>- createHub<br/>- updateHub<br/>- deleteHub"]
|
||||
end
|
||||
|
||||
subgraph "Teams"
|
||||
Team --> Team_Q["Queries<br/>- listTeams<br/>- getTeamById"]
|
||||
Team --> Team_M["Mutations<br/>- createTeam<br/>- updateTeam<br/>- deleteTeam"]
|
||||
TeamMember --> TeamMember_Q["Queries<br/>- listTeamMembers<br/>- getTeamMemberById<br/>- listTeamMembersByTeamId"]
|
||||
TeamMember --> TeamMember_M["Mutations<br/>- createTeamMember<br/>- updateTeamMember<br/>- deleteTeamMember"]
|
||||
MemberTask --> MemberTask_Q["Queries<br/>- getMyTasks<br/>- getMemberTaskById<br/>- getMemberTasksByTaskId"]
|
||||
MemberTask --> MemberTask_M["Mutations<br/>- createMemberTask<br/>- updateMemberTask<br/>- deleteMemberTask"]
|
||||
TeamHub --> TeamHub_Q["Queries<br/>- listTeamHubs<br/>- getTeamHubById<br/>- listTeamHubsByTeamId"]
|
||||
TeamHub --> TeamHub_M["Mutations<br/>- createTeamHub<br/>- updateTeamHub<br/>- deleteTeamHub"]
|
||||
Task --> Task_Q["Queries<br/>- listTasks<br/>- getTaskById"]
|
||||
Task --> Task_M["Mutations<br/>- createTask<br/>- updateTask<br/>- deleteTask"]
|
||||
TaskComment --> TaskComment_Q["Queries<br/>- listTaskComments<br/>- getTaskCommentById<br/>- listTaskCommentsByTaskId"]
|
||||
TaskComment --> TaskComment_M["Mutations<br/>- createTaskComment<br/>- updateTaskComment<br/>- deleteTaskComment"]
|
||||
end
|
||||
|
||||
subgraph "Communication"
|
||||
Conversation --> Conversation_Q["Queries<br/>- listConversations<br/>- getConversationById<br/>- getConversationsByUserId"]
|
||||
Conversation --> Conversation_M["Mutations<br/>- createConversation<br/>- updateConversation<br/>- deleteConversation"]
|
||||
Message --> Message_Q["Queries<br/>- listMessages<br/>- getMessageById<br/>- listMessagesByConversationId"]
|
||||
Message --> Message_M["Mutations<br/>- createMessage<br/>- updateMessage<br/>- deleteMessage"]
|
||||
end
|
||||
|
||||
subgraph "Others"
|
||||
ActivityLog --> ActivityLog_Q["Queries<br/>- listActivityLogs<br/>- getActivityLogById<br/>- listActivityLogsByUserId"]
|
||||
ActivityLog --> ActivityLog_M["Mutations<br/>- createActivityLog<br/>- updateActivityLog<br/>- deleteActivityLog"]
|
||||
ClientFeedback --> ClientFeedback_Q["Queries<br/>- listClientFeedbacks<br/>- getClientFeedbackById"]
|
||||
ClientFeedback --> ClientFeedback_M["Mutations<br/>- createClientFeedback<br/>- updateClientFeedback<br/>- deleteClientFeedback"]
|
||||
FaqData --> FaqData_Q["Queries<br/>- listFaqDatas<br/>- getFaqDataById"]
|
||||
FaqData --> FaqData_M["Mutations<br/>- createFaqData<br/>- updateFaqData<br/>- deleteFaqData"]
|
||||
end
|
||||
|
||||
subgraph "Reporting"
|
||||
Reports --> Reports_Q["Queries<br/>- getCoverageReport<br/>- getNoShowReport<br/>- getSpendReport<br/>- getForecastReport<br/>- getPerformanceReport<br/>- getDailyOpsReport"]
|
||||
end
|
||||
271
backend/dataconnect/docs/dataconnect.mmd
Normal file
271
backend/dataconnect/docs/dataconnect.mmd
Normal file
@@ -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"
|
||||
121
backend/dataconnect/docs/staff_app_diagram.mmd
Normal file
121
backend/dataconnect/docs/staff_app_diagram.mmd
Normal file
@@ -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<br/>* user - getUserById<br/>* staff - getStaffByUserId"]
|
||||
S_auth_phone --> S_auth_phone_M["Mutations<br/>* user - createUser"]
|
||||
S_auth_phone --> S_auth_phone_F["Firebase<br/>* user - auth"]
|
||||
end
|
||||
|
||||
subgraph L2["Profile"]
|
||||
S_worker_profile["worker_profile_screen.dart"]
|
||||
S_worker_profile --> S_worker_profile_Q["Queries<br/>* user - getUserById<br/>* staff - getStaffByUserId"]
|
||||
end
|
||||
|
||||
subgraph L3["Personal info"]
|
||||
S_personal_info["personal_info_screen.dart"]
|
||||
S_personal_info --> S_personal_info_Q["Queries<br/>* staff - getStaffByUserId"]
|
||||
S_personal_info --> S_personal_info_M["Mutations<br/>* staff - UpdateStaff"]
|
||||
end
|
||||
|
||||
subgraph L4["Emergency Contact"]
|
||||
S_emergency["emergency_contact_screen.dart"]
|
||||
S_emergency --> S_emergency_Q["Queries<br/>* contact - getContactsByStaffId"]
|
||||
S_emergency --> S_emergency_M["Mutations<br/>* contact - updateContact<br/>* contact - createContact<br/>* contact - deleteContact"]
|
||||
end
|
||||
|
||||
subgraph L5["Experience & skills"]
|
||||
S_experience["experience_screen.dart"]
|
||||
S_experience --> S_experience_Q["Queries<br/>* staff - getStaffByUserId"]
|
||||
S_experience --> S_experience_M["Mutations<br/>* staff - UpdateStaff"]
|
||||
end
|
||||
|
||||
subgraph L6["Attire"]
|
||||
S_attire["attire_screen.dart"]
|
||||
S_attire --> S_attire_Q["Queries<br/>* attireOption - listAttireOptions<br/>* staff - getStaffByUserId"]
|
||||
S_attire --> S_attire_M["Mutations<br/>* staff - UpdateStaff"]
|
||||
end
|
||||
|
||||
subgraph L7["Documents"]
|
||||
S_documents["documents_screen.dart"]
|
||||
S_documents --> S_documents_Q["Queries<br/>* document - getDocumentsByStaffId"]
|
||||
S_documents --> S_documents_M["Mutations<br/>* document - updateDocument"]
|
||||
end
|
||||
|
||||
subgraph L8["Certificates"]
|
||||
S_certificates["certificates_screen.dart"]
|
||||
S_certificates --> S_certificates_Q["Queries<br/>* certificate - listCertificatesByStaffId"]
|
||||
S_certificates --> S_certificates_M["Mutations<br/>* certificate - UpdateCertificate<br/>* certificate - CreateCertificate<br/>* certificate - DeleteCertificate"]
|
||||
end
|
||||
|
||||
subgraph L9["Tax Documents"]
|
||||
S_tax_forms["tax_forms_screen.dart"]
|
||||
S_tax_forms --> S_tax_forms_Q["Queries<br/>* taxForm - getTaxFormsBystaffId"]
|
||||
S_tax_forms --> S_tax_forms_M["Mutations<br/>* taxForm - createTaxForm<br/>* taxForm - updateTaxForm"]
|
||||
end
|
||||
|
||||
subgraph L10["KROW University"]
|
||||
S_uni["krow_university_screen.dart"]
|
||||
S_uni --> S_uni_Q["Queries<br/>* course - listCourses<br/>* staffCourse - listStaffCoursesByStaffId<br/>* staff - getStaffByUserId<br/>* level - listLevels<br/>* certificate - listCertificatesByStaffId"]
|
||||
end
|
||||
|
||||
subgraph L11["Trainings"]
|
||||
S_trainings["trainings_screen.dart"]
|
||||
S_trainings --> S_trainings_Q["Queries<br/>* course - listCourses<br/>* staffCourse - listStaffCoursesByStaffId"]
|
||||
end
|
||||
|
||||
subgraph L12["Leaderboard"]
|
||||
S_leaderboard["leaderboard_screen.dart"]
|
||||
S_leaderboard --> S_leaderboard_Q["Queries<br/>* staffCourse - missing"]
|
||||
end
|
||||
|
||||
subgraph L13["Bank Account"]
|
||||
S_bank["bank_account_screen.dart"]
|
||||
S_bank --> S_bank_Q["Queries<br/>* account - getAccountsByOwnerId"]
|
||||
S_bank --> S_bank_M["Mutations<br/>* account - createAccount<br/>* account - updateAccount<br/>* account - deleteAccount"]
|
||||
end
|
||||
|
||||
subgraph L14["Earnings/Payments"]
|
||||
S_payments["payments_screen.dart"]
|
||||
S_payments --> S_payments_Q["Queries<br/>* recentPayment - getRecentPaymentsByPayedUserId"]
|
||||
end
|
||||
|
||||
subgraph L15["Timecard"]
|
||||
S_timecard["time_card_screen.dart"]
|
||||
S_timecard --> S_timecard_Q["Queries<br/>* timeSheet - getTimeSheetsByStaffId"]
|
||||
end
|
||||
|
||||
subgraph L16["Clock in"]
|
||||
S_clockin["clock_in_screen.dart"]
|
||||
S_clockin --> S_clockin_Q["Queries<br/>* application - getApplicationsByStaffId"]
|
||||
S_clockin --> S_clockin_M["Mutations<br/>* application - createApplication<br/>* application - updateApplicationStatus"]
|
||||
end
|
||||
|
||||
subgraph L17["Shifts"]
|
||||
S_shifts["shifts_screen.dart"]
|
||||
S_shifts --> S_shifts_Q["Queries<br/>* application - getApplicationsByStaffId<br/>* shift - filterShifts<br/>* timeSheet - getTimeSheetsByStaffId"]
|
||||
S_shifts --> S_shifts_M["Mutations<br/>* application - updateApplicationStatus<br/>* shift - CreateShift<br/>* application - createApplication<br/>* staffShift - createStaffShift"]
|
||||
end
|
||||
|
||||
subgraph L18["My availability"]
|
||||
S_availability["availability_screen.dart"]
|
||||
S_availability --> S_availability_Q["Queries<br/>* staffAvailability - getStaffAvailabilityByStaffId"]
|
||||
S_availability --> S_availability_M["Mutations<br/>* staffAvailability - updateStaffAvailability<br/>* staffAvailability - createStaffAvailability<br/>* staffAvailability - deleteStaffAvailability"]
|
||||
end
|
||||
|
||||
subgraph L19["Your Benefits Overview"]
|
||||
S_benefits["benefits_screen.dart"]
|
||||
S_benefits --> S_benefits_Q["Queries<br/>* benefitsData - getBenefitsDataByStaffId"]
|
||||
S_benefits --> S_benefits_M["Mutations<br/>* benefitsData - updateBenefitsData"]
|
||||
end
|
||||
|
||||
subgraph L20["Home"]
|
||||
S_home["worker_home_screen.dart"]
|
||||
S_home --> S_home_Q["Queries<br/>* application - getApplicationsByStaffId<br/>* shift - filterShifts<br/>* benefitsData - getBenefitsDataByStaffId"]
|
||||
end
|
||||
|
||||
subgraph L21["Shift detail"]
|
||||
S_shift_detail["shift_details_screen.dart"]
|
||||
S_shift_detail --> S_shift_detail_Q["Queries<br/>* application - getApplicationsByStaffId"]
|
||||
S_shift_detail --> S_shift_detail_M["Mutations<br/>* application - updateApplicationStatus"]
|
||||
end
|
||||
@@ -170,8 +170,10 @@ graph TB
|
||||
krow-workforce-web/
|
||||
├── apps/
|
||||
│ ├── web-dashboard/ # Vite + React
|
||||
│ ├── mobile-client/ # Flutter (business app)
|
||||
│ └── mobile-staff/ # Flutter (worker app)
|
||||
│ ├── mobile/
|
||||
| | ├── apps/
|
||||
| | │ ├── client/ # Flutter (business app)
|
||||
| | │ └── worker/ # Flutter (worker app)
|
||||
├── backend/
|
||||
│ ├── dataconnect/ # Firebase Data Connect schemas
|
||||
│ └── functions/ # Cloud Functions
|
||||
@@ -310,7 +312,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 +320,12 @@ sequenceDiagram
|
||||
Client->>API: Publish Event
|
||||
API-->>Client: Event Published
|
||||
|
||||
Note over Admin,API: 2. Staff Assignment
|
||||
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 +341,7 @@ sequenceDiagram
|
||||
Client->>API: Rate Staff
|
||||
API->>API: Generate Invoice
|
||||
Client->>API: Approve Invoice
|
||||
|
||||
```
|
||||
|
||||
#### Workflow 2: Staff Onboarding
|
||||
@@ -370,6 +375,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
|
||||
|
||||
```
|
||||
@@ -658,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):**
|
||||
|
||||
@@ -695,9 +706,9 @@ 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/`
|
||||
**Location:** `internal/launchpad/prototypes-src/mobile/apps/worker/`
|
||||
|
||||
**Routes (35+ screens):**
|
||||
|
||||
@@ -797,9 +808,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 |
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user