diff --git a/apps/mobile/apps/client/lib/firebase_options.dart b/apps/mobile/apps/client/lib/firebase_options.dart index 01fa9ae4..08a57ddc 100644 --- a/apps/mobile/apps/client/lib/firebase_options.dart +++ b/apps/mobile/apps/client/lib/firebase_options.dart @@ -1,9 +1,8 @@ -// File generated by Krow Coding Agent to fix Web Runtime Error. -// Please update the appId for Web with the correct value from Firebase Console. +// File generated by FlutterFire CLI. import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; import 'package:flutter/foundation.dart' - show kIsWeb; + show defaultTargetPlatform, kIsWeb, TargetPlatform; /// Default [FirebaseOptions] for use with your Firebase apps. /// @@ -20,19 +19,56 @@ class DefaultFirebaseOptions { if (kIsWeb) { return web; } - throw UnsupportedError( - 'DefaultFirebaseOptions are not supported for this platform.', - ); + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } } static const FirebaseOptions web = FirebaseOptions( apiKey: 'AIzaSyBqRtZPMGU-Sz5x5UnRrunKu5NSWYyPRn8', - // TODO: STOP! You must replace this placeholder with the actual Web App ID from your Firebase Console. - // Go to Project Settings -> General -> Your apps -> Web App -> appId - appId: '1:933560802882:web:173a841992885bb27757db', + appId: '1:933560802882:web:173a841992885bb27757db', messagingSenderId: '933560802882', projectId: 'krow-workforce-dev', authDomain: 'krow-workforce-dev.firebaseapp.com', storageBucket: 'krow-workforce-dev.firebasestorage.app', ); + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4', + appId: '1:933560802882:android:da13569105659ead7757db', + messagingSenderId: '933560802882', + projectId: 'krow-workforce-dev', + storageBucket: 'krow-workforce-dev.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyDyEXkzZAWpXXe4dAesYaZflt5BEtMn9tA', + appId: '1:933560802882:ios:d2b6d743608e2a527757db', + messagingSenderId: '933560802882', + projectId: 'krow-workforce-dev', + storageBucket: 'krow-workforce-dev.firebasestorage.app', + iosBundleId: 'com.krowwithus.client', + ); } diff --git a/apps/mobile/apps/staff/lib/firebase_options.dart b/apps/mobile/apps/staff/lib/firebase_options.dart index 6062a65b..343d9f5e 100644 --- a/apps/mobile/apps/staff/lib/firebase_options.dart +++ b/apps/mobile/apps/staff/lib/firebase_options.dart @@ -1,9 +1,8 @@ -// File generated by Krow Coding Agent to fix Web Runtime Error. -// Please update the appId for Web with the correct value from Firebase Console. +// File generated by FlutterFire CLI. import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; import 'package:flutter/foundation.dart' - show kIsWeb; + show defaultTargetPlatform, kIsWeb, TargetPlatform; /// Default [FirebaseOptions] for use with your Firebase apps. /// @@ -20,17 +19,56 @@ class DefaultFirebaseOptions { if (kIsWeb) { return web; } - throw UnsupportedError( - 'DefaultFirebaseOptions are not supported for this platform.', - ); + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } } static const FirebaseOptions web = FirebaseOptions( apiKey: 'AIzaSyBqRtZPMGU-Sz5x5UnRrunKu5NSWYyPRn8', - appId: '1:933560802882:web:4508ef1ee6d4e6907757db', + appId: '1:933560802882:web:4508ef1ee6d4e6907757db', messagingSenderId: '933560802882', projectId: 'krow-workforce-dev', authDomain: 'krow-workforce-dev.firebaseapp.com', storageBucket: 'krow-workforce-dev.firebasestorage.app', ); + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4', + appId: '1:933560802882:android:d49b8c0f4d19e95e7757db', + messagingSenderId: '933560802882', + projectId: 'krow-workforce-dev', + storageBucket: 'krow-workforce-dev.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyDyEXkzZAWpXXe4dAesYaZflt5BEtMn9tA', + appId: '1:933560802882:ios:fa584205b356de937757db', + messagingSenderId: '933560802882', + projectId: 'krow-workforce-dev', + storageBucket: 'krow-workforce-dev.firebasestorage.app', + iosBundleId: 'com.krowwithus.staff', + ); } diff --git a/docs/QA_TESTING_CHECKLIST.md b/docs/QA_TESTING_CHECKLIST.md new file mode 100644 index 00000000..aedccbc1 --- /dev/null +++ b/docs/QA_TESTING_CHECKLIST.md @@ -0,0 +1,1665 @@ +# ๐Ÿงช KROW Workforce Platform - QA Testing Checklist + +**Version:** 1.0 +**Date:** February 1, 2026 +**Coverage:** Client App + Staff App +**Purpose:** Manual QA and Regression Testing + +--- + +## ๐Ÿ“‹ TABLE OF CONTENTS + +1. [Feature-Level QA Checklist](#1๏ธโƒฃ-feature-level-qa-checklist) + - [Client App Features](#client-app-features) + - [Staff App Features](#staff-app-features) +2. [Cross-Application Test Scenarios](#2๏ธโƒฃ-cross-application-test-scenarios) +3. [Shared Infrastructure Validation](#3๏ธโƒฃ-shared-infrastructure-validation) +4. [Regression & Release Checklist](#4๏ธโƒฃ-regression--release-checklist) + +--- + +## 1๏ธโƒฃ FEATURE-LEVEL QA CHECKLIST + +### CLIENT APP FEATURES + +--- + +#### ๐Ÿ“ฑ CLIENT-001: Authentication + +**Applications:** Client +**Entry Points:** +- Launch app โ†’ Get Started โ†’ Sign In +- Launch app โ†’ Get Started โ†’ Sign Up + +**Happy Path Test Cases:** +- [ ] Sign in with valid email and password displays home dashboard +- [ ] Sign up with business details creates account and navigates to home +- [ ] Sign in with Google OAuth completes authentication flow +- [ ] Sign in with Apple OAuth completes authentication flow +- [ ] Session persists after app restart + +**Validation & Error States:** +- [ ] Invalid email format shows validation error +- [ ] Incorrect password shows authentication error +- [ ] Weak password in sign-up shows strength requirements +- [ ] Duplicate email in sign-up shows "already registered" error +- [ ] Empty fields show required field errors +- [ ] Network error displays retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays during authentication +- [ ] OAuth redirect shows appropriate loading state +- [ ] Backend timeout shows error message + +**State Persistence:** +- [ ] Authenticated session persists after app background โ†’ foreground +- [ ] Session expires appropriately after logout +- [ ] Device restart maintains logged-in state + +**Backend Dependency Validation:** +- [ ] `getUserById` returns user data for authenticated UID +- [ ] `createBusiness` successfully creates business entity +- [ ] `createUser` links user to business +- [ ] `getBusinessesByUserId` retrieves business profile +- [ ] Failed business creation triggers `deleteBusiness` rollback + +--- + +#### ๐Ÿ“ฑ CLIENT-002: Home Dashboard + +**Applications:** Client +**Entry Points:** +- Home tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Dashboard displays current day coverage widget +- [ ] Spending analytics widget shows correct totals +- [ ] Recent reorders display completed shift roles +- [ ] Quick action buttons navigate to correct features +- [ ] Drag-and-drop widget reordering works correctly +- [ ] Dashboard refreshes on pull-to-refresh gesture + +**Validation & Error States:** +- [ ] Empty state shows "No data available" when no orders exist +- [ ] API error shows retry option +- [ ] Negative spending values display correctly + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching data +- [ ] Empty coverage shows "No shifts today" +- [ ] Empty reorders shows "No recent orders" + +**State Persistence:** +- [ ] Widget order persists after app restart +- [ ] Dashboard data refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] `getCompletedShiftsByBusinessId` returns spending data for date ranges +- [ ] `listShiftRolesByBusinessAndDateRange` returns coverage stats +- [ ] `listShiftRolesByBusinessDateRangeCompletedOrders` returns reorder suggestions +- [ ] Business ID correctly retrieved from session + +--- + +#### ๐Ÿ“ฑ CLIENT-003: Create Order + +**Applications:** Client +**Entry Points:** +- Home โ†’ Create Order button +- Orders tab โ†’ + FAB button +- Order type โ†’ Rapid / One-Time / Recurring / Permanent + +**Happy Path Test Cases:** +- [ ] Order type selection displays all available types +- [ ] Hub selection shows list of business hubs +- [ ] Google Places autocomplete suggests valid addresses +- [ ] Role selection displays vendor roles +- [ ] Position quantity can be incremented/decremented (min 1) +- [ ] Date picker displays correct calendar +- [ ] Time pickers show valid time ranges +- [ ] Break duration affects total hours calculation +- [ ] Cost preview calculates correctly (rate ร— positions ร— hours) +- [ ] Order submission creates order, shift, and shift roles +- [ ] Success confirmation displays after submission +- [ ] New order appears in View Orders list + +**Validation & Error States:** +- [ ] Empty hub field shows validation error +- [ ] Empty role field shows validation error +- [ ] Zero positions shows validation error +- [ ] Invalid date (past) shows validation error +- [ ] Start time after end time shows validation error +- [ ] Missing required fields prevent submission +- [ ] Network error during submission shows retry option +- [ ] Backend validation errors display appropriately + +**Loading & Empty States:** +- [ ] Hub list shows "No hubs" if none exist +- [ ] Role list shows "No roles" if none configured +- [ ] Loading spinner displays during submission +- [ ] Submission progress indicator updates + +**State Persistence:** +- [ ] Form data persists when navigating away and back +- [ ] Draft order data clears after successful submission + +**Backend Dependency Validation:** +- [ ] `createOrder` creates order with ONE_TIME type +- [ ] `createShift` creates shift with location and time details +- [ ] `createShiftRole` creates positions with correct rates +- [ ] `updateOrder` links shift to order +- [ ] All operations complete or rollback on failure + +--- + +#### ๐Ÿ“ฑ CLIENT-004: View Orders + +**Applications:** Client +**Entry Points:** +- Orders tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Orders list displays orders for selected date +- [ ] Calendar date selection updates order list +- [ ] Each order card shows hub name and address +- [ ] Each order card shows shift time range +- [ ] Each order card shows role positions (filled/total) +- [ ] Each order card shows hourly rate and total cost +- [ ] Accepted applications section displays confirmed staff +- [ ] Staff names and photos display correctly +- [ ] Order list scrolls smoothly with many orders + +**Validation & Error States:** +- [ ] Invalid date selection shows error +- [ ] Network error shows retry option +- [ ] Missing staff data shows placeholder + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching orders +- [ ] Empty date shows "No orders for this date" +- [ ] Empty accepted applications shows "No confirmed staff" + +**State Persistence:** +- [ ] Selected date persists after navigating away +- [ ] Order list refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] `listShiftRolesByBusinessAndDateRange` returns orders for date range +- [ ] `listAcceptedApplicationsByBusinessForDay` returns confirmed staff +- [ ] Business ID correctly filtered in queries + +--- + +#### ๐Ÿ“ฑ CLIENT-005: Coverage Monitoring + +**Applications:** Client +**Entry Points:** +- Coverage tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Coverage overview displays current date +- [ ] Coverage stats show needed/confirmed/checked-in counts +- [ ] Shift cards display hub name and time range +- [ ] Worker cards show staff name and photo +- [ ] Check-in status indicators update correctly (late, en-route, checked-in) +- [ ] Late workers display with warning indicator +- [ ] Coverage progress bar updates correctly + +**Validation & Error States:** +- [ ] Missing worker photo shows default avatar +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching data +- [ ] Empty coverage shows "No shifts today" +- [ ] No workers show "No staff assigned" + +**State Persistence:** +- [ ] Coverage data refreshes automatically every X minutes +- [ ] Manual refresh via pull-to-refresh gesture + +**Backend Dependency Validation:** +- [ ] `listShiftRolesByBusinessAndDateRange` returns shift requirements +- [ ] `listStaffsApplicationsByBusinessForDay` returns staff status +- [ ] Attendance status correctly mapped from backend + +--- + +#### ๐Ÿ“ฑ CLIENT-006: Billing & Invoices + +**Applications:** Client +**Entry Points:** +- Billing tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Current bill amount displays correctly +- [ ] Pending invoices list shows open invoices +- [ ] Invoice history shows paid invoices +- [ ] Savings amount displays correctly +- [ ] Spending breakdown shows costs by role +- [ ] Period filter (weekly/monthly) updates data +- [ ] Invoice detail view shows line items +- [ ] Invoice PDF download works (if implemented) + +**Validation & Error States:** +- [ ] Zero billing shows $0.00 (not error) +- [ ] Negative savings shows correctly +- [ ] Missing invoice data shows placeholder +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching data +- [ ] Empty pending invoices shows "No pending invoices" +- [ ] Empty history shows "No invoice history" +- [ ] Empty spending breakdown shows "No spending data" + +**State Persistence:** +- [ ] Selected period persists after navigating away +- [ ] Billing data refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] `listInvoicesByBusinessId` returns invoice records +- [ ] `listShiftRolesByBusinessAndDatesSummary` returns spending aggregates +- [ ] Period date range correctly calculated +- [ ] Business ID correctly filtered + +--- + +#### ๐Ÿ“ฑ CLIENT-007: Hub Management + +**Applications:** Client +**Entry Points:** +- Settings โ†’ Hubs +- Create Order โ†’ Add Hub button + +**Happy Path Test Cases:** +- [ ] Hubs list displays all business hubs +- [ ] Hub cards show name and full address +- [ ] Add hub button opens creation form +- [ ] Google Places autocomplete suggests addresses +- [ ] Address selection auto-fills all address fields +- [ ] Hub name can be customized +- [ ] Hub creation adds to list immediately +- [ ] Hub deletion removes from list (with confirmation) +- [ ] Team entity auto-created for business if missing + +**Validation & Error States:** +- [ ] Empty hub name shows validation error +- [ ] Empty address shows validation error +- [ ] Invalid address format shows error +- [ ] Duplicate hub name shows warning +- [ ] Hub with active orders prevents deletion (validation error) +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching hubs +- [ ] Empty hubs list shows "No hubs configured" +- [ ] Address autocomplete shows loading during search +- [ ] Hub creation shows loading spinner + +**State Persistence:** +- [ ] Hub list refreshes after creation/deletion +- [ ] Hub data persists across app sessions + +**Backend Dependency Validation:** +- [ ] `getBusinessesByUserId` retrieves business ID +- [ ] `getTeamsByOwnerId` checks for existing team +- [ ] `createTeam` creates team if missing +- [ ] `getTeamHubsByTeamId` fetches hub list +- [ ] `createTeamHub` creates hub with geocoded data +- [ ] `deleteTeamHub` removes hub entity +- [ ] `listOrdersByBusinessAndTeamHub` validates no active orders +- [ ] Google Places API returns valid address components + +--- + +#### ๐Ÿ“ฑ CLIENT-008: Settings + +**Applications:** Client +**Entry Points:** +- Settings (navigation menu) + +**Happy Path Test Cases:** +- [ ] User profile displays name and email +- [ ] Business name displays correctly +- [ ] Hubs link navigates to hub management +- [ ] Sign out logs out user and returns to auth screen + +**Validation & Error States:** +- [ ] Missing profile photo shows default avatar +- [ ] Sign out error shows retry option + +**Loading & Empty States:** +- [ ] Profile data loads on page mount + +**State Persistence:** +- [ ] User data refreshes on page focus + +**Backend Dependency Validation:** +- [ ] Firebase Auth signOut called +- [ ] Session data cleared + +--- + +#### ๐Ÿ“ฑ CLIENT-009: Client Main Navigation + +**Applications:** Client +**Entry Points:** +- Main app shell after authentication + +**Happy Path Test Cases:** +- [ ] Bottom navigation displays 5 tabs (Home, Coverage, Billing, Orders, Reports) +- [ ] Tab selection updates active indicator +- [ ] Tab selection navigates to correct feature +- [ ] Deep links navigate to correct tab +- [ ] Back button navigates correctly within nested routes +- [ ] Tab state persists after device rotation + +**Validation & Error States:** +- [ ] Invalid route shows 404 or redirects to home +- [ ] Reports tab shows placeholder (not yet implemented) + +**Loading & Empty States:** +- [ ] Navigation bar displays immediately +- [ ] Initial tab loads first + +**State Persistence:** +- [ ] Active tab persists after app background โ†’ foreground +- [ ] Tab state resets to home on app restart + +**Backend Dependency Validation:** +- [ ] No direct backend calls (navigation only) + +--- + +### STAFF APP FEATURES + +--- + +#### ๐Ÿ“ฑ STAFF-001: Authentication + +**Applications:** Staff +**Entry Points:** +- Launch app โ†’ Get Started โ†’ Phone Verification + +**Happy Path Test Cases:** +- [ ] Phone number entry accepts valid formats +- [ ] OTP sent confirmation displays +- [ ] OTP verification succeeds with valid code +- [ ] Profile setup wizard displays for new users +- [ ] Authenticated users bypass auth and show home +- [ ] Session persists after app restart + +**Validation & Error States:** +- [ ] Invalid phone format shows validation error +- [ ] Incorrect OTP shows verification error +- [ ] Expired OTP shows re-send option +- [ ] Empty fields show required field errors +- [ ] Network error displays retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays during phone verification +- [ ] OTP input shows countdown timer +- [ ] Profile setup shows progress indicator + +**State Persistence:** +- [ ] Authenticated session persists after app background โ†’ foreground +- [ ] Session expires appropriately after logout + +**Backend Dependency Validation:** +- [ ] Firebase Auth phone verification flow completes +- [ ] `getUserById` returns user data +- [ ] `getStaffByUserId` retrieves staff profile +- [ ] Staff profile created if missing + +--- + +#### ๐Ÿ“ฑ STAFF-002: Home Dashboard + +**Applications:** Staff +**Entry Points:** +- Home tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Today's shifts display with time and location +- [ ] Tomorrow's shifts display correctly +- [ ] Recommended shifts show available opportunities +- [ ] Shift cards show role, location, and pay rate +- [ ] Quick actions navigate to correct features +- [ ] Dashboard refreshes on pull-to-refresh + +**Validation & Error States:** +- [ ] Missing shift data shows placeholder +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching data +- [ ] Empty today's shifts shows "No shifts today" +- [ ] Empty recommended shows "No available shifts" + +**State Persistence:** +- [ ] Dashboard data refreshes after returning from background +- [ ] Shift status updates reflected immediately + +**Backend Dependency Validation:** +- [ ] `getApplicationsByStaffId` fetches staff assignments +- [ ] `listShifts` returns available shifts +- [ ] Date filtering correctly applied + +--- + +#### ๐Ÿ“ฑ STAFF-003: Profile + +**Applications:** Staff +**Entry Points:** +- Profile tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Profile displays name, email, phone, and photo +- [ ] Statistics show total shifts, ratings, reliability score +- [ ] Profile sections list displays all sections +- [ ] Section navigation works correctly +- [ ] Sign out logs out user and returns to auth screen + +**Validation & Error States:** +- [ ] Missing profile photo shows default avatar +- [ ] Missing statistics show 0 or default values +- [ ] Sign out error shows retry option + +**Loading & Empty States:** +- [ ] Profile data loads on page mount +- [ ] Statistics display placeholders while loading + +**State Persistence:** +- [ ] Profile data refreshes on page focus +- [ ] Profile updates reflect immediately + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` retrieves complete staff profile +- [ ] Firebase Auth signOut called +- [ ] Session data cleared + +--- + +#### ๐Ÿ“ฑ STAFF-004: Shifts Management + +**Applications:** Staff +**Entry Points:** +- Shifts tab (bottom navigation) +- Tab navigation: My Shifts / Available / Pending / Cancelled / History + +**Happy Path Test Cases:** +- [ ] My Shifts tab displays assigned shifts +- [ ] Available Shifts tab shows open positions +- [ ] Pending tab shows applications awaiting approval +- [ ] Cancelled tab shows cancelled shifts +- [ ] History tab shows past shifts +- [ ] Shift detail view displays full information +- [ ] Accept shift updates status to confirmed +- [ ] Decline shift updates status to declined +- [ ] Apply for shift creates application +- [ ] Shift cards show time, location, role, and pay + +**Validation & Error States:** +- [ ] Empty tabs show appropriate empty state messages +- [ ] Network error shows retry option +- [ ] Already applied shift prevents duplicate application +- [ ] Past shifts cannot be applied to +- [ ] Cancelled shifts show cancellation reason + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching shifts +- [ ] Empty My Shifts shows "No assigned shifts" +- [ ] Empty Available shows "No open shifts" +- [ ] Empty Pending shows "No pending applications" +- [ ] Empty History shows "No past shifts" + +**State Persistence:** +- [ ] Active tab persists after navigating away +- [ ] Shift list refreshes after status changes +- [ ] Shift data refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] `getApplicationsByStaffId` fetches applications by status +- [ ] `getShiftById` retrieves shift details +- [ ] `updateApplicationStatus` changes application state +- [ ] `createApplication` creates new application +- [ ] `deleteApplication` removes application +- [ ] `updateShift` updates filled count + +--- + +#### ๐Ÿ“ฑ STAFF-005: Availability Management + +**Applications:** Staff +**Entry Points:** +- Worker Main โ†’ Availability +- Profile โ†’ Availability section + +**Happy Path Test Cases:** +- [ ] Weekly grid displays Monday-Sunday +- [ ] Time slots (Morning/Afternoon/Evening) toggle correctly +- [ ] Quick-set buttons work (Weekdays/Weekends/All Week) +- [ ] Individual day/slot updates save correctly +- [ ] Green checkmarks indicate availability +- [ ] Gray states indicate unavailability +- [ ] Changes save automatically + +**Validation & Error States:** +- [ ] Network error shows retry option +- [ ] Save failure shows error message + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching availability +- [ ] Default state shows all unavailable + +**State Persistence:** +- [ ] Availability persists across app sessions +- [ ] Changes reflect immediately in shift matching + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` retrieves staff ID +- [ ] `listStaffAvailabilitiesByStaffId` fetches availability records +- [ ] `getStaffAvailabilityByKey` checks existing record +- [ ] `updateStaffAvailability` updates existing slot +- [ ] `createStaffAvailability` creates new slot + +--- + +#### ๐Ÿ“ฑ STAFF-006: Clock In/Out + +**Applications:** Staff +**Entry Points:** +- Clock In tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Today's shift displays with clock in button +- [ ] Clock in button creates attendance record +- [ ] Clock in time displays correctly +- [ ] Clock out button appears after clocking in +- [ ] Clock out creates end time record +- [ ] Total hours calculated correctly +- [ ] Attendance status updates immediately + +**Validation & Error States:** +- [ ] No shift today shows "No shifts to clock in" +- [ ] Already clocked in prevents duplicate clock in +- [ ] Network error shows retry option +- [ ] Clock in outside shift time shows warning + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching shift +- [ ] Empty state shows "No shifts scheduled" + +**State Persistence:** +- [ ] Attendance status persists across app sessions +- [ ] Clock in/out times display correctly + +**Backend Dependency Validation:** +- [ ] `getApplicationsByStaffId` fetches today's shifts +- [ ] `createAttendance` records clock in +- [ ] `updateAttendance` records clock out +- [ ] `listAttendancesByApplicationId` gets attendance status +- [ ] `updateApplicationStatus` updates application state + +--- + +#### ๐Ÿ“ฑ STAFF-007: Payments + +**Applications:** Staff +**Entry Points:** +- Payments tab (bottom navigation) + +**Happy Path Test Cases:** +- [ ] Payment summary displays total earnings +- [ ] Payment history lists all transactions +- [ ] Payment cards show amount, date, and status +- [ ] Payment detail view shows breakdown +- [ ] Filter by date range works correctly + +**Validation & Error States:** +- [ ] Zero earnings show $0.00 (not error) +- [ ] Missing payment data shows placeholder +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching payments +- [ ] Empty history shows "No payment history" + +**State Persistence:** +- [ ] Payment data refreshes after returning from background +- [ ] Filter state persists after navigating away + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` retrieves staff ID +- [ ] `getPaymentsByStaffId` fetches payment records +- [ ] Mock summary data calculated correctly + +--- + +#### ๐Ÿ“ฑ STAFF-008: Personal Info (Onboarding) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Personal Info +- Onboarding wizard + +**Happy Path Test Cases:** +- [ ] Form displays current profile data +- [ ] Name field allows text input +- [ ] Email field validates email format +- [ ] Phone field validates phone format +- [ ] Photo upload works correctly +- [ ] Preferred locations multi-select works +- [ ] Save button updates profile + +**Validation & Error States:** +- [ ] Empty required fields show validation errors +- [ ] Invalid email format shows error +- [ ] Invalid phone format shows error +- [ ] Network error shows retry option +- [ ] Photo upload failure shows error + +**Loading & Empty States:** +- [ ] Form loads with skeleton placeholders +- [ ] Photo upload shows progress indicator +- [ ] Save button shows loading spinner + +**State Persistence:** +- [ ] Changes persist after save +- [ ] Unsaved changes show confirmation dialog on exit + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` fetches profile +- [ ] `updateStaff` saves profile changes + +--- + +#### ๐Ÿ“ฑ STAFF-009: Emergency Contact (Onboarding) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Emergency Contact +- Onboarding wizard + +**Happy Path Test Cases:** +- [ ] Contact list displays all contacts +- [ ] Add contact button opens form +- [ ] Contact form validates name and phone +- [ ] Relationship dropdown shows options (Family/Spouse/Friend/Other) +- [ ] Remove contact deletes from list +- [ ] Save updates all contacts +- [ ] Multiple contacts supported + +**Validation & Error States:** +- [ ] Empty name shows validation error +- [ ] Invalid phone format shows error +- [ ] At least one contact required (if applicable) +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching contacts +- [ ] Empty state shows "No emergency contacts" +- [ ] Save button shows loading spinner + +**State Persistence:** +- [ ] Contacts persist after save +- [ ] Unsaved changes show confirmation dialog on exit + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` retrieves staff ID +- [ ] `getEmergencyContactsByStaffId` fetches contacts +- [ ] `deleteEmergencyContact` removes contacts (replace-all pattern) +- [ ] `createEmergencyContact` creates new contacts + +--- + +#### ๐Ÿ“ฑ STAFF-010: Experience & Skills (Onboarding) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Experience +- Onboarding wizard + +**Happy Path Test Cases:** +- [ ] Industries multi-select displays options +- [ ] Skills multi-select displays options +- [ ] Selected items show checkmarks +- [ ] Deselection removes items +- [ ] Save updates profile + +**Validation & Error States:** +- [ ] At least one industry required (if applicable) +- [ ] At least one skill required (if applicable) +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching data +- [ ] Save button shows loading spinner + +**State Persistence:** +- [ ] Selections persist after save +- [ ] Unsaved changes show confirmation dialog on exit + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` fetches profile with industries and skills +- [ ] `updateStaff` updates industries and skills arrays + +--- + +#### ๐Ÿ“ฑ STAFF-011: Attire Selection (Onboarding) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Attire +- Onboarding wizard + +**Happy Path Test Cases:** +- [ ] Attire options list displays all items +- [ ] Item selection toggles checkmark +- [ ] Photo upload button opens camera/gallery +- [ ] Photos display in grid +- [ ] Save updates selections and photos + +**Validation & Error States:** +- [ ] At least one attire item required (if applicable) +- [ ] Photo upload failure shows error +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching options +- [ ] Photo upload shows progress indicator +- [ ] Save button shows loading spinner + +**State Persistence:** +- [ ] Selections and photos persist after save +- [ ] Unsaved changes show confirmation dialog on exit + +**Backend Dependency Validation:** +- [ ] `listAttireOptions` fetches available items +- [ ] Photo upload and save mutations (pending implementation) + +--- + +#### ๐Ÿ“ฑ STAFF-012: Bank Account (Finances) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Bank Account + +**Happy Path Test Cases:** +- [ ] Account list displays all accounts +- [ ] Add account button opens form +- [ ] Form validates routing and account numbers +- [ ] Account type dropdown shows options (Checking/Savings) +- [ ] First account auto-sets as primary +- [ ] Save adds account to list +- [ ] Primary account indicator displays + +**Validation & Error States:** +- [ ] Empty routing number shows validation error +- [ ] Invalid routing number format shows error +- [ ] Empty account number shows validation error +- [ ] Invalid account number format shows error +- [ ] Duplicate account shows warning +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching accounts +- [ ] Empty state shows "No bank accounts" +- [ ] Save button shows loading spinner + +**State Persistence:** +- [ ] Accounts persist after save +- [ ] Account list refreshes after addition + +**Backend Dependency Validation:** +- [ ] `getAccountsByOwnerId` fetches staff accounts +- [ ] `createAccount` creates new account +- [ ] First account auto-flagged as primary + +--- + +#### ๐Ÿ“ฑ STAFF-013: Time Card History (Finances) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Time Card + +**Happy Path Test Cases:** +- [ ] Time card list displays all records +- [ ] Each card shows shift details (date, time, location) +- [ ] Each card shows clock in/out times +- [ ] Each card shows total hours worked +- [ ] Scrolling loads more records (pagination) + +**Validation & Error States:** +- [ ] Missing attendance data shows "Not recorded" +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching records +- [ ] Empty state shows "No time card history" + +**State Persistence:** +- [ ] Time card data refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] `getStaffByUserId` retrieves staff ID +- [ ] `getApplicationsByStaffId` fetches applications with attendance +- [ ] Attendance records mapped to time card format + +--- + +#### ๐Ÿ“ฑ STAFF-014: Tax Forms (Compliance) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Tax Forms + +**Happy Path Test Cases:** +- [ ] Forms list displays required forms (I-9, W-4) +- [ ] Form status shows completed/incomplete +- [ ] I-9 form opens editor +- [ ] I-9 form validates all fields +- [ ] W-4 form opens editor +- [ ] W-4 form validates all fields +- [ ] Form submission updates status to completed +- [ ] Completed forms show edit option + +**Validation & Error States:** +- [ ] Empty required fields show validation errors +- [ ] Invalid SSN format shows error +- [ ] Invalid date format shows error +- [ ] Signature required validation +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Loading spinner displays while fetching forms +- [ ] Form editor loads with skeleton placeholders +- [ ] Save button shows loading spinner + +**State Persistence:** +- [ ] Form data persists after save +- [ ] Unsaved changes show confirmation dialog on exit +- [ ] Form status updates immediately + +**Backend Dependency Validation:** +- [ ] `getTaxFormsByStaffId` fetches forms +- [ ] `createTaxForm` initializes missing forms +- [ ] `updateTaxForm` saves form data and status + +--- + +#### ๐Ÿ“ฑ STAFF-015: Documents (Compliance) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Documents + +**Happy Path Test Cases:** +- [ ] Documents list displays required documents +- [ ] Document status shows verified/pending/expired +- [ ] Document detail view shows requirements +- [ ] Expiry dates display correctly +- [ ] Expired documents highlight in red + +**Validation & Error States:** +- [ ] Missing documents show incomplete status +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching documents +- [ ] Empty state shows "No documents required" + +**State Persistence:** +- [ ] Document data refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] Mock implementation currently +- [ ] โš ๏ธ Requires clarification: Real Data Connect integration pending + +--- + +#### ๐Ÿ“ฑ STAFF-016: Certificates (Compliance) + +**Applications:** Staff +**Entry Points:** +- Profile โ†’ Certificates + +**Happy Path Test Cases:** +- [ ] Certificates list displays all certificates +- [ ] Certificate cards show name, status, and expiry +- [ ] Certificate detail view shows full information +- [ ] Expired certificates highlight in red +- [ ] Certificate verification status displays + +**Validation & Error States:** +- [ ] Missing certificates show placeholder +- [ ] Network error shows retry option + +**Loading & Empty States:** +- [ ] Skeleton loaders display while fetching certificates +- [ ] Empty state shows "No certificates" + +**State Persistence:** +- [ ] Certificate data refreshes after returning from background + +**Backend Dependency Validation:** +- [ ] `listStaffDocumentsByStaffId` fetches certificate documents +- [ ] Document data mapped to certificate entities + +--- + +#### ๐Ÿ“ฑ STAFF-017: Staff Main Navigation + +**Applications:** Staff +**Entry Points:** +- Main app shell after authentication + +**Happy Path Test Cases:** +- [ ] Bottom navigation displays 5 tabs (Shifts, Payments, Home, Clock In, Profile) +- [ ] Tab selection updates active indicator +- [ ] Tab selection navigates to correct feature +- [ ] Deep links navigate to correct tab and nested route +- [ ] Back button navigates correctly within nested routes +- [ ] Tab state persists after device rotation +- [ ] Nested routes (onboarding, emergency-contact, etc.) accessible + +**Validation & Error States:** +- [ ] Invalid route shows 404 or redirects to home +- [ ] Navigation errors log appropriately + +**Loading & Empty States:** +- [ ] Navigation bar displays immediately +- [ ] Initial tab loads first + +**State Persistence:** +- [ ] Active tab persists after app background โ†’ foreground +- [ ] Tab state resets to home on app restart + +**Backend Dependency Validation:** +- [ ] No direct backend calls (navigation only) + +--- + +## 2๏ธโƒฃ CROSS-APPLICATION TEST SCENARIOS + +### Scenario 1: Order Creation โ†’ Staff Application Flow + +**Preconditions:** +- Client user authenticated +- Staff user authenticated +- At least one hub configured + +**Steps:** +1. **CLIENT APP:** + - [ ] Create one-time order with specific hub, role, date, and time + - [ ] Verify order appears in View Orders list + - [ ] Verify shift shows as unfilled (0/X positions) + +2. **STAFF APP:** + - [ ] Open Shifts tab โ†’ Available tab + - [ ] Verify new shift appears in available list + - [ ] Verify shift details match order (hub, role, time, pay) + - [ ] Apply for shift position + +3. **CLIENT APP:** + - [ ] Refresh View Orders + - [ ] Verify shift shows pending application (0/X filled, pending) + +4. **STAFF APP:** + - [ ] Verify application appears in Pending tab + - [ ] Verify shift removed from Available tab + +**Expected Results:** +- โœ… Order created in Client appears in Staff Available Shifts +- โœ… Application in Staff shows pending in both apps +- โœ… Shift counts update correctly in real-time + +--- + +### Scenario 2: Shift Acceptance โ†’ Coverage Tracking + +**Preconditions:** +- Scenario 1 completed (pending application exists) + +**Steps:** +1. **STAFF APP:** + - [ ] Go to Shifts โ†’ Pending tab + - [ ] Accept pending shift assignment + +2. **CLIENT APP:** + - [ ] Refresh View Orders + - [ ] Verify shift shows as filled (1/X positions) + - [ ] Verify staff name and photo appear in accepted applications + - [ ] Navigate to Coverage tab + - [ ] Verify shift appears with assigned staff + +3. **STAFF APP:** + - [ ] Verify shift moved from Pending to My Shifts tab + - [ ] Verify shift appears on Home dashboard + +**Expected Results:** +- โœ… Accepted shift reflects in Client orders immediately +- โœ… Staff appears in Coverage monitoring +- โœ… Shift moves to My Shifts in Staff app + +--- + +### Scenario 3: Clock In โ†’ Real-Time Coverage Update + +**Preconditions:** +- Scenario 2 completed (staff has accepted shift) +- Current date/time is during shift window + +**Steps:** +1. **STAFF APP:** + - [ ] Navigate to Clock In tab + - [ ] Verify today's shift displays + - [ ] Click Clock In button + - [ ] Verify clock in time recorded + +2. **CLIENT APP:** + - [ ] Navigate to Coverage tab + - [ ] Verify staff status changed to "Checked In" + - [ ] Verify check-in time displays + - [ ] Verify coverage stats updated (checked-in count incremented) + +3. **STAFF APP:** + - [ ] Wait until shift end time + - [ ] Click Clock Out button + - [ ] Verify clock out time recorded + +4. **CLIENT APP:** + - [ ] Refresh Coverage tab + - [ ] Verify staff status changed to "Completed" + +5. **STAFF APP:** + - [ ] Navigate to Time Card + - [ ] Verify attendance record appears with correct times and hours + +**Expected Results:** +- โœ… Clock in updates Coverage status in Client +- โœ… Clock out completes attendance record +- โœ… Time card displays correct hours in Staff app +- โœ… Coverage monitoring reflects real-time status + +--- + +### Scenario 4: Hub Creation โ†’ Order Placement + +**Preconditions:** +- Client user authenticated +- No existing hubs + +**Steps:** +1. **CLIENT APP:** + - [ ] Navigate to Settings โ†’ Hubs + - [ ] Verify empty state "No hubs configured" + - [ ] Click Add Hub button + - [ ] Enter hub name and use Google Places autocomplete + - [ ] Select address from suggestions + - [ ] Verify address fields auto-filled + - [ ] Save hub + +2. **CLIENT APP:** + - [ ] Navigate to Create Order + - [ ] Verify new hub appears in hub selection list + - [ ] Select new hub and complete order creation + +3. **STAFF APP:** + - [ ] Navigate to Shifts โ†’ Available + - [ ] Verify shift shows correct hub name and address + +**Expected Results:** +- โœ… Hub created in Settings appears in order creation +- โœ… Hub address propagates to shift details in Staff app + +--- + +### Scenario 5: Shift Cancellation โ†’ Staff Notification + +**Preconditions:** +- Staff has accepted shift assignment + +**Steps:** +1. **CLIENT APP:** + - [ ] Navigate to View Orders + - [ ] Select order with assigned staff + - [ ] Cancel shift (if feature exists) or delete order + +2. **STAFF APP:** + - [ ] Refresh Shifts tab + - [ ] Verify shift moved to Cancelled tab + - [ ] Verify shift removed from My Shifts + - [ ] Verify cancellation reason displays + +3. **STAFF APP:** + - [ ] Verify shift removed from Home dashboard + +**Expected Results:** +- โœ… Cancelled shift moves to Cancelled tab +- โœ… Shift removed from active assignments +- โš ๏ธ **Requires clarification:** Cancellation feature may not be fully implemented + +--- + +### Scenario 6: Authentication State Sharing + +**Preconditions:** +- Neither app authenticated + +**Steps:** +1. **CLIENT APP:** + - [ ] Sign in with email/password + - [ ] Verify Firebase Auth token generated + +2. **STAFF APP:** + - [ ] Launch app + - [ ] Verify Staff app requires separate authentication + - [ ] Verify Client session does not carry over + +3. **CLIENT APP:** + - [ ] Sign out + +4. **STAFF APP:** + - [ ] Verify Staff app session persists (independent) + +**Expected Results:** +- โœ… Client and Staff apps maintain independent auth sessions +- โœ… Signing out of one app does not affect the other + +--- + +### Scenario 7: Data Created in Client โ†’ Visible in Staff + +**Preconditions:** +- Client creates multiple orders + +**Steps:** +1. **CLIENT APP:** + - [ ] Create 5 orders on different dates + - [ ] Create 3 orders on same date with different hubs + +2. **STAFF APP:** + - [ ] Navigate to Shifts โ†’ Available + - [ ] Verify all 8 shifts appear + - [ ] Verify date grouping correct + - [ ] Verify hub addresses correct + - [ ] Apply for 2 shifts + +3. **CLIENT APP:** + - [ ] Navigate to View Orders + - [ ] Verify 2 shifts show pending applications + - [ ] Navigate to Coverage + - [ ] Verify 0 checked-in (pending acceptance) + +**Expected Results:** +- โœ… All orders visible in both apps +- โœ… Application states sync correctly +- โœ… Data consistency maintained across apps + +--- + +### Scenario 8: Role-Based Access Differences + +**Preconditions:** +- Client user authenticated +- Staff user authenticated + +**Steps:** +1. **CLIENT APP:** + - [ ] Navigate to Billing + - [ ] Verify billing data displays (Client-only feature) + - [ ] Navigate to Create Order + - [ ] Verify order creation available (Client-only feature) + +2. **STAFF APP:** + - [ ] Verify no Billing tab exists + - [ ] Verify no Create Order feature + - [ ] Navigate to Availability + - [ ] Verify availability editing available (Staff-only feature) + +3. **CLIENT APP:** + - [ ] Verify no Availability feature exists + - [ ] Verify no Clock In feature exists + +**Expected Results:** +- โœ… Client app has business management features (orders, billing, hubs) +- โœ… Staff app has worker features (availability, clock in, payments) +- โœ… No feature overlap or unauthorized access + +--- + +### Scenario 9: Race Condition - Concurrent Shift Application + +**Preconditions:** +- One available shift with 1 position +- Two staff users authenticated on separate devices + +**Steps:** +1. **STAFF APP (Device 1):** + - [ ] Navigate to Shifts โ†’ Available + - [ ] View shift details + +2. **STAFF APP (Device 2):** + - [ ] Navigate to Shifts โ†’ Available + - [ ] View same shift details + +3. **STAFF APP (Device 1):** + - [ ] Apply for shift + - [ ] Verify application created + +4. **STAFF APP (Device 2):** + - [ ] Attempt to apply for same shift + - [ ] Verify appropriate behavior (position filled message or pending status) + +5. **CLIENT APP:** + - [ ] Navigate to View Orders + - [ ] Verify only 1 application shows (not 2) + - [ ] Accept Device 1 application + +6. **STAFF APP (Device 2):** + - [ ] Refresh Available shifts + - [ ] Verify shift removed or shows as filled + +**Expected Results:** +- โœ… Only first application succeeds (or both go to pending) +- โœ… No double-booking occurs +- โœ… Race condition handled gracefully +- โš ๏ธ **Requires clarification:** Backend concurrency control behavior + +--- + +### Scenario 10: Network Failure During Critical Operation + +**Preconditions:** +- Staff has pending shift application + +**Steps:** +1. **STAFF APP:** + - [ ] Navigate to Shifts โ†’ Pending + - [ ] Disable network connection + - [ ] Attempt to accept shift + - [ ] Verify offline error message displays + - [ ] Re-enable network + - [ ] Retry accept shift + - [ ] Verify acceptance succeeds + +2. **CLIENT APP:** + - [ ] Verify shift shows as filled after network restored + +**Expected Results:** +- โœ… Offline state handled gracefully with clear messaging +- โœ… Retry succeeds after network restored +- โœ… Data consistency maintained + +--- + +## 3๏ธโƒฃ SHARED INFRASTRUCTURE VALIDATION + +### Domain Entity Consistency + +#### Test: Entity Field Validation + +- [ ] **Staff Entity:** + - [ ] Verify all required fields populate (id, userId, firstName, lastName, email, phone) + - [ ] Verify optional fields handle null correctly (photoUrl, preferredLocations) + - [ ] Verify enum fields map correctly (UserStatus) + +- [ ] **Order Entity:** + - [ ] Verify all required fields populate + - [ ] Verify OrderStatus enum maps correctly + - [ ] Verify OrderType enum maps correctly + +- [ ] **Shift Entity:** + - [ ] Verify date/time fields parse correctly + - [ ] Verify ShiftStatus enum maps correctly + - [ ] Verify location data (hub) links correctly + +- [ ] **Application Entity:** + - [ ] Verify ApplicationStatus enum maps correctly + - [ ] Verify relationships (staff, shift, role) link correctly + +- [ ] **Invoice Entity:** + - [ ] Verify amount calculations correct + - [ ] Verify date fields parse correctly + - [ ] Verify InvoiceStatus enum maps correctly + +- [ ] **Hub Entity:** + - [ ] Verify address components parse correctly + - [ ] Verify geocoding (lat/lng) present and valid + - [ ] Verify placeId populated + +--- + +### Data Connect Schema Alignment + +#### Test: Backend Operation Contracts + +- [ ] **User Operations:** + - [ ] `getUserById(userId)` returns expected fields + - [ ] `createUser(...)` accepts all required parameters + - [ ] `updateUser(...)` updates only specified fields + +- [ ] **Staff Operations:** + - [ ] `getStaffByUserId(userId)` returns staff profile + - [ ] `updateStaff(...)` updates specified fields + - [ ] `listStaffs()` returns paginated results + +- [ ] **Order Operations:** + - [ ] `createOrder(...)` creates order with shifts + - [ ] `listOrdersByBusinessId(...)` filters by business correctly + - [ ] `updateOrder(...)` updates order fields + +- [ ] **Shift Operations:** + - [ ] `createShift(...)` creates shift with location + - [ ] `getShiftById(id)` returns full shift details + - [ ] `listShiftRolesByBusinessAndDateRange(...)` returns correct date range + +- [ ] **Application Operations:** + - [ ] `createApplication(...)` creates pending application + - [ ] `updateApplicationStatus(...)` changes status correctly + - [ ] `getApplicationsByStaffId(...)` filters by staff and date + +- [ ] **Attendance Operations:** + - [ ] `createAttendance(...)` records clock in + - [ ] `updateAttendance(...)` records clock out + - [ ] `listAttendancesByApplicationId(...)` returns attendance records + +- [ ] **Hub Operations:** + - [ ] `createTeamHub(...)` creates hub with location data + - [ ] `getTeamHubsByTeamId(...)` returns hubs for team + - [ ] `deleteTeamHub(id)` removes hub entity + +--- + +### Error Handling Consistency + +#### Test: Standard Error Patterns + +- [ ] **Network Errors:** + - [ ] All features show "Network error" message + - [ ] All features show "Retry" button + - [ ] Retry button re-attempts operation + +- [ ] **Authentication Errors:** + - [ ] Expired token redirects to login + - [ ] Invalid credentials show appropriate message + - [ ] Auth failures log out user + +- [ ] **Validation Errors:** + - [ ] Field-level validation shows inline errors + - [ ] Form-level validation prevents submission + - [ ] Error messages are user-friendly + +- [ ] **Backend Errors:** + - [ ] 400 errors show validation details + - [ ] 404 errors show "Not found" message + - [ ] 500 errors show "Server error, try again" message + +- [ ] **Data Not Found:** + - [ ] Empty lists show appropriate empty state + - [ ] Missing entities show "Not found" message + - [ ] Deleted entities handle gracefully + +--- + +### Version Mismatch Tolerance + +#### Test: App Version Compatibility + +- [ ] **Client App Updated, Staff App Not:** + - [ ] Backend operations remain compatible + - [ ] Shared domain entities parse correctly + - [ ] New fields in Client don't break Staff + +- [ ] **Staff App Updated, Client App Not:** + - [ ] Backend operations remain compatible + - [ ] Shared domain entities parse correctly + - [ ] New fields in Staff don't break Client + +- [ ] **Backend Schema Updated:** + - [ ] Apps handle new optional fields gracefully + - [ ] Apps ignore unknown fields + - [ ] Required fields validated correctly + +--- + +## 4๏ธโƒฃ REGRESSION & RELEASE CHECKLIST + +### Smoke Testing (Critical Path) + +#### Authentication Flow (5 minutes) + +- [ ] **Client App:** + - [ ] Launch app shows Get Started screen + - [ ] Sign in with valid credentials succeeds + - [ ] Home dashboard displays + +- [ ] **Staff App:** + - [ ] Launch app shows Get Started screen + - [ ] Phone verification sends OTP + - [ ] OTP verification succeeds + - [ ] Home dashboard displays + +#### Order Creation & Application (10 minutes) + +- [ ] **Client App:** + - [ ] Create one-time order succeeds + - [ ] Order appears in View Orders list + - [ ] Order details display correctly + +- [ ] **Staff App:** + - [ ] Available shift appears in Shifts tab + - [ ] Apply for shift succeeds + - [ ] Application appears in Pending tab + +- [ ] **Client App:** + - [ ] Pending application displays in View Orders + - [ ] Coverage shows staff as pending + +#### Clock In/Out Flow (5 minutes) + +- [ ] **Staff App:** + - [ ] Accept shift from Pending tab + - [ ] Clock in on Clock In tab + - [ ] Clock in time recorded + +- [ ] **Client App:** + - [ ] Coverage shows staff as checked in + - [ ] Staff status updates in real-time + +- [ ] **Staff App:** + - [ ] Clock out succeeds + - [ ] Time card displays attendance record + +--- + +### Critical Path Validation (Must Pass Before Release) + +#### Client App Critical Features + +- [ ] **Authentication:** + - [ ] Sign in with email/password works + - [ ] Session persists after restart + +- [ ] **Order Management:** + - [ ] Create order succeeds + - [ ] View orders displays correctly + - [ ] Order details accurate + +- [ ] **Coverage Monitoring:** + - [ ] Coverage stats display correctly + - [ ] Staff status updates reflect backend + +- [ ] **Billing:** + - [ ] Invoice list displays + - [ ] Spending breakdown calculates correctly + +#### Staff App Critical Features + +- [ ] **Authentication:** + - [ ] Phone verification works + - [ ] Session persists after restart + +- [ ] **Shift Management:** + - [ ] Available shifts display + - [ ] Apply for shift succeeds + - [ ] Accept shift succeeds + - [ ] My Shifts displays assigned shifts + +- [ ] **Clock In/Out:** + - [ ] Clock in records attendance + - [ ] Clock out completes record + +- [ ] **Profile:** + - [ ] View profile displays data + - [ ] Update personal info succeeds + +--- + +### High-Risk Features (Require Extra Scrutiny) + +#### Payment Processing + +- [ ] **Staff App:** + - [ ] Payment history displays correctly + - [ ] Payment amounts accurate + - [ ] No double-payment scenarios + +- [ ] **Client App:** + - [ ] Invoice amounts correct + - [ ] Billing calculations accurate + - [ ] No overcharging scenarios + +#### Data Integrity + +- [ ] **Order โ†’ Shift โ†’ Application Chain:** + - [ ] Order creation creates shifts + - [ ] Shift deletion cascades correctly + - [ ] Application deletion updates shift counts + +- [ ] **Attendance Records:** + - [ ] Clock in/out times accurate + - [ ] Hours calculation correct + - [ ] No duplicate attendance records + +#### Concurrency Issues + +- [ ] **Multiple Staff Applying:** + - [ ] Race condition handled correctly + - [ ] No double-booking + - [ ] First-come-first-served logic works + +- [ ] **Shift Cancellation:** + - [ ] Staff notified appropriately + - [ ] Applications updated correctly + - [ ] No orphaned assignments + +--- + +### Release-Blocking Failures + +**The following issues MUST be fixed before release:** + +- [ ] **Authentication fails completely** (users cannot log in) +- [ ] **Order creation fails completely** (clients cannot create orders) +- [ ] **Shift application fails completely** (staff cannot apply for shifts) +- [ ] **Clock in/out fails completely** (staff cannot track attendance) +- [ ] **Payment data displays incorrectly** (financial inaccuracies) +- [ ] **Data loss occurs** (orders, shifts, or applications deleted unintentionally) +- [ ] **App crashes on launch** (unrecoverable error) +- [ ] **Backend connection fails** (cannot communicate with Data Connect) +- [ ] **Critical security vulnerability** (unauthorized access, data exposure) + +--- + +## ๐Ÿ“Š TESTING METRICS & REPORTING + +### Test Execution Summary + +**Date:** __________ +**Tester:** __________ +**Build Version:** __________ + +| Category | Total Tests | Passed | Failed | Blocked | Pass Rate | +|----------|-------------|--------|--------|---------|-----------| +| Client Features | __ | __ | __ | __ | __% | +| Staff Features | __ | __ | __ | __ | __% | +| Cross-App Scenarios | __ | __ | __ | __ | __% | +| Infrastructure | __ | __ | __ | __ | __% | +| Smoke Tests | __ | __ | __ | __ | __% | +| **TOTAL** | **__** | **__** | **__** | **__** | **__%** | + +--- + +### Defect Severity Classification + +**Critical (P0):** Release-blocking, affects core functionality +**High (P1):** Major functionality broken, workaround exists +**Medium (P2):** Minor functionality affected, low impact +**Low (P3):** Cosmetic issue, no functional impact + +--- + +### Sign-Off Criteria + +**Release can proceed when:** +- [ ] All P0 defects resolved +- [ ] 95%+ pass rate on Critical Path tests +- [ ] 85%+ pass rate on all Feature tests +- [ ] No unresolved P1 defects in core features +- [ ] Cross-app scenarios pass 90%+ +- [ ] Backend integration stable (no frequent failures) +- [ ] QA lead approval obtained +- [ ] Product owner approval obtained + +--- + +## ๐Ÿ“ NOTES & CLARIFICATIONS NEEDED + +The following items require clarification before full QA execution: + +1. โš ๏ธ **Documents Feature (STAFF-015):** Real Data Connect integration status unclear. Currently using mock implementation. + +2. โš ๏ธ **Shift Cancellation:** Feature existence and behavior not confirmed in current implementation. + +3. โš ๏ธ **Race Condition Handling (Scenario 9):** Backend concurrency control mechanism needs documentation. + +4. โš ๏ธ **Payment Processing:** End-to-end payment flow from shift completion to payment disbursement not fully implemented. + +5. โš ๏ธ **NFC Tag Assignment:** Hub NFC functionality interface exists but implementation status unclear. + +6. โš ๏ธ **Recurring & Permanent Orders:** Placeholder screens exist but full workflow not implemented. + +7. โš ๏ธ **Reports Feature (Client):** Currently shows placeholder, implementation status unknown. + +8. โš ๏ธ **Notification System:** Push notifications for shift assignments, cancellations, and status updates not covered in current analysis. + +--- + +## ๐ŸŽฏ CONCLUSION + +This QA checklist provides comprehensive coverage of all implemented features across both Client and Staff applications. It is designed for manual testing by QA engineers and supports release sign-off decisions based on structured test execution and clear pass/fail criteria. + +**Key Strengths:** +- โœ… Feature-by-feature detailed test cases +- โœ… Cross-application integration scenarios +- โœ… Infrastructure and data consistency validation +- โœ… Clear release-blocking criteria +- โœ… Based on actual implemented code (not speculative) + +**Recommended Usage:** +1. Execute smoke tests before each build +2. Run full feature regression weekly +3. Execute cross-app scenarios before major releases +4. Validate infrastructure after backend schema updates +5. Use sign-off checklist for release go/no-go decisions + +--- + +**Document Maintainer:** KROW QA Team +**Last Updated:** February 1, 2026 +**Next Review:** Upon next major feature release