Merge branch 'feature/DeputyManagement' into 'develop'
create controller and these dependensy See merge request witelgroup/rms_v2!148
This commit is contained in:
@@ -4,20 +4,41 @@ namespace App\Enums;
|
||||
|
||||
enum HarimStates: int
|
||||
{
|
||||
case Baresi_Edare_Shahrestan = 1;
|
||||
case Baresi_Imeni_Rah_Tavasot_Daftar_Harim = 2;
|
||||
case Baresi_Imeni_Rah_Tavasot_Moaven = 3;
|
||||
case Baresi_Imeni_Rah_Tavasot_Modir_Kol = 4;
|
||||
case Rad_Be_Dalil_Imeni_Rah = 5;
|
||||
case BARESI_EDARE_SHAHRESTAN = 1;
|
||||
case BARESI_TAVASOT_DAFTAR_HARIM = 2;
|
||||
case BARESI_TAVASOT_MOAVEN = 3;
|
||||
case BARESI_TAVASOT_MODIR_KOL = 4;
|
||||
case BARESI_FILE_APLODE_SHODE_TAVASOTE_DAFTAR_HARIM = 5;
|
||||
case BARESI_FILE_APLODE_SHODE_TAVASOTE_MOAVEN = 6;
|
||||
case BARESI_FILE_APLODE_SHODE_TAVASOTE_MODIR_KOL = 7;
|
||||
case ERSAL_ZEMANAT_NAME_TAVASOTE_KARBAR =8;
|
||||
case ERSAL_BE_PANJAREH_VAHED_NIAZ_BE_RAH_DASTRASI = 9;
|
||||
case EMKAN_PAZIR_NEMEBASHAD = 10;
|
||||
case ERSAL_BE_PANJAREH_VAHED_BEDONEH_NIAZ_BE_RAH_DASTRASI = 11;
|
||||
case UPDATE_FILE_BARGOZARE_SHODE = 12;
|
||||
case TAEDE_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_DAFTAR_KARBAR = 13;
|
||||
case TAEDE_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_TAVASOTE_MOAVEN = 14;
|
||||
case TAEDE_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_MODIR_KOL = 15;
|
||||
|
||||
public static function name(int $state): string
|
||||
{
|
||||
$mapArray = [
|
||||
1 => "بررسی ادارات شهرستان",
|
||||
2 => "بررسی ایمنی راه توسط ادارات حریم",
|
||||
3 => "بررسی ایمنی راه توسط معاون ",
|
||||
4 => "بررسی ایمنی راه توسط مدیر کل",
|
||||
5 => "رد درخواست به دلیل ایمنی راه",
|
||||
2 => "بررسی راه توسط ادارات حریم",
|
||||
3 => "بررسی راه توسط معاون ",
|
||||
4 => "بررسی راه توسط مدیر کل",
|
||||
5 => "بررسی فایل آپلود شده توسط اداره حریم",
|
||||
6 => "بررسی فایل آپلود شده توسط معاون",
|
||||
7 => "بررسی فایل آپلود شده توسط مدیر",
|
||||
8 => "ارسال ضمانت نامه توسط کاربر",
|
||||
9 => "ارسال به پنجره واحد ( نیاز به راه دسترسی)",
|
||||
10 => "امکان پذیر نمی باشد",
|
||||
11 => "ارسال به پنجره واحد (بدون نیاز به راه دسترسی)",
|
||||
12 => "بازبینی فایل بارگذاری شده",
|
||||
13 => "تائید عرصه و اعیان ارسال شده توسط اداره حریم",
|
||||
14 => "تائید عرصه و اعیان ارسال شده توسط معاون",
|
||||
15 => "تائید عرصه و اعیان ارسال شده توسط مدیر",
|
||||
|
||||
];
|
||||
|
||||
return $mapArray[$state];
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Harim;
|
||||
|
||||
use App\Enums\HarimAction;
|
||||
use App\Enums\HarimStates;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\GeneralManager\ConfirmRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\GeneralManager\RejectRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\GeneralManager\ShowRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\Harim;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class GeneralManagerController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$user = auth()->user();
|
||||
$query = Harim::query()
|
||||
->where('state_id','=',HarimStates::Baresi_Imeni_Rah_Tavasot_Modir_Kol->value)
|
||||
->where('edareh_shahri_id', '=', $user->edarate_shahri_id);
|
||||
|
||||
$data = DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*']
|
||||
);
|
||||
return response()->json($data);
|
||||
}
|
||||
public function conform(ConfirmRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request, $harim) {
|
||||
$action = HarimAction::CONFIRM->value;
|
||||
$harim->histories()->create([
|
||||
'expert_id' => auth()->user()->id,
|
||||
'previous_state_id' => $harim->state_id,
|
||||
'previous_state_name' => $harim->state_name,
|
||||
'expert_description' => $request->expert_description,
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
]);
|
||||
|
||||
$state = HarimStates::ERSAL_BE_PANJAREVAHED->value;
|
||||
$harim->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
]);
|
||||
});
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function reject(RejectRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request, $harim) {
|
||||
$action = HarimAction::REJECT->value;
|
||||
$harim->histories()->create([
|
||||
'expert_id'=> auth()->user()->id,
|
||||
'previous-state_id' => $harim->state_id,
|
||||
'previous_state_name' => $harim->state_name,
|
||||
'export_description' => $request->export_description,
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
]);
|
||||
$state = HarimStates::Baresi_Imeni_Rah_Tavasot_Moaven->value;
|
||||
$harim->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
]);
|
||||
});
|
||||
return $this->successResponse();
|
||||
}
|
||||
public function show(ShowRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
return $this->successResponse($harim->load('histories'));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ use App\Enums\HarimAction;
|
||||
use App\Enums\HarimStates;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\HarimOffice\ShowRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\HarimOffice\YesRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\HarimOffice\NoRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
@@ -20,7 +21,10 @@ class HarimOfficeController extends Controller
|
||||
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$query = Harim::query()->where('edareh_shahri_id', '=', auth()->user()->edarate_shahri_id);
|
||||
$user = auth()->user();
|
||||
$query = Harim::query()
|
||||
->where('state_id','=',HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value)
|
||||
->where('edareh_shahri_id', '=', $user->edarate_shahri_id);
|
||||
$data = DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
@@ -34,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,
|
||||
@@ -47,6 +51,7 @@ class HarimOfficeController extends Controller
|
||||
$harim ->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
'final_description' => 'yes'
|
||||
]);
|
||||
});
|
||||
return $this->successResponse();
|
||||
@@ -56,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,
|
||||
@@ -69,12 +74,14 @@ class HarimOfficeController extends Controller
|
||||
$harim ->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
'final_description' => 'no'
|
||||
]);
|
||||
});
|
||||
return $this->successResponse();
|
||||
}
|
||||
public function show(Harim $harim): JsonResponse
|
||||
public function show(ShowRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
return $this->successResponse($harim);
|
||||
return $this->successResponse($harim->load('histories'));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ class ProvinceOfficeController extends Controller
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$user = auth()->user();
|
||||
$query = Harim::query()->where('edareh_shahri_id', '=', $user->edarate_shahri_id);
|
||||
$query = Harim::query()
|
||||
->where('state_id','=',HarimStates::Baresi_Edare_Shahrestan->value)
|
||||
->where('edareh_shahri_id', '=', $user->edarate_shahri_id);
|
||||
|
||||
$data = DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
@@ -33,13 +36,15 @@ class ProvinceOfficeController extends Controller
|
||||
public function feedback(FeedBackRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request,$harim) {
|
||||
$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,
|
||||
'action_id' => HarimAction::FEEDBACK->value,
|
||||
'action_name' => HarimAction::FEEDBACK->name,
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
]);
|
||||
|
||||
$state = HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value;
|
||||
@@ -51,10 +56,4 @@ class ProvinceOfficeController extends Controller
|
||||
});
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function show(Harim $harim): JsonResponse
|
||||
{
|
||||
return $this->successResponse($harim);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Harim;
|
||||
|
||||
use App\Enums\HarimAction;
|
||||
use App\Enums\HarimStates;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\Deputy\ConfirmRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\Deputy\ShowRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\Harim;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class TechnicalDeputyController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$user = auth()->user();
|
||||
$query = Harim::query()
|
||||
->where('state_id', '=', HarimStates::Baresi_Imeni_Rah_Tavasot_Moaven->value)
|
||||
->where('edare_shahri_id', '=', $user->edarate_shahri_id)
|
||||
->with('histories:expert_description');
|
||||
|
||||
$data = DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
);
|
||||
return response()->json($data);
|
||||
}
|
||||
public function conform(ConfirmRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request,$harim) {
|
||||
$action = HarimAction::CONFIRM->value;
|
||||
|
||||
$harim->histories()->create([
|
||||
'expert_id' => auth()->user()->id,
|
||||
'previous_state_id' => $harim->state_id,
|
||||
'previous_state_name' => $harim->state_name,
|
||||
'expert_description' => $request->expert_description,
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
]);
|
||||
$state = HarimStates::Baresi_Imeni_Rah_Tavasot_Modir_Kol->value;
|
||||
|
||||
$harim ->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
]);
|
||||
});
|
||||
return $this->successResponse();
|
||||
|
||||
}
|
||||
public function reject(ConfirmRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request,$harim) {
|
||||
$action = HarimAction::REJECT->value;
|
||||
|
||||
$harim->histories()->create([
|
||||
'expert_id' => auth()->user()->id,
|
||||
'previous_state_id' => $harim->state_id,
|
||||
'previous_state_name' => $harim->state_name,
|
||||
'expert_description' => $request->expert_description,
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
]);
|
||||
$state = HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value;
|
||||
$harim->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
]);
|
||||
});
|
||||
return $this->successResponse();
|
||||
}
|
||||
public function show(ShowRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
return $this->successResponse($harim->load('histories'));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\Deputy;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ConfirmRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Moaven->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\Deputy;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RejectRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Moaven->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/V3/Dashboard/Harim/Deputy/ShowRequest.php
Normal file
30
app/Http/Requests/V3/Dashboard/Harim/Deputy/ShowRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\Deputy;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ShowRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Moaven->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\GeneralManager;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ConfirmRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Modir_Kol->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\GeneralManager;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RejectRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Modir_Kol->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'expert_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\GeneralManager;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ShowRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Modir_Kol->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,9 @@ class NoRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edare_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value; }
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\HarimOffice;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ShowRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class YesRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edare_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class FeedBackRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->edare_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
$this->harim->state_id == HarimStates::Baresi_Edare_Shahrestan->value;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ class Harim extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $guarded = [];
|
||||
protected $table = 'harim';
|
||||
|
||||
public function histories(): HasMany
|
||||
{
|
||||
|
||||
@@ -48,8 +48,8 @@ class HarimFactory extends Factory
|
||||
'plan_group' => $this->faker->name,
|
||||
'plan_title' => $this->faker->title,
|
||||
'address' => $this->faker->address,
|
||||
'file' => $this->faker->file,
|
||||
'polygon' => $this->faker->numerify(),
|
||||
'file' => $this->faker->name,
|
||||
'polygon' => json_encode($this->faker->numerify()),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,11 @@ return new class extends Migration
|
||||
$table->string('plan_title');
|
||||
$table->string('address');
|
||||
$table->string('file');
|
||||
$table->polygon('polygon');
|
||||
$table->json('polygon');
|
||||
$table->boolean('need_road_access')->nullable();
|
||||
$table->boolean('is_file_good')->nullable();
|
||||
$table->boolean('is_possible')->nullable();
|
||||
$table->string('final_description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,11 +14,21 @@ class HarimStateSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('harim_states')->insert([
|
||||
['id' => 1, 'name' => 'در انتظار بررسی اداره شهرستان', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 2, 'name' => 'در انتظار بررسی ایمنی راه توسط دفتر حریم', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 3, 'name' => 'در انتظار بررسی ایمنی راه توسط معاون', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 4, 'name' => 'در انتظار بررسی ایمنی راه توسط مدیر کل', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 5, 'name' => 'رد به دلیل ایمنی راه', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 1, 'name' => 'بررسی ادارات شهرستان', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 2, 'name' => 'بررسی توسط ادارات حریم', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 3, 'name' => 'بررسی توسط معاون', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 4, 'name' => 'بررسی توسط مدیر کل', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 5, 'name' => 'بررسی فایل آپلود شده توسط اداره حریم', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 6, 'name' => 'بررسی فایل آپلود شده توسط معاون', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 7, 'name' => 'بررسی فایل آپلود شده توسط مدیر', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 8, 'name' => 'ارسال ضمانت نامه توسط کاربر', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 9, 'name' => 'ارسال به پنجره واحد ( نیاز به راه دسترسی)', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 10, 'name' => 'امکان پذیر نمی باشد', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 11, 'name' => 'ارسال به پنجره واحد (بدون نیاز به راه دسترسی)', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 12, 'name' => 'بازبینی فایل بارگذاری شده', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 13, 'name' => 'تائید عرصه و اعیان ارسال شده توسط اداره حریم', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 14, 'name' => 'تائید عرصه و اعیان ارسال شده توسط معاون', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 15, 'name' => 'تائید عرصه و اعیان ارسال شده توسط مدیر', 'created_at' => now(), 'updated_at' => now(),],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,10 @@ use App\Http\Controllers\V3\Dashboard\Accident\AccidentReceiptReportController;
|
||||
use App\Http\Controllers\V3\Dashboard\Azmayesh\AzmayeshController;
|
||||
use App\Http\Controllers\V3\Dashboard\Azmayesh\AzmayeshSampleController;
|
||||
use App\Http\Controllers\V3\Dashboard\Azmayesh\AzmayeshTypeController;
|
||||
use App\Http\Controllers\V3\Dashboard\Harim\GeneralManagerController;
|
||||
use App\Http\Controllers\V3\Dashboard\Harim\HarimOfficeController;
|
||||
use App\Http\Controllers\V3\Dashboard\Harim\ProvinceOfficeController;
|
||||
use App\Http\Controllers\V3\Dashboard\Harim\TechnicalDeputyController;
|
||||
use App\Http\Controllers\V3\Dashboard\ItemsManagementController;
|
||||
use App\Http\Controllers\V3\Dashboard\Mission\ControlUnitController;
|
||||
use App\Http\Controllers\V3\Dashboard\Mission\DetailController;
|
||||
@@ -517,7 +519,6 @@ Route::prefix('harim')
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::post('/feedback/{harim}', 'feedback')->name('feedback');
|
||||
Route::get('/{harim}', 'show')->name('show');
|
||||
});
|
||||
Route::prefix('harim_office')
|
||||
->name('harim_office.')
|
||||
@@ -528,5 +529,23 @@ Route::prefix('harim')
|
||||
Route::post('/no/{harim}', 'no')->name('no');
|
||||
Route::get('/{harim}', 'show')->name('show');
|
||||
});
|
||||
Route::prefix('technical_deputy')
|
||||
->name('technical_deputy.')
|
||||
->controller(TechnicalDeputyController::class)
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::post('/conform/{harim}', 'conform')->name('conform');
|
||||
Route::post('/reject/{harim}', 'reject')->name('reject');
|
||||
Route::get('/{harim}', 'show')->name('show');
|
||||
});
|
||||
Route::prefix('general_manager')
|
||||
->name('general_manager.')
|
||||
->controller(GeneralManagerController::class)
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::post('/conform/{harim}', 'conform')->name('conform');
|
||||
Route::post('/reject/{harim}', 'reject')->name('reject');
|
||||
Route::get('/{harim}', 'show')->name('show');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user