Merge pull request #19 from witelgroup/feature/LangugeForm
change and fix code
This commit is contained in:
@@ -39,7 +39,7 @@ enum HarimStates: int
|
||||
13 => "تائید عرصه و اعیان ارسال شده توسط اداره حریم",
|
||||
14 => "تائید عرصه و اعیان ارسال شده توسط معاون",
|
||||
15 => "تائید عرصه و اعیان ارسال شده توسط مدیر",
|
||||
16 => " مخالفت با درخواست"
|
||||
16 => "مخالفت با درخواست"
|
||||
];
|
||||
|
||||
return $mapArray[$state];
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\V3\Dashboard\Harim;
|
||||
use App\Enums\HarimStates;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\PanjareVahed\GetAccessRoadRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\PanjareVahed\GetFinalPolygonsRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\PanjareVahed\GetRejectRequest;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\PanjareVahed\ReceiveNewRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
@@ -41,22 +42,24 @@ class PanjareVahedController extends Controller
|
||||
Harim::query()->create([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
'panjare_vahed_id' => $request->id,
|
||||
'panjare_vahed_id' => $request->panjare_vahed_id,
|
||||
'national_id' => $request->national_id,
|
||||
'phone_number' => $request->phone_number,
|
||||
'request_date' => $request->request_date,
|
||||
'province_id' => $city->province_id,
|
||||
'province_name' => $city->province()->first()->name_fa,
|
||||
'city_id' => $city->id,
|
||||
'city_name' => $city->name,
|
||||
'city_name' => $city->name_fa,
|
||||
'edareh_shahri_id' => $city->edarateShahri()->first()->id,
|
||||
'requested_organization' => $request->organization,
|
||||
'requested_organization' => $request->requested_organization,
|
||||
'plan_group' => $request->plan_group,
|
||||
'plan_title' => $request->plan_title,
|
||||
'worksheet_id' => $request->worksheet_id,
|
||||
'response_options' => json_encode($request->response_options),
|
||||
'isic' => $request->isic,
|
||||
'primary_area' => $request->primary_area,
|
||||
'primary_area' => json_encode($request->primary_area),
|
||||
'lat' => $request->lat,
|
||||
'lng' => $request->lng,
|
||||
]);
|
||||
|
||||
return $this->successResponse([
|
||||
@@ -80,6 +83,7 @@ class PanjareVahedController extends Controller
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
|
||||
public function getRejectRequest(GetRejectRequest $request)
|
||||
{
|
||||
$state = HarimStates::MOKHALEFAT_BA_DASTGAH->value;
|
||||
@@ -93,7 +97,9 @@ class PanjareVahedController extends Controller
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
public function getFinalPolygons(GetAccessRoadRequest $request)
|
||||
|
||||
|
||||
public function getFinalPolygons(GetFinalPolygonsRequest $request)
|
||||
{
|
||||
$state = HarimStates::TAEDE_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_DAFTAR_HARIM->value;
|
||||
|
||||
|
||||
@@ -12,18 +12,18 @@ class GetAccessRoadRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
* @return array<string, ValidationRule|array>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'panjare_vahed_id' => 'required|string',
|
||||
'panjare_vahed_id' => 'required',
|
||||
'access_road' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\PanjareVahed;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GetFinalPolygonsRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'panjare_vahed_id' => 'required',
|
||||
'final_area' => 'required',
|
||||
'final_plan' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -12,18 +12,18 @@ class GetRejectRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
* @return array<string, ValidationRule|array>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'panjare_vahed_id' => 'required|string',
|
||||
'panjare_vahed_id' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class ReceiveNewRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'panjare_vahed_id' => 'required|integer',
|
||||
'panjare_vahed_id' => 'required|integer|unique:harims,panjare_vahed_id',
|
||||
'national_id' => 'required',
|
||||
'phone_number' => 'required',
|
||||
'request_date' => 'required',
|
||||
@@ -34,6 +34,8 @@ class ReceiveNewRequest extends FormRequest
|
||||
'response_options' => 'required',
|
||||
'isic' => 'required',
|
||||
'primary_area' => 'required',
|
||||
'lat' => 'required',
|
||||
'lng' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ class HarimStateSeeder extends Seeder
|
||||
['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(),],
|
||||
['id' => 16, 'name' => 'مخالفت با درخواست', 'created_at' => now(), 'updated_at' => now(),],
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,6 +567,8 @@ Route::prefix('harim')
|
||||
->group(function () {
|
||||
Route::post('/receive_new_request', 'receiveNewRequest')->name('receiveNewRequest');
|
||||
Route::post('/receive_access_road','getAccessRoad')->name('getAccessRoad');
|
||||
Route::post('/get_reject_request','getRejectRequest')->name('getRejectRequest');
|
||||
Route::post('/get_final_polygons','getFinalPolygons')->name('getFinalPolygons');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user