# 🏢 DHA Bahawalpur - Equipment Maintenance System (DHA-EMS)
## Complete A-to-Z Workflow Guide (English)

This document serves as the authoritative, end-to-end technical and operational workflow guide for the **DHA Bahawalpur Equipment Maintenance System (DHA-EMS)**. It covers the full lifecycle of demands and complaints, dual financial authorization pipelines, digital signature mechanics, discussions, rejections, and an **exhaustive screen-by-screen breakdown of every user dashboard**.

---

## 📑 Table of Contents
1. [Executive Summary & Purpose](#1-executive-summary--purpose)
2. [End-to-End Performa Lifecycle](#2-end-to-end-performa-lifecycle)
3. [Dual Financial Streams Architecture](#3-dual-financial-streams-architecture)
   - 3.1 [Petty Cash Stream (≤ PKR 10,000)](#31-petty-cash-stream--pkr-10000)
   - 3.2 [Minute Sheet Stream (> PKR 10,000)](#32-minute-sheet-stream--pkr-10000)
4. [Clarifications, Rejections & Super Admin Reactivation](#4-clarifications-rejections--super-admin-reactivation)
5. [Dashboard-by-Dashboard Comprehensive Breakdown](#5-dashboard-by-dashboard-comprehensive-breakdown)
   - 5.1 [Clerk Portal & Dashboard](#51-clerk-portal--dashboard)
   - 5.2 [Branch Director Dashboard](#52-branch-director-dashboard)
   - 5.3 [IT Admin Dashboard (8-Tab Operational Pipeline)](#53-it-admin-dashboard-8-tab-operational-pipeline)
   - 5.4 [Additional Director IT Dashboard](#54-additional-director-it-dashboard)
   - 5.5 [Director IT Dashboard](#55-director-it-dashboard)
   - 5.6 [Secretary Dashboard](#56-secretary-dashboard)
   - 5.7 [Technician Portal & Dashboard](#57-technician-portal--dashboard)
   - 5.8 [Super Admin Control Center & Role Simulator](#58-super-admin-control-center--role-simulator)
6. [Secretary Approved Module](#6-secretary-approved-module)
7. [Worker Performance & Efficiency Analytics](#7-worker-performance--efficiency-analytics)
8. [Hardware Asset & Tagging Lifecycle](#8-hardware-asset--tagging-lifecycle)

---

## 1. Executive Summary & Purpose

In government and statutory authorities like DHA Bahawalpur, managing equipment procurement, preventive maintenance, repair authorizations, and financial accounting previously relied upon cumbersome physical paper files.

**DHA-EMS** digitizes this complete operation:
- **Zero Document Loss:** All complaints and procurement requests are tracked by a permanent unique Case ID.
- **Cryptographic Digital Signatures:** Every authority sign-off embeds an unalterable stamp showing officer name, rank/designation, and exact timestamp.
- **Strict Role-Based Authorization:** Every action is governed by fine-grained ability flags (`approve-tickets`, `process-tickets`, `resolve-tickets`, `manage-assets`).
- **Fiscal Compliance:** Enforces financial rules distinguishing between small operational petty cash expenditures and high-value formal tender/minute-sheet procedures.

---

## 2. End-to-End Performa Lifecycle

```mermaid
sequenceDiagram
    autonumber
    actor Clerk as 1. Directorate Clerk
    actor Director as 2. Branch Director
    actor ITAdmin as 3. IT Admin
    actor Tech as 4. Hardware Tech
    actor AddlDir as 5. Addl Dir IT
    actor DirIT as 6. Dir IT
    actor Secy as 7. Secretary DHA

    Clerk->>Director: Generates Performa (New Demand / Repair Complaint)
    Note over Director: Reviews Request & Priority
    alt Request Approved
        Director->>ITAdmin: Digital Sign & Forward (Pending_ICT)
    else Request Rejected
        Director-->>Clerk: Marks Rejected with Reason
    end

    Note over ITAdmin: Performs Technical Triage
    alt Requires Inspection
        ITAdmin->>Tech: Assigns for Physical Diagnostic
        Tech-->>ITAdmin: Submits Inspection Findings
    else Direct Fix
        ITAdmin->>Tech: Assigns for Immediate Repair
        Tech-->>ITAdmin: Resolves Ticket (No Cost)
    end

    opt Requires Commercial Purchase / Repair
        ITAdmin->>ITAdmin: Attaches Vendor Bill & Invoiced Cost
        alt Cost <= PKR 10,000 (Petty Cash Stream)
            ITAdmin->>AddlDir: Forwards for Recommendation
            AddlDir->>DirIT: Digital Sign & Endorse
            DirIT->>Secy: Digital Sign & Submit
            Secy->>ITAdmin: Final Financial Sanction
        else Cost > PKR 10,000 (Minute Sheet Stream)
            ITAdmin->>AddlDir: Initiates Formal Minute Sheet
            AddlDir->>DirIT: Endorses Case Noting
            DirIT->>Secy: Recommends Sanction
            Secy->>ITAdmin: Final Executive Approval
        end
    end
    ITAdmin->>Clerk: Equipment Delivered / Case Closed
```

---

## 3. Dual Financial Streams Architecture

### 3.1 Petty Cash Stream (≤ PKR 10,000)
- **Eligibility:** Equipment maintenance, minor consumable replacements (cables, keyboards, mouse, toner refills, power supply fixes) costing up to Rs. 10,000 PKR.
- **Workflow Pipeline:**
  1. IT Admin completes physical inspection or repair.
  2. IT Admin uploads vendor tax invoice/receipt and enters the exact amount.
  3. Case moves to **Addl Dir IT** (`Pending_Addl_Dir_IT`) for technical concurrence.
  4. Case moves to **Dir IT** (`Pending_IT_Director`) for executive endorsement.
  5. Case moves to **Secretary** (`Pending_Secretary`) for final financial sanction.
  6. Upon Secretary signature, status changes to `Approved`, expense logs are locked, and petty cash expenditure balances are updated.

### 3.2 Minute Sheet Stream (> PKR 10,000)
- **Eligibility:** Heavy hardware replacements (motherboards, enterprise switches, laptops, high-capacity printers, network overhauls) exceeding Rs. 10,000 PKR.
- **Workflow Pipeline:**
  1. IT Admin transitions the ticket to the **Minute Sheet Registry**.
  2. A formal Minute Sheet docket number is generated with detailed executive noting, comparative market quotations, and technician justification.
  3. **Addl Dir IT** reviews the docket and attaches technical remarks.
  4. **Dir IT** approves and signs the minute sheet docket.
  5. **Secretary DHA** reviews the file and awards executive financial sanction.
  6. IT Admin records disbursement, archives the minute sheet, and closes the ticket.

---

## 4. Clarifications, Rejections & Super Admin Reactivation

### Interactive Discussion Channel:
- Any approver (Branch Director, Addl Dir IT, Dir IT, Secretary) can flag a ticket with a query instead of outright rejecting it (e.g., *"What is the lifetime maintenance history of this machine?"*).
- The ticket immediately shifts into the **Discuss Tab**.
- The initiating Clerk or IT Admin receives the query, submits a clarification comment, and routes the ticket back into the active approval stage without losing historical signature stamps.

### Rejection Protocol:
- If a request is deemed non-compliant or unjustified, the reviewing authority executes a digital rejection.
- A distinctive crimson stamp with the reviewer's designation, timestamp, and explanation is affixed to the performa.

### Super Admin Reactivation (Fail-Safe):
- Only users with the `manage-users` (Super Admin) ability can access the **Reactivation Engine** in `All Performa History`.
- If an erroneous rejection occurs, clicking `Reactivate` restores the performa to its pre-rejection state with historical audit logs intact.

---

## 5. Dashboard-by-Dashboard Comprehensive Breakdown

### 5.1 Clerk Portal & Dashboard
- **Target Role:** Directorate Clerks.
- **Route:** `clerk.dashboard`, `tickets.create`, `clerk.history`.
- **Sidebar Elements:**
  - `Dashboard`: Active pending cases, ticket status cards.
  - `New Performa`: Step-by-step form for generating demands.
  - `History`: Archived branch requests.
- **On-Screen Features & Actions:**
  - **Metrics Cards:** Count of Active Tickets, Pending Director, Processing at IT, and Resolved.
  - **Performa Form:** Searchable employee selection, automatic population of DHAB number, branch, designation, and equipment dropdown.
  - **Table Actions:**
    - `View Performa`: Opens printable modal with current approval state and stamps.
    - `Reply Discussion`: Responsive comment modal for answering queries.
    - `Verify Completion`: Button to acknowledge and confirm completion of emergency field repairs.

---

### 5.2 Branch Director Dashboard
- **Target Role:** Directorate Heads / Directors.
- **Route:** `dashboard`, `director.history`.
- **Sidebar Elements:**
  - `Dashboard`: Queue of performas originating from own directorate.
  - `History`: Historical signed documents.
- **On-Screen Features & Actions:**
  - **Batch Selection Bar:** Checkboxes to select multiple performas for single-click bulk authorization.
  - **Quick Filters:** Filter by Request Type (New Demand vs Repair Complaint).
  - **Card Action Buttons:**
    - `Approve & Sign` (Green): Affixes digital stamp and sends to IT Directorate.
    - `Reject` (Red): Opens modal requiring reason before recording rejection.
    - `Discuss` (Amber): Opens dialog to send a query to the Clerk.

---

### 5.3 IT Admin Dashboard (8-Tab Operational Pipeline)
- **Target Role:** IT Admin / Deputy Manager IT.
- **Route:** `dashboard`, `it-admin.minute-sheets`, `it-admin.history`, `it-admin.management`.
- **The 8 Operational Tabs:**
  1. **Tab 1 — New Requests:** Incoming performas authorized by Directorate Directors. IT Admin decides whether to dispatch a technician, resolve immediately, or initiate procurement.
  2. **Tab 2 — Technician Inspecting:** Devices undergoing physical diagnostic inspection by an assigned technician.
  3. **Tab 3 — Technician Workflow:** Active technical work in progress.
  4. **Tab 4 — Bill Attachment:** Completed repair cases requiring invoice attachment, vendor assignment, and financial costing.
  5. **Tab 5 — Addl Dir IT:** Petty cash performas currently queued for Additional Director review.
  6. **Tab 6 — Dir IT:** Performas awaiting Director IT digital authorization.
  7. **Tab 7 — Secretary:** Performas awaiting Secretary final financial sanction.
  8. **Tab 8 — Discuss:** Centralized clearinghouse for tickets with active queries.

---

### 5.4 Additional Director IT Dashboard
- **Target Role:** Additional Director IT (`Addl_IT_Director`).
- **Route:** `dashboard`, `it-director.history`, `it-admin.minute-sheets`, `secretary-approved.index`, `it-admin.technician-performance`.
- **Special Sidebar Links:**
  - `Dashboard`: Active approval queue.
  - `History`: Global archive of all approved performas.
  - `Minute Sheets`: High-value expenditure docket reviews.
  - `Secretary Approved`: Exclusive access to pre-sanctioned executive orders.
  - `Worker Performance`: Exclusive analytics on technician speed and closed tasks.
- **On-Screen Features & Actions:**
  - **Universal Directorate & Type Filters:** Multi-branch filtering.
  - **Performa Details Drawer:** Inspects invoice amounts, asset history, and technical findings.
  - **Sign Action:** Digital sign-off moving the case to Director IT.

---

### 5.5 Director IT Dashboard
- **Target Role:** Director IT (`IT_Director`).
- **Sidebar Elements:**
  - `Dashboard`
  - `History`
  - `Minute Sheets`
- **On-Screen Features & Actions:**
  - High-level executive review queue.
  - Detailed asset background check (previous repairs, accumulated expenses).
  - Digital authorization stamp advancing the ticket to the Secretary.

---

### 5.6 Secretary Dashboard
- **Target Role:** Secretary DHA Bahawalpur (`Secretary`).
- **Sidebar Elements:**
  - `Dashboard`
  - `History`
  - `Minute Sheets`
- **On-Screen Features & Actions:**
  - Clean, distraction-free financial sanction interface.
  - Pre-filtered queues for both Petty Cash and Minute Sheet dockets.
  - `Sanction & Sign` action completing the formal authorization cycle.

---

### 5.7 Technician Portal & Dashboard
- **Target Role:** Hardware & Network Technicians.
- **Route:** `technician.dashboard`, `technician.log-task`, `technician.history`.
- **Sidebar Elements:**
  - `Dashboard`: Assigned active work orders.
  - `Add Task`: Field emergency task submission.
  - `History`: Completed work logs.
- **On-Screen Features & Actions:**
  - **Diagnostic Notes Modal:** Ability to record parts replaced, OS reinstalled, or hardware failures identified.
  - **Resolve Action:** Stamps time of resolution to record accurate turnaround benchmarks.
  - **Emergency Task Submission:** Submit unsolicited emergency work on-site, which prompts the respective branch clerk to digitally verify the repair.

---

### 5.8 Super Admin Control Center & Role Simulator
- **Target Role:** Super Administrator (`Super_Admin`).
- **Route:** `super-admin.dashboard`, `super-admin.all-performa-history`, `super-admin.system-settings`, `super-admin.workflows`.
- **Core Modules:**
  1. **All Performa History:** Master ledger of all historic and active tickets with Reactivate and Delete tools.
  2. **Role Simulation Sub-Panels:** Instant access to simulate views for Clerk, Director, IT Admin, Addl Dir IT, Dir IT, Secretary, and Technician without re-logging.
  3. **Control Center Tabs:**
     - `IT Eqpt Summary`: Category-wise breakdown of in-use, spare, and retired hardware.
     - `Categories`: Manage asset taxonomy and barcode prefixes.
     - `Assignments`: Hardware custody handover, employee assignments, and return processing.
     - `Assets`: Add new physical devices, generate unique asset tags, and print asset stickers.
     - `Employees`: DHA personnel directory.
     - `System Users`: Manage login accounts, roles, and granular ability checkboxes.
     - `Branches & Directorates`: Organizational hierarchy builder.
     - `Approval Workflows`: Category-level approval sequence editor.
     - `System Settings`: Petty cash thresholds and organization metadata.

---

## 6. Secretary Approved Module
- **Purpose:** Manages purchases or maintenance sanctions approved via direct executive board directives or offline tender committees.
- **Key Capabilities:**
  - Upload scanned sanction order PDF / image.
  - Record reference sanction number, authority, amount, and designated vendor.
  - Printable batch report generator (`BatchReport.vue`) designed for audit submission.
  - Directly accessible to IT Admin and Additional Director IT.

---

## 7. Worker Performance & Efficiency Analytics
- **Purpose:** Objective KPI tracking for technical staff.
- **Tracked Parameters:**
  - **Total Assigned Tasks:** Cumulative volume of assigned repairs.
  - **Resolved Tasks:** Successfully verified solutions.
  - **Average Turnaround Time:** Elapsed time from assignment to resolution.
  - **Self-Logged Emergency Deliveries:** Proactive field repairs initiated on-site.

---

## 8. Hardware Asset & Tagging Lifecycle

```
[Procurement] ➔ [Register in Assets] ➔ [Auto-Generate Tag]
      ➔ [Print Barcode / QR Label] ➔ [Affix to Physical Chassis]
      ➔ [Assign to Custodian / Branch] ➔ [Continuous Repair Cost Accumulation]
      ➔ [Asset Transfer / Return] ➔ [Retire / Archive]
```

1. **Unique Tagging:** System auto-generates structured IDs (e.g., `DHAB-IT-PC-0042`).
2. **Thermal Label Print:** `PrintableAssetTag.vue` renders compliant asset tags ready for standard barcode printers.
3. **Cumulative Cost Tracking:** Every performa logged against an asset updates the asset's total lifetime maintenance expenditure ledger.

---

*DHA Bahawalpur Equipment Maintenance System — Architecture Specification.*
