Merge branch 'feature/AddItemMission' into 'develop'
Feature/add item mission See merge request witelgroup/rms_v2!132
This commit is contained in:
@@ -27,7 +27,8 @@ class ControlUnitController extends Controller
|
||||
$mission->histories()->create([
|
||||
'user_id' => auth()->user()->id,
|
||||
'previous_state_id' => $mission->state_id,
|
||||
'previous_state_name' => $mission->state_name
|
||||
'previous_state_name' => $mission->state_name,
|
||||
'start_time' => now()
|
||||
]);
|
||||
|
||||
$state = MissionStates::START_MISSION->value;
|
||||
@@ -46,7 +47,8 @@ class ControlUnitController extends Controller
|
||||
$mission->histories()->create([
|
||||
'user_id' => auth()->user()->id,
|
||||
'previous_state_id' => $mission->state_id,
|
||||
'previous_state_name' => $mission->state_name
|
||||
'previous_state_name' => $mission->state_name,
|
||||
'finish_time' => now()
|
||||
]);
|
||||
|
||||
$state = MissionStates::END_MISSION->value;
|
||||
|
||||
@@ -30,7 +30,7 @@ class ControlUnitService
|
||||
allowedSelects: [
|
||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa'
|
||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class RequestPortalService
|
||||
allowedSelects: [
|
||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa'
|
||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class TransportationUnitService
|
||||
allowedSelects: [
|
||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa'
|
||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,19 +6,17 @@ use App\Exceptions\ProhibitedAction;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Models\SafetyAndPrivacy;
|
||||
use Illuminate\Http\Request;
|
||||
use Throwable;
|
||||
|
||||
class SupervisorService
|
||||
{
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function dataTable(Request $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
$fields = [
|
||||
'id','lat','lon', 'recognize_picture','action_picture','created_at','status', 'final_description', 'province_fa',
|
||||
'info_fa', 'activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date', 'edare_shahri_name',
|
||||
'step_fa', 'axis_type_id', 'axis_type_name', 'action_date', 'is_finished', 'status_fa', 'supervisor_description', 'operator_description'
|
||||
];
|
||||
|
||||
$query = SafetyAndPrivacy::query();
|
||||
|
||||
if ($user->hasPermissionTo('show-safety-and-privacy-operator-cartable-province'))
|
||||
@@ -33,7 +31,12 @@ class SupervisorService
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: $fields
|
||||
allowedSelects: [
|
||||
'id','lat','lon', 'recognize_picture','action_picture','created_at','status', 'final_description', 'province_fa',
|
||||
'info_fa', 'activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date',
|
||||
'edare_shahri_name', 'step_fa', 'axis_type_id', 'axis_type_name', 'action_date', 'is_finished', 'status_fa',
|
||||
'supervisor_description', 'operator_description'
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('missions', function (Blueprint $table) {
|
||||
$table->dateTime('start_time')->nullable();
|
||||
$table->dateTime('finish_time')->nullable();;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('missions', function (Blueprint $table) {
|
||||
$table->dropColumn(['start_time', 'finish_time']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user