diff --git a/app/Controllers/Test/TestDef.php b/app/Controllers/Test/TestDef.php index 477660f..10b0e52 100644 --- a/app/Controllers/Test/TestDef.php +++ b/app/Controllers/Test/TestDef.php @@ -34,7 +34,7 @@ class TestDef extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } try { $id = $this->model->insert($input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data created successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } @@ -47,7 +47,7 @@ class TestDef extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); } try { $this->model->update($id,$input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data updated successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Test/TestDefCal.php b/app/Controllers/Test/TestDefCal.php index ffa7451..894ff1c 100644 --- a/app/Controllers/Test/TestDefCal.php +++ b/app/Controllers/Test/TestDefCal.php @@ -34,7 +34,7 @@ class TestDefCal extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } try { $id = $this->model->insert($input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data created successfully", 'data' => $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } @@ -47,7 +47,7 @@ class TestDefCal extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); } try { $this->model->update($id,$input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data updated successfully", 'data' => $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Test/TestDefSite.php b/app/Controllers/Test/TestDefSite.php index f797e94..8206df4 100644 --- a/app/Controllers/Test/TestDefSite.php +++ b/app/Controllers/Test/TestDefSite.php @@ -39,7 +39,7 @@ class TestDefSite extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } try { $id = $this->model->insert($input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data created successfully", 'data' => $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } @@ -52,7 +52,7 @@ class TestDefSite extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); } try { $this->model->update($id,$input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data updated successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Test/TestDefTech.php b/app/Controllers/Test/TestDefTech.php index d7e0cc4..292deab 100644 --- a/app/Controllers/Test/TestDefTech.php +++ b/app/Controllers/Test/TestDefTech.php @@ -34,7 +34,7 @@ class TestDefTech extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } try { $id = $this->model->insert($input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data created successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } @@ -47,7 +47,7 @@ class TestDefTech extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); } try { $this->model->update($id,$input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data updated successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Test/TestGrp.php b/app/Controllers/Test/TestGrp.php index dea1606..2c9aed6 100644 --- a/app/Controllers/Test/TestGrp.php +++ b/app/Controllers/Test/TestGrp.php @@ -34,7 +34,7 @@ class TestGrp extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } try { $id = $this->model->insert($input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data created successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } @@ -47,7 +47,7 @@ class TestGrp extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); } try { $this->model->update($id,$input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data updated successfully", 'data'=> $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Controllers/Test/TestMap.php b/app/Controllers/Test/TestMap.php index bfe90ff..718600f 100644 --- a/app/Controllers/Test/TestMap.php +++ b/app/Controllers/Test/TestMap.php @@ -34,7 +34,7 @@ class TestMap extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } try { $id = $this->model->insert($input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id created successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data created successfully", 'data' => $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } @@ -47,7 +47,7 @@ class TestMap extends BaseController { if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors( $this->validator->getErrors() ); } try { $this->model->update($id,$input); - return $this->respondCreated([ 'status' => 'success', 'message' => "data $id updated successfully" ]); + return $this->respondCreated([ 'status' => 'success', 'message' => "data updated successfully", 'data' => $id ]); } catch (\Exception $e) { return $this->failServerError('Something went wrong: ' . $e->getMessage()); } diff --git a/app/Database/Migrations/2025-10-11-100001_Test.php b/app/Database/Migrations/2025-10-11-100001_Test.php index 884d8f2..1a4eb6a 100644 --- a/app/Database/Migrations/2025-10-11-100001_Test.php +++ b/app/Database/Migrations/2025-10-11-100001_Test.php @@ -15,7 +15,7 @@ class CreateTestsTable extends Migration { 'DisciplineID' => ['type' => 'INT', 'null' => false], 'Method' => ['type' => 'varchar', 'constraint'=>50, 'null' => true], 'Seq' => ['type' => 'int', 'constraint'=> 15, 'null' => true], - 'CountStat' => ['type' => 'int' ], + 'CountStat' => ['type' => 'int', 'null' => true ], 'CreateDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true], ]); @@ -29,12 +29,12 @@ class CreateTestsTable extends Migration { 'TestSiteName' => ['type' => 'varchar', 'constraint'=> 50, 'null' => false], 'Type' => ['type' => 'int', 'null' => false], 'Description' => ['type' => 'varchar', 'constraint'=> 150, 'null' => true], - 'SeqScr' => ['type' => 'int', 'null' => false], - 'SeqRpt' => ['type' => 'int', 'null' => false], - 'IndentLeft' => ['type' => 'int', 'null' => false], - 'VisibleScr' => ['type' => 'int', 'null' => false], - 'VisibleRpt' => ['type' => 'int', 'null' => false], - 'CountStat' => ['type' => 'int', 'null' => false], + 'SeqScr' => ['type' => 'int', 'null' => true], + 'SeqRpt' => ['type' => 'int', 'null' => true], + 'IndentLeft' => ['type' => 'int', 'null' => true], + 'VisibleScr' => ['type' => 'int', 'null' => true], + 'VisibleRpt' => ['type' => 'int', 'null' => true], + 'CountStat' => ['type' => 'int', 'null' => true], 'CreateDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true], ]); @@ -44,7 +44,7 @@ class CreateTestsTable extends Migration { $this->forge->addField([ 'TestTechID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'SiteID' => ['type' => 'INT', 'null' => true], - 'TestSiteID' => ['type' => 'INT', 'null' => true], + 'TestSiteID' => ['type' => 'INT', 'null' => false], 'DisciplineID' => ['type' => 'int', 'null' => true], 'DepartmentID' => ['type' => 'int', 'null' => true], 'WorkstationID' => ['type' => 'int', 'null' => true], @@ -69,7 +69,7 @@ class CreateTestsTable extends Migration { $this->forge->addField([ 'TestCalID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'SiteID' => ['type' => 'INT', 'null' => true], - 'TestSiteID' => ['type' => 'INT', 'null' => true], + 'TestSiteID' => ['type' => 'INT', 'null' => false], 'DisciplineID' => ['type' => 'INT', 'null' => true], 'DepartmentID' => ['type' => 'INT', 'null' => true], 'FormulaCode' => ['type' => 'varchar', 'constraint'=>150, 'null' => true], @@ -87,7 +87,7 @@ class CreateTestsTable extends Migration { $this->forge->addField([ 'TestGrpID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'SiteID' => ['type' => 'INT', 'null' => true], - 'TestSiteID' => ['type' => 'INT', 'null' => true], + 'TestSiteID' => ['type' => 'INT', 'null' => false], 'Member' => ['type' => 'INT', 'null' => true], 'CreateDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true]