Description
As an Operator, I want to see a clear status screen showing the progress of the sync process, So that I understand what actions I can and cannot take .
Purpose
To provide operators with clear visibility into the remapping state and guide them through the required process.
Pre-requisites
- Centre remapping flag must be set (from issue-1045)
- Centre remapping menu option visible (from issue-1046)
- Status screen accessible from menu
- Database queries for packet counts working
- Network connectivity status available
Basic Flow
-
Operator clicks "Centre Remapping" menu option
-
System displays Centre Remapping Status Screen showing:
Section 1: Status Header
- Title: "Centre Remapping in Progress"
- Status indicator: Current centre mapping state
- Timestamp: When remapping was detected
Section 2: Pending Activities Count
- Packets awaiting upload: X
- Packets pending operator approval: Y
- Packets in processing state: Z
Section 3: Blocked Operations
- [Blocked] New Registration
- [Blocked] UIN Update
- [Blocked] Lost UIN
- [Blocked] Operator Onboarding
- [Blocked] Biometric Update
- [Blocked] Pre-registration Download
Section 4: Allowed Operations
- [Allowed] Approve Pending Packets
- [Allowed] Manual Sync
- [Allowed] Export Packets
Section 5: System Status
- Connectivity: Online/Offline indicator
- Last sync timestamp
Section 6: Action Button
- "Sync Centre" button enabled ONLY if:
- System is ONLINE
- No pending approval packets remain (Y = 0)
- If disabled, tooltip explains: "Please complete pending approvals and ensure online connectivity before starting cleanup"
-
Operator reviews the status
-
Operator completes pending approvals (via Packet Approval screen)
-
Operator returns to status screen
-
Operator clicks "Sync Centre" button
-
System initiates cleanup process ()
Alternate Flows
Alternate Flow A1: Offline Status
- Operator is on status screen
- Device loses internet connectivity
- Screen updates to show: "Offline - sync unavailable"
- "Sync Center" button disabled with tooltip: "Please connect to internet"
- When connectivity restored, button becomes enabled
Alternate Flow A2: Pending Approvals Exist
- Operator is on status screen
- Pending approval count > 0
- "Sync Centre" button is disabled
- Tooltip shows: "Please complete pending approvals before starting cleanup"
- Operator navigates to Packet Approval screen
- Operator approves packets
- Returns to status screen; counts updated; button now enabled
Alternate Flow A3: Sync Completed Successfully
- Operator navigates to status screen after sync completes
- Screen displays success message:
"Centre remapping completed successfully"
- Summary of sync statistics:
- Pre-registration packets deleted: X
- Registration packets deleted: Y
- Operators removed: Z
- "Continue" button available to return to normal operations
Scenarios
Scenarios
| Scenario |
Condition |
Expected Result |
| S1 |
View status with pending approvals |
Sync Center disabled; tooltip shown |
| S2 |
View status when online with no pending approvals |
Sync Center enabled and ready |
| S3 |
View status when offline |
Sync Center disabled; offline message shown |
| S4 |
Network changes during viewing |
Screen updates to reflect connectivity change |
| S5 |
Sync running in background |
Progress bar shown; refresh available |
| S6 |
Sync completed |
Success message and summary displayed |
| S7 |
View status after previous sync failure |
Error message shown; retry button available |
Error Messages
| Condition |
Message |
| Offline when viewing |
"Device is offline. Sync cannot start. Please connect to internet." |
| Pending approvals remain |
"Please complete pending packet approvals before starting sync." |
| Database query failed |
"Unable to load status. Please try again." |
| Sync failed previously |
"Previous sync attempt failed. Review details and retry." |
Data Fields
No response
Business Rules (With Audit)
BR-001: Status screen MUST show real-time packet counts updated from database
BR-002: "Sync Center" button MUST be enabled only when:
- Device is ONLINE (verified via connectivity API)
- No pending approval packets remain (count = 0)
BR-003: Screen MUST update reactively when:
- Connectivity changes
- Packet counts change (from other screens)
- Cleanup progress updates (in real-time)
BR-004: All data displayed MUST be accurate as of latest database state
Acceptance Criteria
| Criteria |
Verification |
| All sections display with correct data |
Visual inspection |
| Button enabled only when conditions met |
Test with/without approvals; test offline |
| Real-time updates when data changes |
Change data in database; refresh screen |
| Messages are clear and actionable |
Read and understand all messages |
| Progress section shows during sync |
Initiate sync; observe progress display |
Exceptions
| Exception |
Handling |
| Connectivity check fails |
Assume offline; disable sync button |
| Invalid sync state data |
Show fallback state; log error |
Documentation
No response
Reference UX
Figma Link
Prototype
Compatibility
Support Android 10 to 14
Implementation Details
Files to Create:
lib/screens/centre_remapping/centre_remapping_status_screen.dart
lib/models/cleanup_progress.dart
Files to Modify:
lib/repositories/registration_packet_repository.dart - Add count queries
lib/repositories/cleanup_state_repository.dart - Create or enhance for state tracking
lib/utils/session_context.dart - Add cleanup progress tracking
Database Queries Needed:
-- Count pending upload packets
SELECT COUNT(*) FROM registration_packet
WHERE server_status IN ('PROCESSING', 'RE-SEND')
-- Count pending approval packets
SELECT COUNT(*) FROM registration_packet
WHERE approval_status = 'PENDING'
-- Count processing packets
SELECT COUNT(*) FROM registration_packet
WHERE server_status = 'PROCESSING'
Definition of Done
Non-Functional Requirements
| Requirement |
Specification |
| Load Time |
Status screen loads in <1 second |
| Real-time Updates |
Data reflects within 500ms of change |
| Responsiveness |
Screen responsive on all device sizes |
| Memory |
Minimal memory footprint (<10MB) |
Description
As an Operator, I want to see a clear status screen showing the progress of the sync process, So that I understand what actions I can and cannot take .
Purpose
To provide operators with clear visibility into the remapping state and guide them through the required process.
Pre-requisites
Basic Flow
Operator clicks "Centre Remapping" menu option
System displays Centre Remapping Status Screen showing:
Section 1: Status Header
Section 2: Pending Activities Count
Section 3: Blocked Operations
Section 4: Allowed Operations
Section 5: System Status
Section 6: Action Button
Operator reviews the status
Operator completes pending approvals (via Packet Approval screen)
Operator returns to status screen
Operator clicks "Sync Centre" button
System initiates cleanup process ()
Alternate Flows
Alternate Flow A1: Offline Status
Alternate Flow A2: Pending Approvals Exist
Alternate Flow A3: Sync Completed Successfully
"Centre remapping completed successfully"
Scenarios
Scenarios
Error Messages
Data Fields
No response
Business Rules (With Audit)
BR-001: Status screen MUST show real-time packet counts updated from database
BR-002: "Sync Center" button MUST be enabled only when:
BR-003: Screen MUST update reactively when:
BR-004: All data displayed MUST be accurate as of latest database state
Acceptance Criteria
Exceptions
Documentation
No response
Reference UX
Figma Link
Prototype
Compatibility
Support Android 10 to 14
Implementation Details
Files to Create:
lib/screens/centre_remapping/centre_remapping_status_screen.dartlib/models/cleanup_progress.dartFiles to Modify:
lib/repositories/registration_packet_repository.dart- Add count querieslib/repositories/cleanup_state_repository.dart- Create or enhance for state trackinglib/utils/session_context.dart- Add cleanup progress trackingDatabase Queries Needed:
Definition of Done
Non-Functional Requirements