contract obligation complete and accept api

This commit is contained in:
glovetleong
2021-07-27 13:36:51 +08:00
parent 7f209db917
commit 93b13a8f46
17 changed files with 550 additions and 20 deletions
@@ -40,6 +40,12 @@ class ContractObligationController extends BaseController
return $contract; return $contract;
} }
public function updateComplete(Request $request, $hash_id)
{
$contract = ContractObligationModule::updateComplete($request, $hash_id);
return $contract;
}
public function delete(Request $request, $hash_id) public function delete(Request $request, $hash_id)
{ {
$contract = ContractObligationModule::delete($request, $hash_id); $contract = ContractObligationModule::delete($request, $hash_id);
+40 -2
View File
@@ -14,6 +14,7 @@ use App\Http\Modules\User\ContractObligationDependencyModule;
use App\Http\Rules\User\UnderCheck; use App\Http\Rules\User\UnderCheck;
use App\Http\Rules\User\ExistCheck; use App\Http\Rules\User\ExistCheck;
use App\Http\Rules\User\StatusCheck; use App\Http\Rules\User\StatusCheck;
use App\Http\Rules\User\ContractDoneCheck;
use App\Http\Helpers\General; use App\Http\Helpers\General;
use App\Http\Helpers\Hasher; use App\Http\Helpers\Hasher;
@@ -107,7 +108,7 @@ class ContractModule extends BaseController
$contract->contract_template_id = $contarct_template->id; $contract->contract_template_id = $contarct_template->id;
$contract->name = $contarct_template->name; $contract->name = $contarct_template->name;
$contract->in_time_contract_template = json_encode($contarct_template); $contract->in_time_contract_template = json_encode($contarct_template);
$contract->status = config('constants.contact.status.pending'); $contract->status = config('constants.contract.status.pending');
$contract->save(); $contract->save();
// generate contract obligation // generate contract obligation
@@ -125,7 +126,6 @@ class ContractModule extends BaseController
$contract_obligation = ContractObligationModule::generate($request); $contract_obligation = ContractObligationModule::generate($request);
} }
// generate contract obligation dependency // generate contract obligation dependency
foreach ($contract_template_obligation_list as $key => $row) { foreach ($contract_template_obligation_list as $key => $row) {
$contract_template_obligation_dependency = $row->contract_template_obligation_dependency() $contract_template_obligation_dependency = $row->contract_template_obligation_dependency()
@@ -235,6 +235,33 @@ class ContractModule extends BaseController
return response()->json($data); return response()->json($data);
} }
public static function updateDone(Request $request, $hash_id)
{
$id = Hasher::decode('contracts', $hash_id);
$validation = ContractModule::validation($request, $hash_id, 'DONE');
if (!$validation->status) {
return response()->json($validation, 422);
}
DB::beginTransaction();
$contract = Contract::find($id);
$contract->status = config('constants.contract.status.done');
$contract->update();
dd($contract);
// log
ContractModule::makeLog($contract->id, 'user (' . Auth::guard('user-api')->user()->id . ') status done updated');
DB::commit();
$query_string = General::getCachePerviousQuery('contract_query');
$data = General::returnData($contract, $query_string);
return response()->json($data);
}
public static function delete(Request $request, $hash_id) public static function delete(Request $request, $hash_id)
{ {
$id = Hasher::decode('contracts', $hash_id); $id = Hasher::decode('contracts', $hash_id);
@@ -318,6 +345,17 @@ class ContractModule extends BaseController
} }
} }
if ($method == 'DONE') {
$data['id'] = $id;
$rule = [
'id' => [
new UnderCheck('contract'),
new ExistCheck('contract'),
new ContractDoneCheck()
],
];
}
if ($method == 'DEL') { if ($method == 'DEL') {
$data['id'] = $id; $data['id'] = $id;
$rule = [ $rule = [
@@ -9,8 +9,14 @@ use App\Models\Contract;
use App\Models\ContractTemplateObligation; use App\Models\ContractTemplateObligation;
use App\Models\ContractEntity; use App\Models\ContractEntity;
use App\Http\Modules\User\ContractModule;
use App\Http\Rules\User\UnderCheck; use App\Http\Rules\User\UnderCheck;
use App\Http\Rules\User\ExistCheck; use App\Http\Rules\User\ExistCheck;
use App\Http\Rules\User\ContractObligationCompleteOrAcceptCheck;
use App\Http\Rules\User\ContractObligationEntitySignatureCheck;
use App\Http\Rules\User\ContractObligationDoneCheck;
use App\Http\Rules\User\StatusCheck;
use App\Http\Helpers\General; use App\Http\Helpers\General;
use App\Http\Helpers\Hasher; use App\Http\Helpers\Hasher;
@@ -114,7 +120,7 @@ class ContractObligationModule extends BaseController
$contract_obligation->must_accept = $contract_template_obligation->must_accept; $contract_obligation->must_accept = $contract_template_obligation->must_accept;
$contract_obligation->in_time_contract_obligation_template = json_encode($contract_template_obligation); $contract_obligation->in_time_contract_obligation_template = json_encode($contract_template_obligation);
$contract_obligation->type = $contract_template_obligation->type; $contract_obligation->type = $contract_template_obligation->type;
$contract_obligation->status = config('constants.contact.status.pending'); $contract_obligation->status = config('constants.contarct.status.active');
$contract_obligation->save(); $contract_obligation->save();
// log // log
@@ -157,6 +163,87 @@ class ContractObligationModule extends BaseController
return response()->json($data); return response()->json($data);
} }
public static function updateComplete(Request $request, $hash_id)
{
$id = Hasher::decode('contract_obligations', $hash_id);
$validation = ContractObligationModule::validation($request, $hash_id, 'COMPLETE');
if (!$validation->status) {
return response()->json($validation, 422);
}
DB::beginTransaction();
$contract_obligation = ContractObligation::find($id);
$contract_obligation->complete_status = config('constants.contract_obligation.complete_status.completed');
$contract_obligation->update();
// log
ContractObligationModule::makeLog($contract_obligation->id, 'user (' . Auth::guard('user-api')->user()->id . ') complete status updated');
ContractObligationModule::updateDone($request, $hash_id);
DB::commit();
$query_string = General::getCachePerviousQuery('contract_obligation_query');
$data = General::returnData($contract_obligation, $query_string);
return response()->json($data);
}
public static function updateAccept(Request $request, $hash_id)
{
$id = Hasher::decode('contract_obligations', $hash_id);
$validation = ContractObligationModule::validation($request, $hash_id, 'ACCEPT');
if (!$validation->status) {
return response()->json($validation, 422);
}
DB::beginTransaction();
$contract_obligation = ContractObligation::find($id);
$contract_obligation->accept_status = config('constants.contract_obligation.accept_status.accepted');
$contract_obligation->update();
// log
ContractObligationModule::makeLog($contract_obligation->id, 'user (' . Auth::guard('user-api')->user()->id . ') accept status updated');
ContractObligationModule::updateDone($request, $hash_id);
DB::commit();
$query_string = General::getCachePerviousQuery('contract_obligation_query');
$data = General::returnData($contract_obligation, $query_string);
return response()->json($data);
}
public static function updateDone(Request $request, $hash_id)
{
$id = Hasher::decode('contract_obligations', $hash_id);
$validation = ContractObligationModule::validation($request, $hash_id, 'DONE');
if (!$validation->status) {
return response()->json($validation, 422);
}
DB::beginTransaction();
$contract_obligation = ContractObligation::find($id);
$contract_obligation->status = config('constants.contract_obligation.status.done');
$contract_obligation->update();
// log
ContractObligationModule::makeLog($contract_obligation->id, 'user (' . Auth::guard('user-api')->user()->id . ') done status updated');
ContractModule::updateDone($request, $contract_obligation->contract_hash_id);
DB::commit();
$query_string = General::getCachePerviousQuery('contract_obligation_query');
$data = General::returnData($contract_obligation, $query_string);
return response()->json($data);
}
private static function validation(Request $request, $id = '', $method = 'POST') private static function validation(Request $request, $id = '', $method = 'POST')
{ {
$data = $request->all(); $data = $request->all();
@@ -174,6 +261,45 @@ class ContractObligationModule extends BaseController
]; ];
} }
if ($method == 'COMPLETE') {
$data['id'] = $id;
$rule = [
'id' => [
new UnderCheck('contract_obligation'),
new ExistCheck('contract_obligation'),
new ContractObligationCompleteOrAcceptCheck('complete'),
new StatusCheck('contract_obligation', [config('constants.contract_obligation.status.active')])
],
'entity_signature_id' => ['required', new ContractObligationEntitySignatureCheck($data['id'] ?? '')]
];
}
if ($method == 'ACCEPT') {
$data['id'] = $id;
$rule = [
'id' => [
new UnderCheck('contract_obligation'),
new ExistCheck('contract_obligation'),
new ContractObligationCompleteOrAcceptCheck('accept'),
new StatusCheck('contract_obligation', [config('constants.contract_obligation.status.active')])
],
'entity_signature_id' => ['required', new ContractObligationEntitySignatureCheck($data['id'] ?? '')]
];
}
if ($method == 'DONE') {
$data['id'] = $id;
$rule = [
'id' => [
new UnderCheck('contract_obligation'),
new ExistCheck('contract_obligation'),
new ContractObligationDoneCheck()
],
];
}
if ($method == 'DEL') { if ($method == 'DEL') {
$data['id'] = $id; $data['id'] = $id;
$rule = [ $rule = [
+68
View File
@@ -0,0 +1,68 @@
<?php
namespace App\Http\Rules\User;
use Auth;
use App\Models\Contract;
use App\Http\Helpers\Hasher;
use Illuminate\Contracts\Validation\Rule;
class ContractDoneCheck implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
public function __construct()
{
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$this->attribute = $attribute;
$value = is_array($value) ? $value : [$value];
$allow = true;
foreach ($value as $key => $row) {
if(!empty($row)) {
$id = Hasher::decode('contracts', $row);
$contract = Contract::
where('id', $id)
->first();
foreach ($contract->contract_obligation_list as $key => $row) {
echo $row->status;
if ($row->status != config('constants.contract_obligation.status.active')) {
$allow = false;
}
}
}
}
return $allow;
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
if ($this->type == 'complete') {
return config('error_code.contract_done_error');
}
}
}
@@ -0,0 +1,91 @@
<?php
namespace App\Http\Rules\User;
use Auth;
use App\Models\ContractObligation;
use App\Http\Helpers\Hasher;
use Illuminate\Contracts\Validation\Rule;
class ContractObligationCompleteOrAcceptCheck implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
private $type;
public function __construct($type = '')
{
$this->type = $type;
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$this->attribute = $attribute;
$value = is_array($value) ? $value : [$value];
foreach ($value as $key => $row) {
if(!empty($row)) {
$id = Hasher::decode('contract_obligations', $row);
$contract_obligation = ContractObligation::
where('id', $id)
->first();
if (!empty($contract_obligation->contract_obligation_dependency_list)) {
foreach ($contract_obligation->contract_obligation_dependency_list as $key_2 => $row_2) {
$depend_id = Hasher::decode('contract_obligations', $row_2->depend_contract_obligation_hash_id);
$depend_contract_obligation = ContractObligation::
where('id', $depend_id)
->first();
if ($this->type == 'complete') {
$depend_contract_obligation_must_complete = $depend_contract_obligation->must_complete;
$depend_contract_obligation_complete_status = $depend_contract_obligation->complete_status;
if ($depend_contract_obligation_must_complete == config('constants.contract_obligation.must_complete.complete')) {
if ($depend_contract_obligation_complete_status != config('constants.contract_obligation.complete_status.completed')) {
return false;
}
}
}
if ($this->type == 'accept') {
$depend_contract_obligation_must_accept = $depend_contract_obligation->must_accept;
$depend_contract_obligation_accept_status = $depend_contract_obligation->accept_status;
if ($depend_contract_obligation_must_accept == config('constants.contract_obligation.must_accept.accept')) {
if ($depend_contract_obligation_accept_status != config('constants.contract_obligation.accept_status.accepted')) {
return false;
}
}
}
}
}
}
}
return true;
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
if ($this->type == 'complete') {
return config('error_code.contract_obligation_complete_error');
}
}
}
@@ -0,0 +1,80 @@
<?php
namespace App\Http\Rules\User;
use Auth;
use App\Models\ContractObligation;
use App\Http\Helpers\Hasher;
use Illuminate\Contracts\Validation\Rule;
class ContractObligationDoneCheck implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
private $type;
public function __construct()
{
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$this->attribute = $attribute;
$value = is_array($value) ? $value : [$value];
$allow = true;
foreach ($value as $key => $row) {
if(!empty($row)) {
$id = Hasher::decode('contract_obligations', $row);
$contract_obligation = ContractObligation::
where('id', $id)
->first();
$contract_obligation_must_complete = $contract_obligation->must_complete;
$contract_obligation_complete_status = $contract_obligation->complete_status;
if ($contract_obligation_must_complete == config('constants.contract_obligation.must_complete.complete')) {
if ($contract_obligation_complete_status != config('constants.contract_obligation.complete_status.completed')) {
$allow = false;
}
}
$contract_obligation_must_accept = $contract_obligation->must_accept;
$contract_obligation_accept_status = $contract_obligation->accept_status;
if ($contract_obligation_must_accept == config('constants.contract_obligation.must_accept.accept')) {
if ($contract_obligation_accept_status != config('constants.contract_obligation.accept_status.accepted')) {
$allow = false;
}
}
}
}
return $allow;
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
if ($this->type == 'complete') {
return config('error_code.contract_obligation_done_error');
}
}
}
@@ -0,0 +1,68 @@
<?php
namespace App\Http\Rules\User;
use Auth;
use App\Models\ContractObligation;
use App\Models\EntitySignature;
use App\Http\Helpers\Hasher;
use Illuminate\Contracts\Validation\Rule;
class ContractObligationEntitySignatureCheck implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
private $contract_obligation_id;
public function __construct($contract_obligation_id = '')
{
$this->contract_obligation_id = $contract_obligation_id;
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$this->attribute = $attribute;
$value = is_array($value) ? $value : [$value];
$entity_signature_id = Hasher::decode('entity_signatures', $value[0]);
$entity_signature = EntitySignature::find($entity_signature_id);
if ($entity_signature) {
if ($entity_signature->type == config('constants.entity.signature.master')) {
return true;
}
}
$contract_obligation_id = Hasher::decode('contract_obligations', $this->contract_obligation_id);
$contract_obligation = ContractObligation::find($contract_obligation_id);
if ($contract_obligation->contract_entity_list[0]->entity_signature_hash_id == $value[0]) {
return true;
}
return false;
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return config('error_code.obligation_signature_error');
}
}
+16 -4
View File
@@ -3,11 +3,8 @@
namespace App\Http\Rules\User; namespace App\Http\Rules\User;
use Auth; use Auth;
use App\Models\ContractTemplate;
use App\Models\ContractTemplateObligation;
use App\Models\Contract; use App\Models\Contract;
use App\Models\ContractEntity; use App\Models\ContractObligation;
use App\Models\Entity;
use App\Http\Helpers\Hasher; use App\Http\Helpers\Hasher;
@@ -57,6 +54,21 @@ class StatusCheck implements Rule
} }
} }
if ($this->type == 'contract_obligation') {
foreach ($value as $key => $row) {
if(!empty($row)) {
$id = Hasher::decode('contract_obligations', $row);
$data = ContractObligation::
where('id', $id)
->whereIn('status', $this->status)
->count();
if (!$data) {
return false;
}
}
}
}
return true; return true;
} }
+6 -1
View File
@@ -11,7 +11,7 @@ class ContractEntity extends Model
{ {
protected $table = 'contract_entities'; protected $table = 'contract_entities';
protected $appends = ['hash_id', 'contract_list', 'entity_list']; protected $appends = ['hash_id', 'entity_signature_hash_id', 'contract_list', 'entity_list'];
public function contract() public function contract()
{ {
@@ -28,6 +28,11 @@ class ContractEntity extends Model
return Hasher::encode('contract_entities', $this->id); return Hasher::encode('contract_entities', $this->id);
} }
public function getEntitySignatureHashIdAttribute()
{
return Hasher::encode('entity_signatures', $this->entity_signature_id);
}
public function getContractListAttribute() public function getContractListAttribute()
{ {
return $this->contract()->get()->makeHidden(['contract_entity_list']); return $this->contract()->get()->makeHidden(['contract_entity_list']);
+6
View File
@@ -13,6 +13,7 @@ class ContractObligation extends Model
protected $appends = [ protected $appends = [
'hash_id', 'hash_id',
'contract_hash_id',
'contract_list', 'contract_list',
'contract_obligation_dependency_list', 'contract_obligation_dependency_list',
'depend_contract_obligation_dependency_list', 'depend_contract_obligation_dependency_list',
@@ -54,6 +55,11 @@ class ContractObligation extends Model
return Hasher::encode('contract_obligations', $this->id); return Hasher::encode('contract_obligations', $this->id);
} }
public function getContractHashIdAttribute()
{
return Hasher::encode('contracts', $this->contract_id);
}
public function getContractListAttribute() public function getContractListAttribute()
{ {
return $this->contract()->get()->makeHidden(['contract_obligation_list']); return $this->contract()->get()->makeHidden(['contract_obligation_list']);
+16
View File
@@ -11,6 +11,7 @@
'entity' => [ 'entity' => [
'signature' => [ 'signature' => [
'master_key' => 1, 'master_key' => 1,
'normal_key' => 2,
], ],
'status' => [ 'status' => [
'active' => 1, 'active' => 1,
@@ -50,6 +51,7 @@
'status' => [ 'status' => [
'active' => 1, 'active' => 1,
'delete' => 2, 'delete' => 2,
'done' => 3,
'pending' => 9 'pending' => 9
] ]
], ],
@@ -61,6 +63,20 @@
] ]
], ],
'contract_obligation' => [ 'contract_obligation' => [
'must_complete' => [
'complete' => 1,
'no_need_complete' => 2,
],
'must_accept' => [
'accept' => 1,
'no_need_accept' => 2,
],
'status' => [
'active' => 1,
'delete' => 2,
'done' => 3,
'pending' => 9
],
'complete_status' => [ 'complete_status' => [
'pending' => 9, 'pending' => 9,
'delete' => 2, 'delete' => 2,
+4
View File
@@ -14,6 +14,10 @@
'date' => 'DATE_INVALID', 'date' => 'DATE_INVALID',
'confirmed' => 'CONFIRM_ERROR', 'confirmed' => 'CONFIRM_ERROR',
'obligation_depend_error' => 'OBLIGATION_DEPEND_ERROR', 'obligation_depend_error' => 'OBLIGATION_DEPEND_ERROR',
'obligation_signature_error' => 'OBLIGATION_SIGNATURE_ERROR',
'contract_obligation_done_error' => 'CONTRACT_OBLIGATION_DONE_ERROR',
'contract_obligation_complete_error' => 'CONTRACT_OBLIGATION_COMPLETE_ERROR',
'contract_done_error' => 'CONTRACT_DONE_ERROR',
'status_error' => 'STATUS_ERROR', 'status_error' => 'STATUS_ERROR',
'min' => [ 'min' => [
'string' => 'MIN_ERROR_:min', 'string' => 'MIN_ERROR_:min',
@@ -21,7 +21,7 @@ class CourierDeliverServiceContractTemplateTableSeeder extends Seeder
'user_id' => 4, 'user_id' => 4,
'name' => 'J&T Contract Deliver Service', 'name' => 'J&T Contract Deliver Service',
'complete_day_range' => 7, 'complete_day_range' => 7,
'status' => config('constants.contact.status.active'), 'status' => config('constants.contract.status.active'),
'created_at' => date('Y-m-d H:i:s'), 'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s') 'updated_at' => date('Y-m-d H:i:s')
] ]
@@ -21,7 +21,7 @@ class PlumberServiceContractTemplateTableSeeder extends Seeder
'user_id' => 3, 'user_id' => 3,
'name' => 'Mushroom Kingdom Service', 'name' => 'Mushroom Kingdom Service',
'complete_day_range' => 1, 'complete_day_range' => 1,
'status' => config('constants.contact.status.active'), 'status' => config('constants.contract.status.active'),
'created_at' => date('Y-m-d H:i:s'), 'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s') 'updated_at' => date('Y-m-d H:i:s')
], ],
@@ -30,7 +30,7 @@ class PlumberServiceContractTemplateTableSeeder extends Seeder
'user_id' => 3, 'user_id' => 3,
'name' => 'Plumber Mario Service', 'name' => 'Plumber Mario Service',
'complete_day_range' => 1, 'complete_day_range' => 1,
'status' => config('constants.contact.status.active'), 'status' => config('constants.contract.status.active'),
'created_at' => date('Y-m-d H:i:s'), 'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s') 'updated_at' => date('Y-m-d H:i:s')
] ]
@@ -21,7 +21,7 @@ class SodaVendorContractTemplatesTableSeeder extends Seeder
'user_id' => 2, 'user_id' => 2,
'name' => 'Coca Cola Contract Service', 'name' => 'Coca Cola Contract Service',
'complete_day_range' => 1, 'complete_day_range' => 1,
'status' => config('constants.contact.status.active'), 'status' => config('constants.contract.status.active'),
'created_at' => date('Y-m-d H:i:s'), 'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s') 'updated_at' => date('Y-m-d H:i:s')
] ]
@@ -56,6 +56,7 @@
<div v-if="contract.contract_obligation_list" v-for="(obligation, $index) in contract.contract_obligation_list" :key="$index"> <div v-if="contract.contract_obligation_list" v-for="(obligation, $index) in contract.contract_obligation_list" :key="$index">
<div> <div>
-{{ obligation.name }} -{{ obligation.name }}
<small>({{ obligation.hash_id }})</small>
<small>({{ obligation.sequence }})</small> <small>({{ obligation.sequence }})</small>
<small>({{ obligation.contract_entity_list[0] ? obligation.contract_entity_list[0].entity_list[0].name : '-' }})</small> <small>({{ obligation.contract_entity_list[0] ? obligation.contract_entity_list[0].entity_list[0].name : '-' }})</small>
</div> </div>
+17 -8
View File
@@ -360,30 +360,39 @@ Route::group(['namespace' => 'User', 'prefix' => 'user-backsys/api'], function (
Route::prefix('contract-obligation')->group(function () { Route::prefix('contract-obligation')->group(function () {
Route::get('list', Route::get('list',
[ [
'as' => 'api.contract-entity.list', 'as' => 'api.contract-obligation.list',
'uses' => 'ContractObligationController@list', 'uses' => 'ContractObligationController@list',
'middleware' => ['permission:view contract_obligation'] 'middleware' => ['permission:view contract_obligation']
] ]
); );
Route::get('show/{hash_id}', Route::get('show/{hash_id}',
[ [
'as' => 'api.contract-entity.show', 'as' => 'api.contract-obligation.show',
'uses' => 'ContractObligationController@show', 'uses' => 'ContractObligationController@show',
'middleware' => ['permission:view contract_obligation'] 'middleware' => ['permission:view contract_obligation']
] ]
); );
Route::put('assign-contract-entity/{hash_id}', Route::put('assign-contract-entity/{hash_id}',
[ [
'as' => 'api.contract-entity.update', 'as' => 'api.contract-obligation.assign-contract-entity',
'uses' => 'ContractObligationController@assignContractEntity', 'uses' => 'ContractObligationController@assignContractEntity',
'middleware' => ['permission:edit contract_obligation'] 'middleware' => ['permission:edit contract_obligation']
] ]
); );
Route::put('update-complete/{hash_id}',
[
'as' => 'api.contract-obligation.update-complete',
'uses' => 'ContractObligationController@updateComplete',
'middleware' => ['permission:edit contract_obligation']
]
);
Route::put('update-accept/{hash_id}',
[
'as' => 'api.contract-obligation.update-accept',
'uses' => 'ContractObligationController@updateAccept',
'middleware' => ['permission:edit contract_obligation']
]
);
}); });
// contract generate
// contract assign entity
// contract active
}); });
}); });