# CRUD Page Standard – Implementation Notes

This project follows the system-wide rule that applicable administrative modules use separate pages for:

**Index → Create → View → Edit**

## Rules

- Index pages are list/report pages. They may contain search/filter/export/print controls and inline delete confirmation forms, but normal Create/Edit/View forms must not be embedded in the list page.
- Create pages contain only the new-record form and navigation back to the list.
- View pages are dedicated record detail pages with relevant actions.
- Edit pages are dedicated forms with existing values pre-filled.
- Delete actions must be explicit, permission-protected, and confirmed before submission.
- Important financial deletes/updates are audit logged.
- Workflow/report/dashboard pages are not treated as CRUD entities unless they directly manage persistent records.

## Refactoring completed in this revision

### Finance
- Student Fees: separate Index/Create/View/Edit.
- Payments: separate Index/Create/View/Edit.
- Teacher Salaries / Payroll: separate Index/Create/View/Edit.
- Salary Advances: separate Index/Create/View/Edit.
- Expenses: separate Index/Create/View/Edit.
- Fixed Assets: separate Index/Create/View/Edit plus delete/audit support.
- Currency Exchange: separate Index/Create/View/Edit plus delete/audit support.
- Archive Documents: separate Index/Create/View/Edit plus delete/audit support.
- Legacy finance sections now redirect to the canonical separated finance pages instead of rendering mixed create/list forms.

### Attendance
- Added missing View/Edit/Update/Delete controller actions.
- Added dedicated View and Edit pages.
- Index now exposes View/Edit/Delete actions with delete confirmation.

### Admissions / Kankor
- Entrance Examination Create and Edit are now dedicated pages.
- View remains a dedicated page.
- Index is list-only.
- Delete is protected when applicants are already assigned to the examination.

### Website/content resources
Dedicated View support was completed for applicable resources including Pages, Posts, Videos, Galleries, Download Items, Timetable, Team Members, Testimonials, and Website Content Items.

### Routes
- Removed duplicate Teachers resource registration.
- Removed redundant Videos index alias from active navigation.
- Removed duplicate Transcript semester endpoint.
- Added explicit names to Transcript AJAX routes.
- Normalized the cumulative transcript route name.
- Current route audit reports no duplicate route names and no duplicate HTTP-method + URI pairs.

## Verification performed

- PHP syntax checks passed for modified PHP files.
- Laravel route list builds successfully in JSON mode.
- Route audit: 0 duplicate route names.
- Route audit: 0 duplicate HTTP-method + URI pairs.
- Blade compilation audit: 0 Blade syntax errors.
- Resource-controller CRUD action audit: no missing resource controller actions found in the reviewed resource routes.

## Environment note

The local verification environment is missing PHP's DOM extension (`DOMDocument`). Because of that, PHPUnit and Artisan commands that render Termwind console output can fail in this environment even when application parsing succeeds. Install/enable the PHP DOM/XML extension before running the full PHPUnit suite in the deployment environment.
