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/>* emergencyContact - getEmergencyContactsByStaffId"]
  S_emergency --> S_emergency_M["Mutations<br/>* conemergencyContacttact - updateEmergencyContact<br/>* emergencyContact - createEmergencyContact<br/>* contemergencyContactact - deleteEmergencyContact"]
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 - filterAttireOptions<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 - listDocuments<br/>* staffDocument - listStaffDocumentsByStaffId"]
  S_documents --> S_documents_M["Mutations<br/>* staffDocument - updateStaffDocument<br/>* staffDocument - createStaffDocument"]
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 - listRecentPaymentsByStaffId"]
end

subgraph L15["Timecard"]
  S_timecard["time_card_screen.dart"]
  S_timecard --> S_timecard_Q["Queries<br/>* application - getApplicationsByStaffId"]
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/>* shiftRole - listShiftRolesByVendorId/listShiftRolesByRoleId<br/>* application - getApplicationsByStaffId"]
  S_shifts --> S_shifts_M["Mutations<br/>* application - updateApplicationStatus<br/>* application - createApplication"]
end

subgraph L18["My availability"]
  S_availability["availability_screen.dart"]
  S_availability --> S_availability_Q["Queries<br/>* staffAvailability - listStaffAvailabilitiesByStaffId/getStaffAvailabilityByKey"]
  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 - listBenefitsDataByStaffId"]
  S_benefits --> S_benefits_M["Mutations<br/>* benefitsData - updateBenefitsData<br/>* benefitsData - createBenefitsData"]
end

subgraph L20["Home"]
  S_home["worker_home_screen.dart"]
  S_home --> S_home_Q["Queries<br/>* application - getApplicationsByStaffId<br/>* shiftRole - listShiftRolesByVendorId/listShiftRolesByRoleId<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
