mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
contract entity api
This commit is contained in:
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\User\Api;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Http\Modules\User\ContractEntityModule;
|
||||||
|
|
||||||
|
use App\Http\Controllers\User\BaseController;
|
||||||
|
|
||||||
|
class ContractEntityController extends BaseController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function list(Request $request)
|
||||||
|
{
|
||||||
|
$contract = ContractEntityModule::list($request);
|
||||||
|
return $contract;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show(Request $request, $hash_id)
|
||||||
|
{
|
||||||
|
$contract = ContractEntityModule::show($request, $hash_id);
|
||||||
|
return $contract;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$contract = ContractEntityModule::store($request);
|
||||||
|
return $contract;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request, $hash_id)
|
||||||
|
{
|
||||||
|
$contract = ContractEntityModule::update($request, $hash_id);
|
||||||
|
return $contract;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(Request $request, $hash_id)
|
||||||
|
{
|
||||||
|
$contract = ContractEntityModule::delete($request, $hash_id);
|
||||||
|
return $contract;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validCheck(Request $request, $hash_id = '')
|
||||||
|
{
|
||||||
|
$method = empty($hash_id) ? 'POST' :'PUT';
|
||||||
|
$valid = ContractEntityModule::validCheck($request, $hash_id, $method);
|
||||||
|
return $valid;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Modules\User;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
|
use App\Models\ContractEntity;
|
||||||
|
use App\Models\Contract;
|
||||||
|
use App\Models\Entity;
|
||||||
|
|
||||||
|
use App\Http\Modules\User\ContractModule;
|
||||||
|
|
||||||
|
use App\Http\Rules\User\UnderCheck;
|
||||||
|
use App\Http\Rules\User\ExistCheck;
|
||||||
|
|
||||||
|
use App\Http\Helpers\General;
|
||||||
|
use App\Http\Helpers\Hasher;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
use App\Http\Controllers\User\BaseController;
|
||||||
|
|
||||||
|
class ContractEntityModule extends BaseController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function list(Request $request)
|
||||||
|
{
|
||||||
|
General::storeCachePerviousQuery($request->query(), 'contract_entity_query');
|
||||||
|
|
||||||
|
$contract_hash_id = $contract_id = $request->get('contract_id', []);
|
||||||
|
|
||||||
|
$status = $request->get('status', []);
|
||||||
|
$page = $request->get('page', null);
|
||||||
|
$limit = $request->get('limit', 10);
|
||||||
|
|
||||||
|
$query = ContractEntity::query();
|
||||||
|
|
||||||
|
if (!empty($contract_id)) {
|
||||||
|
$contract_id = Hasher::decodeArray('contracts', $contract_id);
|
||||||
|
$query->whereIn('contract_id', $contract_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($status) > 0) {
|
||||||
|
$query->whereIn('status', $status);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query->where('user_id', Auth::guard('user-api')->user()->id);
|
||||||
|
|
||||||
|
$query->orderBy('id', 'desc');
|
||||||
|
|
||||||
|
$params = [
|
||||||
|
'contract_id' => $contract_hash_id,
|
||||||
|
'status' => $status,
|
||||||
|
'page' => $page
|
||||||
|
];
|
||||||
|
|
||||||
|
$contract_entity_list = $query->paginate($limit);
|
||||||
|
|
||||||
|
$extract = [];
|
||||||
|
foreach ($contract_entity_list as $key => $row) {
|
||||||
|
$extract[] = $row;
|
||||||
|
|
||||||
|
}
|
||||||
|
$pagination = General::paginationGenerator($contract_entity_list, $params, $extract);
|
||||||
|
|
||||||
|
return $pagination;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function show(Request $request, $hash_id)
|
||||||
|
{
|
||||||
|
$id = Hasher::decode('contract_entities', $hash_id);
|
||||||
|
$user_id = Auth::guard('user-api')->user()->id;
|
||||||
|
$contract = ContractEntity::
|
||||||
|
where('id', $id)
|
||||||
|
->where('user_id', $user_id)
|
||||||
|
->first();
|
||||||
|
if ($contract) {
|
||||||
|
$data = General::returnData($contract, '');
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
$data = General::returnNotFoundData();
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function store(Request $request)
|
||||||
|
{
|
||||||
|
$validation = ContractEntityModule::validation($request);
|
||||||
|
if (!$validation->status) {
|
||||||
|
return response()->json($validation, 422);
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
|
|
||||||
|
$contract_id = $request->input('contract_id');
|
||||||
|
$contract_id = Hasher::decode('contracts', $contract_id[0]);
|
||||||
|
$contarct = Contract::find($contract_id);
|
||||||
|
|
||||||
|
$entity_id = $request->input('entity_id');
|
||||||
|
$entity_id = Hasher::decode('entities', $entity_id[0]);
|
||||||
|
$entity = Entity::find($entity_id);
|
||||||
|
|
||||||
|
$contract_entity = new ContractEntity();
|
||||||
|
$contract_entity->user_id = Auth::guard('user-api')->user()->id;
|
||||||
|
$contract_entity->contract_id = $contarct->id;
|
||||||
|
$contract_entity->entity_id = $entity->id;
|
||||||
|
$contract_entity->entity_signature_id = $entity->entity_signature()->first()->id;
|
||||||
|
$contract_entity->status = config('constants.contact_entity.status.active');
|
||||||
|
$contract_entity->save();
|
||||||
|
|
||||||
|
// log
|
||||||
|
ContractModule::makeLog($contract_entity->contract_id, 'user (' . Auth::guard('user-api')->user()->id . ') contact entity created');
|
||||||
|
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
|
$query_string = General::getCachePerviousQuery('contract_entity_query');
|
||||||
|
$data = General::returnData($contract_entity, $query_string);
|
||||||
|
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function delete(Request $request, $hash_id)
|
||||||
|
{
|
||||||
|
$id = Hasher::decode('contract_entities', $hash_id);
|
||||||
|
$validation = ContractEntityModule::validation($request, $hash_id, 'DEL');
|
||||||
|
if (!$validation->status) {
|
||||||
|
return response()->json($validation, 422);
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
|
|
||||||
|
$contract_entity = ContractEntity::find($id);
|
||||||
|
$contract_entity->status = config('constants.contact_entity.status.delete');
|
||||||
|
$contract_entity->update();
|
||||||
|
|
||||||
|
// log
|
||||||
|
ContractModule::makeLog($contract_entity->contract_id, 'user (' . Auth::guard('user-api')->user()->id . ') contact entity deleted');
|
||||||
|
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
|
$query_string = General::getCachePerviousQuery('contract_entity_query');
|
||||||
|
$data = General::returnData($contract_entity, $query_string);
|
||||||
|
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function validCheck(Request $request, $hash_id = '', $method = 'POST')
|
||||||
|
{
|
||||||
|
$id = $hash_id ? Hasher::decode('contracts', $hash_id) : '';
|
||||||
|
$validation = ContractEntityModule::validation($request, $id, $method);
|
||||||
|
if (!$validation->status) {
|
||||||
|
return response()->json($validation, 422);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function validation(Request $request, $id = '', $method = 'POST')
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$rule= [];
|
||||||
|
|
||||||
|
if ($method == 'POST') {
|
||||||
|
$rule = [
|
||||||
|
'contract_id' => ['required', new UnderCheck('contract'), new ExistCheck('contract')],
|
||||||
|
'entity_id' => ['required', new UnderCheck('entity'), new ExistCheck('entity')]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($method == 'DEL') {
|
||||||
|
$data['id'] = $id;
|
||||||
|
$rule = [
|
||||||
|
'id' => [new UnderCheck('contract_entity'), new ExistCheck('contract_entity')],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$validator = Validator::make($data, $rule, config('error_code'));
|
||||||
|
|
||||||
|
$errors = $validator->errors();
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
$data = General::returnErrorData($errors);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (object)['status' => true];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -220,7 +220,7 @@ class ContractModule extends BaseController
|
|||||||
$contract->update();
|
$contract->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
ContractModule::makeLog($contract->id, 'user (' . Auth::guard('user-api')->user()->id . ') delete');
|
ContractModule::makeLog($contract->id, 'user (' . Auth::guard('user-api')->user()->id . ') deleted');
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ class ContractTemplateModule extends BaseController
|
|||||||
$contract_template->update();
|
$contract_template->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
ContractTemplateModule::makeLog($contract_template->id, 'user (' . Auth::guard('user-api')->user()->id . ') delete');
|
ContractTemplateModule::makeLog($contract_template->id, 'user (' . Auth::guard('user-api')->user()->id . ') deleted');
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@ class ContractTemplateObligationContractTemplateDependencyModule extends BaseCon
|
|||||||
$contract_template_obligation_contract_template_dependency->update();
|
$contract_template_obligation_contract_template_dependency->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
ContractTemplateObligationModule::makeLog($contract_template_obligation_contract_template_dependency->contract_template_obligation_id, 'user (' . Auth::guard('user-api')->user()->id . ') delete dependency');
|
ContractTemplateObligationModule::makeLog($contract_template_obligation_contract_template_dependency->contract_template_obligation_id, 'user (' . Auth::guard('user-api')->user()->id . ') dependency deleted');
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ class ContractTemplateObligationDependencyModule extends BaseController
|
|||||||
$contract_template_obligation_dependency->update();
|
$contract_template_obligation_dependency->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
ContractTemplateObligationModule::makeLog($contract_template_obligation_dependency->contract_template_obligation_id, 'user (' . Auth::guard('user-api')->user()->id . ') delete dependency');
|
ContractTemplateObligationModule::makeLog($contract_template_obligation_dependency->contract_template_obligation_id, 'user (' . Auth::guard('user-api')->user()->id . ') dependency deleted');
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class ContractTemplateObligationModule extends BaseController
|
|||||||
$contract_template_obligation->update();
|
$contract_template_obligation->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
ContractTemplateObligationModule::makeLog($contract_template_obligation->id, 'user (' . Auth::guard('user-api')->user()->id . ') delete');
|
ContractTemplateObligationModule::makeLog($contract_template_obligation->id, 'user (' . Auth::guard('user-api')->user()->id . ') deleted');
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ class EntityModule extends BaseController
|
|||||||
$entity->update();
|
$entity->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
EntityModule::makeLog($entity->id, 'user (' . Auth::guard('user-api')->user()->id . ') delete');
|
EntityModule::makeLog($entity->id, 'user (' . Auth::guard('user-api')->user()->id . ') deleted');
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ class EntitySignatureModule extends BaseController
|
|||||||
$entity_signature->update();
|
$entity_signature->update();
|
||||||
|
|
||||||
// log
|
// log
|
||||||
EntityModule::makeLog($entity_signature->entity_id, 'user (' . Auth::guard('user-api')->user()->id . ') sugnature delete');
|
EntityModule::makeLog($entity_signature->entity_id, 'user (' . Auth::guard('user-api')->user()->id . ') sugnature deleted);
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ namespace App\Http\Rules\User;
|
|||||||
use Auth;
|
use Auth;
|
||||||
use App\Models\ContractTemplate;
|
use App\Models\ContractTemplate;
|
||||||
use App\Models\ContractTemplateObligation;
|
use App\Models\ContractTemplateObligation;
|
||||||
|
use App\Models\Contract;
|
||||||
|
use App\Models\ContractEntity;
|
||||||
|
use App\Models\Entity;
|
||||||
|
|
||||||
use App\Http\Helpers\Hasher;
|
use App\Http\Helpers\Hasher;
|
||||||
|
|
||||||
@@ -65,6 +68,48 @@ class ExistCheck implements Rule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->type == 'contract') {
|
||||||
|
foreach ($value as $key => $row) {
|
||||||
|
if(!empty($row)) {
|
||||||
|
$id = Hasher::decode('contracts', $row);
|
||||||
|
$data = Contract::
|
||||||
|
where('id', $id)
|
||||||
|
->count();
|
||||||
|
if (!$data) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->type == 'contract_entity') {
|
||||||
|
foreach ($value as $key => $row) {
|
||||||
|
if(!empty($row)) {
|
||||||
|
$id = Hasher::decode('contract_entities', $row);
|
||||||
|
$data = ContractEntity::
|
||||||
|
where('id', $id)
|
||||||
|
->count();
|
||||||
|
if (!$data) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->type == 'entity') {
|
||||||
|
foreach ($value as $key => $row) {
|
||||||
|
if(!empty($row)) {
|
||||||
|
$id = Hasher::decode('entities', $row);
|
||||||
|
$data = Entity::
|
||||||
|
where('id', $id)
|
||||||
|
->count();
|
||||||
|
if (!$data) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Http\Rules\User;
|
namespace App\Http\Rules\User;
|
||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
|
use App\Models\Contract;
|
||||||
|
use App\Models\ContractEntity;
|
||||||
use App\Models\Entity;
|
use App\Models\Entity;
|
||||||
use App\Models\ContractTemplate;
|
use App\Models\ContractTemplate;
|
||||||
use App\Models\ContractTemplateObligation;
|
use App\Models\ContractTemplateObligation;
|
||||||
@@ -38,6 +40,36 @@ class UnderCheck implements Rule
|
|||||||
$this->attribute = $attribute;
|
$this->attribute = $attribute;
|
||||||
$value = is_array($value) ? $value : [$value];
|
$value = is_array($value) ? $value : [$value];
|
||||||
|
|
||||||
|
if ($this->type == 'contract') {
|
||||||
|
foreach ($value as $key => $row) {
|
||||||
|
if(!empty($row)) {
|
||||||
|
$id = Hasher::decode('contracts', $row);
|
||||||
|
$data = Contract::
|
||||||
|
where('id', $id)
|
||||||
|
->where('user_id', Auth::guard('user-api')->user()->id)
|
||||||
|
->count();
|
||||||
|
if (!$data) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->type == 'contract_entity') {
|
||||||
|
foreach ($value as $key => $row) {
|
||||||
|
if(!empty($row)) {
|
||||||
|
$id = Hasher::decode('contract_entities', $row);
|
||||||
|
$data = ContractEntity::
|
||||||
|
where('id', $id)
|
||||||
|
->where('user_id', Auth::guard('user-api')->user()->id)
|
||||||
|
->count();
|
||||||
|
if (!$data) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->type == 'entity') {
|
if ($this->type == 'entity') {
|
||||||
foreach ($value as $key => $row) {
|
foreach ($value as $key => $row) {
|
||||||
if(!empty($row)) {
|
if(!empty($row)) {
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
SendEmailVerificationNotification::class,
|
SendEmailVerificationNotification::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
AccessTokenCreated::class => [
|
// AccessTokenCreated::class => [
|
||||||
'App\Listeners\RevokeOldTokens',
|
// 'App\Listeners\RevokeOldTokens',
|
||||||
],
|
// ],
|
||||||
|
|
||||||
RefreshTokenCreated::class => [
|
// RefreshTokenCreated::class => [
|
||||||
'App\Listeners\PruneOldTokens',
|
// 'App\Listeners\PruneOldTokens',
|
||||||
],
|
// ],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,6 +53,13 @@
|
|||||||
'pending' => 9
|
'pending' => 9
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
'contact_entity' => [
|
||||||
|
'status' => [
|
||||||
|
'active' => 1,
|
||||||
|
'delete' => 2,
|
||||||
|
'pending' => 9
|
||||||
|
]
|
||||||
|
],
|
||||||
'contract_obligation' => [
|
'contract_obligation' => [
|
||||||
'complete_status' => [
|
'complete_status' => [
|
||||||
'pending' => 9,
|
'pending' => 9,
|
||||||
|
|||||||
@@ -36,8 +36,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th style="width: 25%">Details</th>
|
<th style="width: 25%">Details</th>
|
||||||
<th>Obligation Template</th>
|
<th>Obligation</th>
|
||||||
<th>Contract Entity</th>
|
<th>Contract Entity</th>
|
||||||
|
<th>Work Status</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Created</th>
|
<th>Created</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
<tr v-if="contract_list.data" v-for="(contract, $index) in contract_list.data" :key="$index">
|
<tr v-if="contract_list.data" v-for="(contract, $index) in contract_list.data" :key="$index">
|
||||||
<td>{{ $index + 1 }}</td>
|
<td>{{ $index + 1 }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
<div><b>Hash ID</b>: {{ contract.hash_id }}</div>
|
||||||
<div><b>Name</b>: {{ contract.name }}</div>
|
<div><b>Name</b>: {{ contract.name }}</div>
|
||||||
<div><b>Complete Day Range</b>: {{ contract.complete_day_range }}</div>
|
<div><b>Complete Day Range</b>: {{ contract.complete_day_range }}</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -71,7 +73,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span :class="'badge badge-' + contract.status[0].color">{{ contract.status[0].name }}</span>
|
<span class="'badge badge-warning'">Haven't Complete</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span :class="'badge badge-' + contract.status[0].color">{{ contract.status[0].name }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ contract.created_at }}
|
{{ contract.created_at }}
|
||||||
|
|||||||
+46
-1
@@ -278,7 +278,6 @@ Route::group(['namespace' => 'User', 'prefix' => 'user-backsys/api'], function (
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Contract
|
// Contract
|
||||||
Route::prefix('contract')->group(function () {
|
Route::prefix('contract')->group(function () {
|
||||||
Route::get('list',
|
Route::get('list',
|
||||||
@@ -302,6 +301,13 @@ Route::group(['namespace' => 'User', 'prefix' => 'user-backsys/api'], function (
|
|||||||
'middleware' => ['permission:add contract']
|
'middleware' => ['permission:add contract']
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
Route::put('assign-entity/{hash_id}',
|
||||||
|
[
|
||||||
|
'as' => 'api.contract.assign-entity',
|
||||||
|
'uses' => 'ContractController@assignEntity',
|
||||||
|
'middleware' => ['permission:edit contract']
|
||||||
|
]
|
||||||
|
);
|
||||||
Route::post('valid-check/{hash_id?}',
|
Route::post('valid-check/{hash_id?}',
|
||||||
[
|
[
|
||||||
'as' => 'api.contract.valid-check',
|
'as' => 'api.contract.valid-check',
|
||||||
@@ -311,6 +317,45 @@ Route::group(['namespace' => 'User', 'prefix' => 'user-backsys/api'], function (
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Contract Entit
|
||||||
|
Route::prefix('contract-entity')->group(function () {
|
||||||
|
Route::get('list',
|
||||||
|
[
|
||||||
|
'as' => 'api.contract-entity.list',
|
||||||
|
'uses' => 'ContractEntityController@list',
|
||||||
|
'middleware' => ['permission:view contract_entity']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
Route::get('show/{hash_id}',
|
||||||
|
[
|
||||||
|
'as' => 'api.contract-entity.show',
|
||||||
|
'uses' => 'ContractEntityController@show',
|
||||||
|
'middleware' => ['permission:view contract_entity']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
Route::post('store',
|
||||||
|
[
|
||||||
|
'as' => 'api.contract-entity.store',
|
||||||
|
'uses' => 'ContractEntityController@store',
|
||||||
|
'middleware' => ['permission:add contract_entity']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
Route::put('update/{hash_id}',
|
||||||
|
[
|
||||||
|
'as' => 'api.contract-entity.update',
|
||||||
|
'uses' => 'ContractEntityController@update',
|
||||||
|
'middleware' => ['permission:edit contract_entity']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
Route::delete('delete/{hash_id}',
|
||||||
|
[
|
||||||
|
'as' => 'api.contract-entity.delete',
|
||||||
|
'uses' => 'ContractEntityController@delete',
|
||||||
|
'middleware' => ['permission:delete contract_entity']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
// contract generate
|
// contract generate
|
||||||
// contract assign entity
|
// contract assign entity
|
||||||
// contract active
|
// contract active
|
||||||
|
|||||||
Reference in New Issue
Block a user