Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use CodeIgniter\Router\RouteCollection;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var RouteCollection $routes
|
|
|
|
|
*/
|
|
|
|
|
$routes->get('/', 'PageController::dashboard');
|
|
|
|
|
|
2026-01-19 06:37:37 +07:00
|
|
|
$routes->get('/master/dept', 'PageController::masterDept');
|
|
|
|
|
$routes->get('/master/test', 'PageController::masterTest');
|
|
|
|
|
$routes->get('/master/control', 'PageController::masterControl');
|
Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
$routes->get('/dept', 'PageController::dept');
|
|
|
|
|
$routes->get('/test', 'PageController::test');
|
|
|
|
|
$routes->get('/control', 'PageController::control');
|
|
|
|
|
$routes->get('/entry', 'PageController::entry');
|
|
|
|
|
$routes->get('/entry/daily', 'PageController::entryDaily');
|
|
|
|
|
$routes->get('/report', 'PageController::report');
|
|
|
|
|
$routes->get('/report/view', 'PageController::reportView');
|
|
|
|
|
|
|
|
|
|
$routes->group('api', function ($routes) {
|
docs: add comprehensive documentation and refactor API structure
This commit introduces a complete documentation suite, refactors the API layer for
better consistency, and updates the database schema and seeding logic.
Key Changes:
- Documentation:
- Added `CLAUDE.md` with development guidelines and architecture overview.
- Created `docs/` directory with detailed guides for architecture, development,
and source tree analysis.
- Database & Migrations:
- Implemented `RenameMasterColumns` migration to standardize column naming
(e.g., `name` -> `dept_name`, `name` -> `control_name`).
- Added `CmodQcSeeder` to populate the system with realistic sample data
for depts, controls, tests, and results.
- Backend API:
- Created `DashboardApiController` with `getRecent()` for dashboard stats.
- Created `ReportApiController` for managed reporting access.
- Updated `app/Config/Routes.php` with new API groupings and documentation routes.
- Frontend & Views:
- Refactored master data views (`dept`, `test`, `control`) to use Alpine.js
and the updated API structure.
- Modernized `dashboard.php` and `main_layout.php` with improved UI/UX.
- Infrastructure:
- Updated `.gitignore` to exclude development-specific artifacts (`_bmad/`, `.claude/`).
2026-01-20 14:44:46 +07:00
|
|
|
$routes->get('dashboard/recent', 'Api\DashboardApiController::getRecent');
|
Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
$routes->get('dept', 'Api\DeptApiController::index');
|
|
|
|
|
$routes->get('dept/(:num)', 'Api\DeptApiController::show/$1');
|
|
|
|
|
$routes->post('dept', 'Api\DeptApiController::store');
|
2026-01-15 10:44:09 +07:00
|
|
|
$routes->patch('dept/(:num)', 'Api\DeptApiController::update/$1');
|
Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
$routes->delete('dept/(:num)', 'Api\DeptApiController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('test', 'Api\TestApiController::index');
|
|
|
|
|
$routes->get('test/(:num)', 'Api\TestApiController::show/$1');
|
2026-01-16 16:31:50 +07:00
|
|
|
$routes->post('test', 'Api\TestApiController::create');
|
2026-01-15 10:44:09 +07:00
|
|
|
$routes->patch('test/(:num)', 'Api\TestApiController::update/$1');
|
Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
$routes->delete('test/(:num)', 'Api\TestApiController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('control', 'Api\ControlApiController::index');
|
|
|
|
|
$routes->get('control/(:num)', 'Api\ControlApiController::show/$1');
|
|
|
|
|
$routes->get('control/(:num)/tests', 'Api\ControlApiController::getTests/$1');
|
2026-01-16 16:38:27 +07:00
|
|
|
$routes->post('control', 'Api\ControlApiController::create');
|
2026-01-15 10:44:09 +07:00
|
|
|
$routes->patch('control/(:num)', 'Api\ControlApiController::update/$1');
|
Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
$routes->delete('control/(:num)', 'Api\ControlApiController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('entry/controls', 'Api\EntryApiController::getControls');
|
|
|
|
|
$routes->get('entry/tests', 'Api\EntryApiController::getTests');
|
2026-01-16 16:51:34 +07:00
|
|
|
$routes->get('entry/monthly', 'Api\EntryApiController::getMonthlyData');
|
Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00
|
|
|
$routes->post('entry/daily', 'Api\EntryApiController::saveDaily');
|
|
|
|
|
$routes->post('entry/monthly', 'Api\EntryApiController::saveMonthly');
|
|
|
|
|
$routes->post('entry/comment', 'Api\EntryApiController::saveComment');
|
|
|
|
|
});
|
2026-01-19 06:37:37 +07:00
|
|
|
|
|
|
|
|
$routes->group('api/master', function ($routes) {
|
|
|
|
|
$routes->get('depts', 'Master\MasterDeptsController::index');
|
|
|
|
|
$routes->get('depts/(:num)', 'Master\MasterDeptsController::show/$1');
|
|
|
|
|
$routes->post('depts', 'Master\MasterDeptsController::create');
|
|
|
|
|
$routes->patch('depts/(:num)', 'Master\MasterDeptsController::update/$1');
|
|
|
|
|
$routes->delete('depts/(:num)', 'Master\MasterDeptsController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('controls', 'Master\MasterControlsController::index');
|
|
|
|
|
$routes->get('controls/(:num)', 'Master\MasterControlsController::show/$1');
|
|
|
|
|
$routes->post('controls', 'Master\MasterControlsController::create');
|
|
|
|
|
$routes->patch('controls/(:num)', 'Master\MasterControlsController::update/$1');
|
|
|
|
|
$routes->delete('controls/(:num)', 'Master\MasterControlsController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('tests', 'Master\MasterTestsController::index');
|
|
|
|
|
$routes->get('tests/(:num)', 'Master\MasterTestsController::show/$1');
|
|
|
|
|
$routes->post('tests', 'Master\MasterTestsController::create');
|
|
|
|
|
$routes->patch('tests/(:num)', 'Master\MasterTestsController::update/$1');
|
|
|
|
|
$routes->delete('tests/(:num)', 'Master\MasterTestsController::delete/$1');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$routes->group('api/qc', function ($routes) {
|
|
|
|
|
$routes->get('control-tests', 'Qc\ControlTestsController::index');
|
|
|
|
|
$routes->get('control-tests/(:num)', 'Qc\ControlTestsController::show/$1');
|
|
|
|
|
$routes->post('control-tests', 'Qc\ControlTestsController::create');
|
|
|
|
|
$routes->patch('control-tests/(:num)', 'Qc\ControlTestsController::update/$1');
|
|
|
|
|
$routes->delete('control-tests/(:num)', 'Qc\ControlTestsController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('results', 'Qc\ResultsController::index');
|
|
|
|
|
$routes->get('results/(:num)', 'Qc\ResultsController::show/$1');
|
|
|
|
|
$routes->post('results', 'Qc\ResultsController::create');
|
|
|
|
|
$routes->patch('results/(:num)', 'Qc\ResultsController::update/$1');
|
|
|
|
|
$routes->delete('results/(:num)', 'Qc\ResultsController::delete/$1');
|
|
|
|
|
|
|
|
|
|
$routes->get('result-comments', 'Qc\ResultCommentsController::index');
|
|
|
|
|
$routes->get('result-comments/(:num)', 'Qc\ResultCommentsController::show/$1');
|
|
|
|
|
$routes->post('result-comments', 'Qc\ResultCommentsController::create');
|
|
|
|
|
$routes->patch('result-comments/(:num)', 'Qc\ResultCommentsController::update/$1');
|
|
|
|
|
$routes->delete('result-comments/(:num)', 'Qc\ResultCommentsController::delete/$1');
|
|
|
|
|
});
|