From a1f6b1df61678614c778a839add0d4504f2be688 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Tue, 4 Nov 2025 13:07:04 +0700 Subject: [PATCH] add dummy data for organization --- .../2025-10-23-100001_CRM_Organizations.php | 4 +-- .../2025-10-23-110105_Organization.php | 1 - app/Database/Seeds/DBSeeder.php | 2 +- app/Database/Seeds/DummySeeder.php | 27 +++++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/app/Database/Migrations/2025-10-23-100001_CRM_Organizations.php b/app/Database/Migrations/2025-10-23-100001_CRM_Organizations.php index 2e3ef30..61af7e5 100644 --- a/app/Database/Migrations/2025-10-23-100001_CRM_Organizations.php +++ b/app/Database/Migrations/2025-10-23-100001_CRM_Organizations.php @@ -9,9 +9,9 @@ class CreateCRMOrgTable extends Migration { $this->forge->addField([ 'AccountID' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true], - 'ParentAccount' => ['type' => 'INT', 'null' => true], + 'Parent' => ['type' => 'INT', 'null' => true], 'AccountName' => ['type' => 'VARCHAR', 'constraint' => 10, 'null' => false], - 'Inital' => ['type' => 'VARCHAR', 'constraint' => 100, 'null' => false], + 'Initial' => ['type' => 'VARCHAR', 'constraint' => 100, 'null' => false], 'Street_1' => ['type' => 'VARCHAR', 'constraint' => 150, 'null' => true], 'Street_2' => ['type' => 'VARCHAR', 'constraint' => 150, 'null' => true], 'Street_3' => ['type' => 'VARCHAR', 'constraint' => 150, 'null' => true], diff --git a/app/Database/Migrations/2025-10-23-110105_Organization.php b/app/Database/Migrations/2025-10-23-110105_Organization.php index e5451d2..0c8fcd7 100644 --- a/app/Database/Migrations/2025-10-23-110105_Organization.php +++ b/app/Database/Migrations/2025-10-23-110105_Organization.php @@ -36,7 +36,6 @@ class Organization extends Migration { 'Type' => ['type' => 'tinyint', 'null'=> true], 'LinkTo' => ['type' => 'int', 'null'=> true], 'Enable' => ['type' => 'bit', 'null'=> true], - 'EquipmentID' => ['type' => 'varchar', 'constraint'=>'10', 'null'=> true], 'CreateDate' => ['type'=>'DATETIME', 'null' => true], 'EndDate' => ['type'=>'DATETIME', 'null' => true] ]); diff --git a/app/Database/Seeds/DBSeeder.php b/app/Database/Seeds/DBSeeder.php index 5e60c4b..5205c04 100644 --- a/app/Database/Seeds/DBSeeder.php +++ b/app/Database/Seeds/DBSeeder.php @@ -10,4 +10,4 @@ class DBSeeder extends Seeder { $this->call('DummySeeder'); $this->call('CounterSeeder'); } -} +} \ No newline at end of file diff --git a/app/Database/Seeds/DummySeeder.php b/app/Database/Seeds/DummySeeder.php index b6c8819..3cbe194 100644 --- a/app/Database/Seeds/DummySeeder.php +++ b/app/Database/Seeds/DummySeeder.php @@ -94,5 +94,32 @@ class DummySeeder extends Seeder { ['ConCode' => '900','ConName' => 'Packing Pengiriman', 'ConDesc' =>'Specimen Transport Packaging', 'Additive' => "71", 'ConClass' => '81', 'CreateDate'=> "$now"], ]; $this->db->table('containerdef')->insertBatch($data); + + // Organization + $data = [ + [ 'AccountID' => 1, 'Parent' => null, 'AccountName' => 'Dummy Account', 'Initial'=>'QAC', 'Street_1'=>'Dummy Address', 'City'=>'Siti', 'Province'=>'Prop', + 'Zip'=>'505', 'Country'=>'Arab', 'AreaCode'=>'', 'EmailAddress1'=>'dummy@summit.co.id', 'Phone'=>'092029', 'Fax'=>'092029', 'CreateDate' => "$now" ] + ]; + $this->db->table('account')->insertBatch($data); + + $data = [ + [ 'SiteID' => 1, 'SiteCode' => 'QSIT', 'SiteName' => 'Dummy Site', 'AccountID'=>1, 'SiteTypeID'=>null, 'Parent'=>null, 'SiteClassID'=>null, 'ME'=>null, 'CreateDate' => "$now" ] + ]; + $this->db->table('site')->insertBatch($data); + + $data = [ + [ 'DisciplineID' => 1, 'DisciplineCode' => 'QDIS', 'DisciplineName' => 'Dummy Discipline', 'CreateDate' => "$now" ], + ]; + $this->db->table('discipline')->insertBatch($data); + + $data = [ + [ 'DepartmentID' => 1, 'DisciplineID' => 1, 'SiteID' => 1, 'DepartmentCode'=> 'QDEP', 'DepartmentName'=>'Dummy Department', 'CreateDate' => "$now" ], + ]; + $this->db->table('department')->insertBatch($data); + + $data = [ + [ 'WorkstationID' => 1, 'DepartmentID' => 1, 'WorkstationCode' => 'QWST', 'WorkstationName'=>'Dummy Workstation', 'Type'=>null, 'LinkTo'=> null, 'Enable'=>1,'CreateDate' => "$now" ], + ]; + $this->db->table('workstation')->insertBatch($data); } } \ No newline at end of file