Survey Lifecycle

State Machine

        stateDiagram-v2
    [*] --> scheduled
    scheduled --> confirmed : Customer confirms
    confirmed --> in_progress : Team on site
    in_progress --> completed : Survey done
    completed --> report_submitted : Report uploaded
    report_submitted --> reviewed_approved : Central Ops approves
    report_submitted --> reviewed_rejected : Central Ops rejects
    reviewed_rejected --> scheduled : New survey scheduled

    scheduled --> rescheduled : Date changed
    confirmed --> rescheduled : Emergency
    rescheduled --> scheduled : New date set

    scheduled --> cancelled
    confirmed --> cancelled

    reviewed_approved --> [*]
    cancelled --> [*]
    

Survey Day Sequence

        sequenceDiagram
    participant CentralOps as Central Ops
    participant FieldTeam as Field Team
    participant Customer

    CentralOps->>Customer: Confirm Survey Time
    CentralOps->>FieldTeam: Assign Survey + Share Survey ID

    FieldTeam->>Customer: Survey Day Confirmation Call

    alt Team Available
        FieldTeam->>Customer: Conduct Survey
        FieldTeam->>CentralOps: Submit Survey Report + Media
        CentralOps->>CentralOps: Review Report
        alt Site Ready
            CentralOps->>Customer: Confirm Installation Readiness
        else Site Not Ready
            CentralOps->>Customer: Inform Load / Earthing / Civil Work
            Customer->>CentralOps: Confirm Site Ready
        end
    else Team Unavailable (Emergency)
        FieldTeam--xCentralOps: Unable to Reach Site
        CentralOps->>Customer: Inform Delay + Check Availability
        CentralOps->>CentralOps: Search Backup Team
        alt Backup Available
            CentralOps->>FieldTeam: Emergency Assignment
            FieldTeam->>Customer: Reconfirm & Execute Survey
            FieldTeam->>CentralOps: Submit Survey Report
        else No Backup
            CentralOps->>Customer: Priority Reschedule
        end
    end