change code in migration and listener

This commit is contained in:
2025-09-24 14:55:29 +03:30
parent ff616914ac
commit f318b01fdb
2 changed files with 12 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Listeners\V3\Dashboard\Mission;
use App\Enums\FMSResultCode;
use App\Events\V3\Dashboard\Mission\SendDataToFMSEvent;
use App\Services\FMS\GetErrorRateService;
use Exception;
@@ -44,6 +45,8 @@ class SendDataToFMSListener implements ShouldQueue
'first_enter' => $responseData['firstEnter'],
'last_exit' => $responseData['lastExit'],
'point_number_sent' => $responseData['noOfPointsInMission'],
'fms_result_code' => $responseData['resultCode'],
'fms_result_message' => FMSResultCode::name($responseData['resultCode']),
]);
}
}

View File

@@ -14,9 +14,11 @@ return new class extends Migration
Schema::table('missions', function (Blueprint $table) {
$table->bigInteger('mission_duration')->nullable();
$table->bigInteger('in_area_duration')->nullable();
$table->timestamps('first_enter')->nullable();
$table->timestamps('last_exit')->nullable();
$table->timestamp('first_enter')->nullable();
$table->timestamp('last_exit')->nullable();
$table->integer('point_number_sent')->nullable();
$table->smallInteger('fms_result_code')->nullable();
$table->string('fms_result_message')->nullable();
});
}
@@ -26,7 +28,11 @@ return new class extends Migration
public function down(): void
{
Schema::table('missions', function (Blueprint $table) {
$table->dropColumn(['mission_duration', 'in_area_duration', 'first_enter', 'last_exit', 'point_number_sent']);
$table->dropColumn([
'mission_duration', 'in_area_duration',
'first_enter', 'last_exit', 'point_number_sent',
'fms_result_code', 'fms_result_message',
]);
});
}
};