From c03601aebb9b64f98c59935c8e1f52313400da22 Mon Sep 17 00:00:00 2001 From: joddyabott Date: Mon, 4 Aug 2025 12:14:01 +0330 Subject: [PATCH] debug code for seecend time --- .../V3/Dashboard/Harim/GeneralManagerController.php | 4 ++-- .../Controllers/V3/Dashboard/Harim/HarimOfficeController.php | 4 ++-- .../V3/Dashboard/Harim/ProvinceOfficeController.php | 2 +- .../V3/Dashboard/Harim/TechnicalDeputyController.php | 2 +- .../2025_07_30_153216_create_harim_histories_table.php | 4 +--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/V3/Dashboard/Harim/GeneralManagerController.php b/app/Http/Controllers/V3/Dashboard/Harim/GeneralManagerController.php index 14bcd353..28bd14c8 100644 --- a/app/Http/Controllers/V3/Dashboard/Harim/GeneralManagerController.php +++ b/app/Http/Controllers/V3/Dashboard/Harim/GeneralManagerController.php @@ -38,7 +38,7 @@ class GeneralManagerController extends Controller DB::transaction(function () use ($request, $harim) { $action = HarimAction::CONFIRM->value; $harim->histories()->create([ - 'user_id' => auth()->user()->id, + 'expert_id' => auth()->user()->id, 'previous_state_id' => $harim->state_id, 'previous_state_name' => $harim->state_name, 'expert_description' => $request->expert_description, @@ -60,7 +60,7 @@ class GeneralManagerController extends Controller DB::transaction(function () use ($request, $harim) { $action = HarimAction::REJECT->value; $harim->histories()->create([ - 'user_id'=> auth()->user()->id, + 'expert_id'=> auth()->user()->id, 'previous-state_id' => $harim->state_id, 'previous_state_name' => $harim->state_name, 'export_description' => $request->export_description, diff --git a/app/Http/Controllers/V3/Dashboard/Harim/HarimOfficeController.php b/app/Http/Controllers/V3/Dashboard/Harim/HarimOfficeController.php index 5ffa40c6..60f8cff9 100644 --- a/app/Http/Controllers/V3/Dashboard/Harim/HarimOfficeController.php +++ b/app/Http/Controllers/V3/Dashboard/Harim/HarimOfficeController.php @@ -38,7 +38,7 @@ class HarimOfficeController extends Controller DB::transaction(function () use ($request,$harim) { $action = HarimAction::YES->value; $harim->histories()->create([ - 'user_id' => auth()->user()->id, + 'expert_id' => auth()->user()->id, 'previous_state_id' => $harim->state_id, 'previous_state_name' => $harim->state_name, 'expert_description' => $request->expert_description, @@ -61,7 +61,7 @@ class HarimOfficeController extends Controller DB::transaction(function () use ($request,$harim) { $action = HarimAction::NO->value; $harim->histories()->create([ - 'user_id' => auth()->user()->id, + 'expert_id' => auth()->user()->id, 'previous_state_id' => $harim->state_id, 'previous_state_name' => $harim->state_name, 'expert_description' => $request->expert_description, diff --git a/app/Http/Controllers/V3/Dashboard/Harim/ProvinceOfficeController.php b/app/Http/Controllers/V3/Dashboard/Harim/ProvinceOfficeController.php index 0739cd31..43dd7ef6 100644 --- a/app/Http/Controllers/V3/Dashboard/Harim/ProvinceOfficeController.php +++ b/app/Http/Controllers/V3/Dashboard/Harim/ProvinceOfficeController.php @@ -39,7 +39,7 @@ class ProvinceOfficeController extends Controller $action = HarimAction::FEEDBACK->value; $harim->histories()->create([ - 'user_id' => auth()->user()->id, + 'expert_id' => auth()->user()->id, 'previous_state_id' => $harim->state_id, 'previous_state_name' => $harim->state_name, 'expert_description' => $request->expert_description, diff --git a/app/Http/Controllers/V3/Dashboard/Harim/TechnicalDeputyController.php b/app/Http/Controllers/V3/Dashboard/Harim/TechnicalDeputyController.php index f5c3099a..c48ac1ff 100644 --- a/app/Http/Controllers/V3/Dashboard/Harim/TechnicalDeputyController.php +++ b/app/Http/Controllers/V3/Dashboard/Harim/TechnicalDeputyController.php @@ -39,7 +39,7 @@ class TechnicalDeputyController extends Controller $action = HarimAction::CONFIRM->value; $harim->histories()->create([ - 'user_id' => auth()->user()->id, + 'expert_id' => auth()->user()->id, 'previous_state_id' => $harim->state_id, 'previous_state_name' => $harim->state_name, 'expert_description' => $request->expert_description, diff --git a/database/migrations/2025_07_30_153216_create_harim_histories_table.php b/database/migrations/2025_07_30_153216_create_harim_histories_table.php index 74b7a907..8ac45608 100644 --- a/database/migrations/2025_07_30_153216_create_harim_histories_table.php +++ b/database/migrations/2025_07_30_153216_create_harim_histories_table.php @@ -15,14 +15,12 @@ return new class extends Migration $table->id(); $table->foreignId('previous_state_id')->constrained('harim_states'); $table->string('previous_state_name'); - $table->foreignId('current_state_id')->constrained('harim_states'); - $table->string('current_state_name'); + $table->foreignId('harim_id')->constrained('harims'); $table->foreignId('action_id')->constrained('harim_actions'); $table->string('action_name'); $table->unsignedInteger('expert_id'); $table->foreign('expert_id')->references('id')->on('users'); $table->string('expert_description'); - $table->json('previous_data'); $table->timestamps(); }); }