clqms-be/app/Database/Seeds/DummySeeder.php
mahdahar 5fb572c122 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

42 lines
1.8 KiB
PHP

<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class DummySeeder extends Seeder
{
public function run()
{
$now = date('Y-m-d H:i:s');
// users
// Password: 'password' for all users (bcrypt hash)
$passwordHash = password_hash('123', PASSWORD_BCRYPT);
$data = [
['id' => 1, 'role_id' => 1, 'username' => 'lisfse', 'password' => $passwordHash],
['id' => 2, 'role_id' => 1, 'username' => 'tes', 'password' => $passwordHash]
];
$this->db->table('users')->insertBatch($data);
// patvisit
$data = [
['InternalPVID' => 1, "PVID" => "XLAB0001", "InternalPID" => 1, "EpisodeID" => 1, "CreateDate" => "$now"],
['InternalPVID' => 2, "PVID" => "XLAB0002", "InternalPID" => 1, "EpisodeID" => 1, "CreateDate" => "$now"],
];
$this->db->table('patvisit')->insertBatch($data);
// 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"],
];
$this->db->table('patvisitadt')->insertBatch($data);
}
}