Skip to content

<Feature><Center Remap Sync> US#03: Display Centre Remapping Status #1053

@Varaniya201

Description

@Varaniya201

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

  1. Operator clicks "Centre Remapping" menu option

  2. 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"
  3. Operator reviews the status

  4. Operator completes pending approvals (via Packet Approval screen)

  5. Operator returns to status screen

  6. Operator clicks "Sync Centre" button

  7. System initiates cleanup process ()

Alternate Flows

Alternate Flow A1: Offline Status

  1. Operator is on status screen
  2. Device loses internet connectivity
  3. Screen updates to show: "Offline - sync unavailable"
  4. "Sync Center" button disabled with tooltip: "Please connect to internet"
  5. When connectivity restored, button becomes enabled

Alternate Flow A2: Pending Approvals Exist

  1. Operator is on status screen
  2. Pending approval count > 0
  3. "Sync Centre" button is disabled
  4. Tooltip shows: "Please complete pending approvals before starting cleanup"
  5. Operator navigates to Packet Approval screen
  6. Operator approves packets
  7. Returns to status screen; counts updated; button now enabled

Alternate Flow A3: Sync Completed Successfully

  1. Operator navigates to status screen after sync completes
  2. Screen displays success message:
    "Centre remapping completed successfully"
  3. Summary of sync statistics:
    • Pre-registration packets deleted: X
    • Registration packets deleted: Y
    • Operators removed: Z
  4. "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

  • Status screen created with all sections
  • Real-time database queries for packet counts working
  • Button enable/disable logic correct
  • Connectivity monitoring integrated
  • Progress display working during cleanup
  • Success message displays post-cleanup
  • Unit tests for data queries (>80% coverage)
  • Integration test with mock cleanup
  • Responsive layout tested on multiple screen sizes
  • Manual testing confirms all data accurate and current
  • Code reviewed
  • Code merged

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions