# Equipment Maintenance System - Code Functionality

## 1. Ticket Generation & Asset Assignment
When a Clerk or Admin creates a new ticket via `CreateTicket.vue`, they can select an `Employee` and an `AssetCategory`. If the category is an existing hardware type (e.g., Laptop, Printer), they can link it directly to a registered `Asset`.
- **Logic**: The `generateCaseNo()` method on the `Ticket` model parses the latest database entry and increments the identifier (e.g., IT-00014 -> IT-00015).
- **Date Manipulation**: Built-in logic exists to allow Admins to "Backdate" tickets. This overrides `created_at` in the DB but preserves the chronological sequence.

## 2. IT Admin Toolset
The IT Admin (often considered the operational core of the system) handles day-to-day processing:
- **Dashboard**: Lists all tickets in progress. Can assign Technicians, enter cost details, and generate "Minute Sheets".
- **Equipment Maintenance Summary**: Groups resolved tickets by `Asset` to calculate aggregate repair costs (`total_repair_cost`) and `last_repaired_at` dates. Helps determine if an asset is worth repairing or should be condemned.
- **Worker Performance**: Aggregates ticket assignments and resolutions by Technician. Calculates success rates and renders visual comparison graphs.

## 3. Reporting & PDF Generation
Several pages (History, Asset History, Worker Performance Details) include functionality to generate comprehensive, printable reports.
- **Implementation**: Instead of relying on backend PDF generators (like dompdf), the system heavily utilizes browser-level printing capabilities.
- **Logic**: Vue modals with `@media print` CSS rules are used. The `hide-on-print` utility class strips away navigation bars, sidebars, and extraneous buttons, rendering only the `#report-print-area` cleanly on a physical page or PDF output.

## 4. Vue & Frontend Logic
- **Reusability**: Core UI pieces are extracted to `Components/`. Forms are handled primarily via Inertia's `useForm` wrapper for seamless validation error handling.
- **Modals**: Custom implementation utilizing absolute positioning, z-indexes, and Vue transitions for fluid UI feedback.
- **Real-Time Responsiveness**: Axios / Inertia router calls update state locally without reloading the page, giving the perception of a lightning-fast SPA (Single Page Application).
