tinyqc/app/Controllers/Qc/ControlTestsController.php

74 lines
1.9 KiB
PHP
Raw Permalink Normal View History

<?php
namespace App\Controllers\Qc;
use CodeIgniter\API\ResponseTrait;
use App\Controllers\BaseController;
use App\Models\Qc\ControlTestsModel;
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
class ControlTestsController extends BaseController
{
use ResponseTrait;
protected $model;
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
protected $rules = [
'controlId' => 'required|numeric',
'testId' => 'required|numeric',
'mean' => 'required|decimal',
'sd' => 'required|decimal',
];
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
public function __construct()
{
$this->model = new ControlTestsModel();
}
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
public function index()
{
$keyword = $this->request->getGet('keyword');
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
return $this->respond([
'status' => 'success',
'data' => $this->model->search($keyword)
]);
}
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
public function create()
{
$input = $this->request->getJSON(true);
if (!$this->validate($this->rules)) {
return $this->failValidationErrors($this->validator->getErrors());
}
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
try {
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
$id = $this->model->insert($input);
return $this->respondCreated(['status' => 'success', 'data' => $id]);
} catch (\Exception $e) {
return $this->failServerError($e->getMessage());
}
}
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
public function update($id = null)
{
$input = $this->request->getJSON(true);
if (!$this->validate($this->rules)) {
return $this->failValidationErrors($this->validator->getErrors());
}
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
try {
$this->model->update($id, $input);
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
return $this->respond(['status' => 'success']);
} catch (\Exception $e) {
return $this->failServerError($e->getMessage());
}
}
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
public function delete($id = null)
{
try {
$this->model->delete($id);
feat: Implement Monthly Entry interface and consolidate Entry API controller - Implement Monthly Entry interface with full data entry grid - Add batch save with validation and statistics for monthly results - Support daily comments per day per test - Add result status indicators and validation summaries - Consolidate Entry API controller - Refactor EntryApiController to handle both daily/monthly operations - Add batch save endpoints with comprehensive validation - Implement statistics calculation for result entries - Add Control Test master data management - Create MasterControlsController for CRUD operations - Add dialog forms for control test configuration - Implement control-test associations with QC parameters - Refactor Report API and views - Implement new report index with Levey-Jennings charts placeholder - Add monthly report functionality with result statistics - Include QC summary with mean, SD, and CV calculations - UI improvements - Overhaul dashboard with improved layout - Update daily entry interface with inline editing - Enhance master data management with DaisyUI components - Add proper modal dialogs and form validation - Database and seeding - Update migration for control_tests table schema - Remove redundant migration and seed files - Update seeders with comprehensive test data - Documentation - Update CLAUDE.md with comprehensive project documentation - Add architecture overview and conventions BREAKING CHANGES: - Refactored Entry API endpoints structure - Removed ReportApiController::view() - consolidated into new report index
2026-01-21 13:41:37 +07:00
return $this->respond(['status' => 'success']);
} catch (\Exception $e) {
return $this->failServerError($e->getMessage());
}
}
}