clqms-be/app/Database/Seeds/DummySeeder.php

42 lines
1.8 KiB
PHP
Raw Normal View History

2025-09-11 11:09:04 +07:00
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
feat(routes): add container alias endpoint for ContainerDefController Added an alternative route alias 'container' that points to ContainerDefController, providing backward compatibility and flexibility in API endpoint naming. - Routes '/api/specimen/container' to ContainerDefController methods - Supports GET, GET with ID, POST, and PATCH operations - Existing '/api/specimen/containerdef' routes remain unchanged File: app/Config/Routes.php (+7 lines) --- refactor(seeds): update and standardize seed data across multiple seeders Improved data consistency and coverage in database seeds: AreaGeoSeeder.php: - Updated geographic area data for better regional coverage - Standardized data format and field values DummySeeder.php: - Refactored dummy data generation for test environments - Improved data integrity and relationships PatientSeeder.php: - Enhanced patient test data with more realistic scenarios - Updated patient demographic information - Improved test result distributions Total: 111 lines changed across seed files --- docs: add CLQMS project documentation - Added project documentation file: "prj_clinical laboratory quality management system_3a.docx" - Comprehensive project specification and requirements document --- test: remove deprecated TestDefSiteTest.php - Removed obsolete test file that is no longer needed - Test coverage consolidated into other test classes File: tests/feature/TestDef/TestDefSiteTest.php (-374 lines) --- Summary: - +58 lines added (routes, seeds, docs) - -434 lines removed (deprecated test file) - 6 files affected
2026-01-07 16:55:25 +07:00
class DummySeeder extends Seeder
{
public function run()
{
2025-10-15 16:08:52 +07:00
$now = date('Y-m-d H:i:s');
2025-12-17 15:19:55 +07:00
// users
2025-12-22 16:54:19 +07:00
// Password: 'password' for all users (bcrypt hash)
feat(routes): add container alias endpoint for ContainerDefController Added an alternative route alias 'container' that points to ContainerDefController, providing backward compatibility and flexibility in API endpoint naming. - Routes '/api/specimen/container' to ContainerDefController methods - Supports GET, GET with ID, POST, and PATCH operations - Existing '/api/specimen/containerdef' routes remain unchanged File: app/Config/Routes.php (+7 lines) --- refactor(seeds): update and standardize seed data across multiple seeders Improved data consistency and coverage in database seeds: AreaGeoSeeder.php: - Updated geographic area data for better regional coverage - Standardized data format and field values DummySeeder.php: - Refactored dummy data generation for test environments - Improved data integrity and relationships PatientSeeder.php: - Enhanced patient test data with more realistic scenarios - Updated patient demographic information - Improved test result distributions Total: 111 lines changed across seed files --- docs: add CLQMS project documentation - Added project documentation file: "prj_clinical laboratory quality management system_3a.docx" - Comprehensive project specification and requirements document --- test: remove deprecated TestDefSiteTest.php - Removed obsolete test file that is no longer needed - Test coverage consolidated into other test classes File: tests/feature/TestDef/TestDefSiteTest.php (-374 lines) --- Summary: - +58 lines added (routes, seeds, docs) - -434 lines removed (deprecated test file) - 6 files affected
2026-01-07 16:55:25 +07:00
$passwordHash = password_hash('123', PASSWORD_BCRYPT);
$data = [
feat(routes): add container alias endpoint for ContainerDefController Added an alternative route alias 'container' that points to ContainerDefController, providing backward compatibility and flexibility in API endpoint naming. - Routes '/api/specimen/container' to ContainerDefController methods - Supports GET, GET with ID, POST, and PATCH operations - Existing '/api/specimen/containerdef' routes remain unchanged File: app/Config/Routes.php (+7 lines) --- refactor(seeds): update and standardize seed data across multiple seeders Improved data consistency and coverage in database seeds: AreaGeoSeeder.php: - Updated geographic area data for better regional coverage - Standardized data format and field values DummySeeder.php: - Refactored dummy data generation for test environments - Improved data integrity and relationships PatientSeeder.php: - Enhanced patient test data with more realistic scenarios - Updated patient demographic information - Improved test result distributions Total: 111 lines changed across seed files --- docs: add CLQMS project documentation - Added project documentation file: "prj_clinical laboratory quality management system_3a.docx" - Comprehensive project specification and requirements document --- test: remove deprecated TestDefSiteTest.php - Removed obsolete test file that is no longer needed - Test coverage consolidated into other test classes File: tests/feature/TestDef/TestDefSiteTest.php (-374 lines) --- Summary: - +58 lines added (routes, seeds, docs) - -434 lines removed (deprecated test file) - 6 files affected
2026-01-07 16:55:25 +07:00
['id' => 1, 'role_id' => 1, 'username' => 'lisfse', 'password' => $passwordHash],
['id' => 2, 'role_id' => 1, 'username' => 'tes', 'password' => $passwordHash]
];
$this->db->table('users')->insertBatch($data);
2025-11-13 13:49:24 +07:00
// patvisit
2025-12-17 15:19:55 +07:00
$data = [
['InternalPVID' => 1, "PVID" => "XLAB0001", "InternalPID" => 1, "EpisodeID" => 1, "CreateDate" => "$now"],
['InternalPVID' => 2, "PVID" => "XLAB0002", "InternalPID" => 1, "EpisodeID" => 1, "CreateDate" => "$now"],
2025-11-13 13:49:24 +07:00
];
$this->db->table('patvisit')->insertBatch($data);
2025-12-17 15:19:55 +07:00
// patvisitadt
$data = [
['InternalPVID' => 1, "ADTCode" => "X01", "LocationID" => 1, "AttDoc" => null, "CreateDate" => "$now"],
['InternalPVID' => 1, "ADTCode" => "X02", "LocationID" => null, "AttDoc" => 1, "CreateDate" => "$now"],
['InternalPVID' => 1, "ADTCode" => "X01", "LocationID" => 2, "AttDoc" => null, "CreateDate" => "$now"],
['InternalPVID' => 1, "ADTCode" => "X02", "LocationID" => null, "AttDoc" => 2, "CreateDate" => "$now"],
['InternalPVID' => 2, "ADTCode" => "X01", "LocationID" => 1, "AttDoc" => null, "CreateDate" => "$now"],
['InternalPVID' => 2, "ADTCode" => "X02", "LocationID" => null, "AttDoc" => 1, "CreateDate" => "$now"],
['InternalPVID' => 2, "ADTCode" => "X01", "LocationID" => 2, "AttDoc" => null, "CreateDate" => "$now"],
['InternalPVID' => 2, "ADTCode" => "X02", "LocationID" => null, "AttDoc" => 2, "CreateDate" => "$now"],
2025-11-13 13:49:24 +07:00
];
$this->db->table('patvisitadt')->insertBatch($data);
2025-09-11 11:09:04 +07:00
}
}