mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-20 21:13:59 +00:00
Merge branch 'dillon/110-period-lock-a' into vapor/development
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class KeyValuePairIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder
|
||||
->whereNull('owner_type')
|
||||
->whereNull('owner_id')
|
||||
->whereIn('key', [$value]);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Bookings\Processors\RegenerateInvoiceBookingProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace App\Classes\Jobs\Commands\V2;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Classes\Jobs;
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Notifications\WelcomeVoucherEmail;
|
||||
use App\Models\User;
|
||||
use App\Models\Voucher;
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Classes\Modules\Banks\Services\UpdatesBank;
|
||||
use App\Classes\Modules\Banks\Services\CreatesOrUpdateBank;
|
||||
use App\Classes\Modules\Banks\DataTransferObjects\BankObject;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Bank;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompany;
|
||||
use App\Classes\Modules\Bookings\Standards\Rules\CanCreateBooking;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBooking;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -6,8 +6,8 @@ use App\Classes\Modules\Bookings\Services\UpdatesBookingFixedAmount;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBooking;
|
||||
use App\Classes\Modules\Bookings\Standards\Rules\CanUpdateBooking;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Bookings\Services\CalculatesBookingOutstanding;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
|
||||
@@ -7,8 +7,8 @@ use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessPaymentReportV2CommandJob;
|
||||
use App\Classes\Jobs\Commands\V2\ProcessSalesInvoiceReportV2CommandJob;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Imports\Services\AutoCountDataImport;
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Settings\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\Bookings\Standards\Rules\CanCreateBooking;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateLockLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Lock Created',
|
||||
'message' => 'You have successfully created a lock'
|
||||
];
|
||||
}
|
||||
|
||||
// /** @var CanCreateBooking */
|
||||
// private $canCreateBooking;
|
||||
|
||||
/** @var CreatesKeyValuePair */
|
||||
private $createsKeyValuePair;
|
||||
|
||||
/**
|
||||
* CreateLockLogic constructor.
|
||||
* @param CanCreateBooking $canCreateBooking
|
||||
* @param CreatesKeyValuePair $createsKeyValuePair
|
||||
*/
|
||||
public function __construct(CanCreateBooking $canCreateBooking, CreatesKeyValuePair $createsKeyValuePair)
|
||||
{
|
||||
// $this->canCreateBooking = $canCreateBooking;
|
||||
$this->createsKeyValuePair = $createsKeyValuePair;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
// $password = $request->input('password');
|
||||
// if($password !== 'prototype'){
|
||||
// throw new AccessForbiddenException('Incorrect Password');
|
||||
// }
|
||||
|
||||
$keyValuePairObject = new KeyValuePairObject(
|
||||
KVPKey::UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED,
|
||||
0
|
||||
);
|
||||
$this->createsKeyValuePair->execute(null, $keyValuePairObject);
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Settings\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBooking;
|
||||
use App\Classes\Modules\Bookings\Standards\Rules\CanFetchBooking;
|
||||
use App\Http\Resources\LockResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchLockLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Lock',
|
||||
'message' => 'You have successfully retrieved a Lock'
|
||||
];
|
||||
}
|
||||
|
||||
// /** @var CanFetchBooking */
|
||||
// private $canFetchBooking;
|
||||
|
||||
/** @var FetchesKeyValuePair */
|
||||
private $fetchesKeyValuePair;
|
||||
|
||||
/**
|
||||
* FetchLockLogic constructor.
|
||||
* @param CanFetchBooking $canFetchBooking
|
||||
* @param FetchesKeyValuePair $fetchesKeyValuePair
|
||||
*/
|
||||
public function __construct(CanFetchBooking $canFetchBooking, FetchesBooking $fetchesKeyValuePair)
|
||||
{
|
||||
// $this->canFetchBooking = $canFetchBooking;
|
||||
$this->fetchesKeyValuePair = $fetchesKeyValuePair;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
// $this->canFetchBooking->passes();
|
||||
|
||||
// $query = $this->fetchesKeyValuePair->execute(['marking' => $request->route('marking'), 'with_transactions' => true]);
|
||||
|
||||
// return $this->resourceResponse(new LockResource($query));
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Settings\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Settings\Services\ListsKeyValuePairs;
|
||||
use App\Classes\Modules\ServiceTypes\Standards\Rules\CanListServiceTypes;
|
||||
use App\Http\Resources\LockResource;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListLocksLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Locks',
|
||||
'message' => 'You have successfully retrieved a list of Locks'
|
||||
];
|
||||
}
|
||||
|
||||
// /** @var CanListServiceTypes */
|
||||
// private $canListServiceTypes;
|
||||
|
||||
/** @var ListsKeyValuePairs */
|
||||
private $listsKeyValuePairs;
|
||||
|
||||
/**
|
||||
* ListLocksLogic constructor.
|
||||
* @param CanListServiceTypes $canListServiceTypes
|
||||
* @param ListsKeyValuePairs $listsKeyValuePairs
|
||||
*/
|
||||
public function __construct(CanListServiceTypes $canListServiceTypes, ListsKeyValuePairs $listsKeyValuePairs)
|
||||
{
|
||||
// $this->canListServiceTypes = $canListServiceTypes;
|
||||
$this->listsKeyValuePairs = $listsKeyValuePairs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
// $this->canListServiceTypes->passes();
|
||||
|
||||
$query = $this->listsKeyValuePairs->execute($this->listsKeyValuePairs->deserializeFilters($request->input('filters')));
|
||||
|
||||
return $this->collectionResponse(LockResource::collection($query));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Settings\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
use App\Classes\Modules\ServiceTypes\Standards\Rules\CanUpdateServiceType;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Http\Resources\LockResource;
|
||||
use App\Models\KeyValuePair;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateLockLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Updated Lock Status',
|
||||
'message' => 'You have successfully updated the Lock status'
|
||||
];
|
||||
}
|
||||
|
||||
// /** @var CanUpdateServiceType */
|
||||
// private $canUpdateServiceType;
|
||||
|
||||
/** @var CreatesKeyValuePair */
|
||||
private $createsKeyValuePair;
|
||||
|
||||
/** @var UpdatesKeyValuePair */
|
||||
private $updatesKeyValuePair;
|
||||
|
||||
/**
|
||||
* UpdateLockLogic constructor.
|
||||
* @param CanUpdateServiceType $canUpdateServiceType
|
||||
* @param CreatesKeyValuePair $createsKeyValuePair
|
||||
* @param UpdatesKeyValuePair $updatesKeyValuePair
|
||||
*/
|
||||
public function __construct(CanUpdateServiceType $canUpdateServiceType, CreatesKeyValuePair $createsKeyValuePair, UpdatesKeyValuePair $updatesKeyValuePair)
|
||||
{
|
||||
// $this->canUpdateServiceType = $canUpdateServiceType;
|
||||
$this->createsKeyValuePair = $createsKeyValuePair;
|
||||
$this->updatesKeyValuePair = $updatesKeyValuePair;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$key = $request->input('key');
|
||||
$kvp = KeyValuePair::whereNull('owner_type')
|
||||
->whereNull('owner_id')
|
||||
->where('key', $key)
|
||||
->first();
|
||||
$value = ($kvp->value === "1") ? "0" : "1";
|
||||
$this->updateOrCreateKeyValuePair($key, $value);
|
||||
return $this->resourceResponse(new LockResource($kvp));
|
||||
|
||||
}
|
||||
|
||||
private function updateOrCreateKeyValuePair($key, $value)
|
||||
{
|
||||
$keyValuePairObject = new KeyValuePairObject($key, $value);
|
||||
$kvp = KeyValuePair::whereNull('owner_type')
|
||||
->whereNull('owner_id')
|
||||
->where('key', $key)
|
||||
->first();
|
||||
|
||||
if ($kvp) {
|
||||
$this->updatesKeyValuePair->execute($kvp, $keyValuePairObject);
|
||||
} else {
|
||||
$this->createsKeyValuePair->execute(null, $keyValuePairObject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+10
-3
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\Services;
|
||||
namespace App\Classes\Modules\Settings\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
|
||||
@@ -17,12 +17,19 @@ class CreatesKeyValuePair extends AbstractUpdateRelationshipRecord
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
|
||||
public function execute(KeyValueInterface $kv, KeyValuePairObject $object) {
|
||||
public function execute(?KeyValueInterface $kv, KeyValuePairObject $object) {
|
||||
$model = new KeyValuePair();
|
||||
$model->key = $object->getKey();
|
||||
$model->value = $object->getValue();
|
||||
|
||||
return $this->handler($kv->attributesKVP(), $model);
|
||||
// Owner-less
|
||||
if (is_null($kv)) {
|
||||
$model->owner_type = null;
|
||||
$model->owner_id = null;
|
||||
$model->save();
|
||||
return $model;
|
||||
}
|
||||
|
||||
return $this->handler($kv->attributesKVP(), $model);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Settings\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractFetchRecord;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\KeyValuePair;
|
||||
|
||||
class FetchesKeyValuePair extends AbstractFetchRecord
|
||||
{
|
||||
|
||||
/** @var KeyValuePair */
|
||||
private $repository;
|
||||
|
||||
|
||||
/**
|
||||
* FetchesKeyValuePair constructor.
|
||||
* @param KeyValuePair $repository
|
||||
*/
|
||||
public function __construct(KeyValuePair $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
public function getRepository(): Builder
|
||||
{
|
||||
return $this->repository->newQuery();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Settings\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractListRecord;
|
||||
use App\Models\KeyValuePair;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ListsKeyValuePairs extends AbstractListRecord
|
||||
{
|
||||
|
||||
/** @var KeyValuePair */
|
||||
private $repository;
|
||||
|
||||
|
||||
/**
|
||||
* ListsKeyValuePairs constructor.
|
||||
* @param KeyValuePair $repository
|
||||
*/
|
||||
public function __construct(KeyValuePair $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
function getRepository(): Builder
|
||||
{
|
||||
return $this->repository->newQuery();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\Services;
|
||||
namespace App\Classes\Modules\Settings\Services;
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRecord;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
|
||||
@@ -16,8 +16,8 @@ use App\Classes\Modules\Vouchers\Services\CreatesVoucher;
|
||||
use App\Classes\Modules\Vouchers\Services\FetchesVoucher;
|
||||
use App\Classes\Modules\Vouchers\Services\UpdatesVoucherCampaign;
|
||||
use App\Classes\Modules\Rewards\Services\CreatesUserReward;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Vouchers\Standards\Rules\CanCreateVoucher;
|
||||
use App\Classes\Modules\Vouchers\DataTransferObjects\ValidateVoucherifyVoucherObject;
|
||||
use App\Classes\Modules\Vouchers\DataTransferObjects\CreateVoucherObject;
|
||||
|
||||
@@ -15,8 +15,8 @@ use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
||||
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Accounts\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
|
||||
use App\Classes\Modules\Settings\Services\UpdatesKeyValuePair;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Models\Transaction;
|
||||
|
||||
|
||||
@@ -26,4 +26,10 @@ class KVPKey
|
||||
|
||||
public const BOOKING_IS_LOCKED = 'BOOKING_IS_LOCKED';
|
||||
|
||||
public const UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED = 'UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED';
|
||||
|
||||
public const UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED = 'UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED';
|
||||
|
||||
public const UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED = 'UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED';
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Classes\Modules\Settings\ControllersLogic\CreateLockLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateLockController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param CreateLockLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function create(Request $request, CreateLockLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Classes\Modules\Settings\ControllersLogic\FetchLockLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchLockController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param FetchLockLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function fetch(Request $request, FetchLockLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Classes\Modules\Settings\ControllersLogic\ListLocksLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListLocksController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListLocksLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListLocksLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Classes\Modules\Settings\ControllersLogic\UpdateLockLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateLockController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateLockLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(Request $request, UpdateLockLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,8 @@ namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\Modules\Transactions\Services\CalculatesBillGroupPaymentAmount;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Models\KeyValuePair;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
@@ -23,6 +25,11 @@ class BillGroupResource extends JsonResource
|
||||
$paid_amount = $billGroupPayment['paid_amount'];
|
||||
$outstanding_amount = $billGroupPayment['outstanding_amount'];
|
||||
|
||||
$ui_supplier_paid_currency_tab_is_locked = ($this->status === 2 || $this->status === 3)
|
||||
? KeyValuePair::whereNull('owner_type')->whereNull('owner_id')
|
||||
->whereIn('key', [KVPKey::UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED])->where('value', 1)->first()
|
||||
: null;
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'reference' => $this->reference,
|
||||
@@ -78,6 +85,7 @@ class BillGroupResource extends JsonResource
|
||||
'updated_at' => Carbon::parse($transaction->updated_at)->format('d-m-Y h:i:s A'),
|
||||
];
|
||||
}),
|
||||
'ui_supplier_paid_currency_tab_is_locked' => $ui_supplier_paid_currency_tab_is_locked ? 1 : 0,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Booking;
|
||||
use App\Models\KeyValuePair;
|
||||
use App\Models\Transaction;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
@@ -32,6 +34,16 @@ class GroupResource extends JsonResource
|
||||
if(!$this->issuerCompany){
|
||||
dd($this->id);
|
||||
}
|
||||
|
||||
$ui_payments_complete_currecy_orders_is_locked = ($this->status === 3)
|
||||
? KeyValuePair::whereNull('owner_type')->whereNull('owner_id')
|
||||
->whereIn('key', [KVPKey::UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED])->where('value', 1)->first()
|
||||
: null;
|
||||
$ui_payments_open_currecy_orders_is_locked = ($this->status === 0 || $this->status === 1 || $this->status === 2)
|
||||
? KeyValuePair::whereNull('owner_type')->whereNull('owner_id')
|
||||
->whereIn('key', [KVPKey::UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED])->where('value', 1)->first()
|
||||
: null;
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'original_amount' => (float) $this->original_amount,
|
||||
@@ -55,7 +67,9 @@ class GroupResource extends JsonResource
|
||||
'documents' => [
|
||||
'currency_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::CURRENCY_VENDOR_ORDER)->first()),
|
||||
'purchase_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::BULK_PURCHASE_ORDER)->first())
|
||||
]
|
||||
],
|
||||
'ui_payments_complete_currecy_orders_is_locked' => $ui_payments_complete_currecy_orders_is_locked ? 1 : 0,
|
||||
'ui_payments_open_currecy_orders_is_locked' => $ui_payments_open_currecy_orders_is_locked ? 1 : 0,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LockResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'key' => $this->key,
|
||||
'value' => $this->value,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class MakeOwnerNullableInKeyValuePairs extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('key_value_pairs', function (Blueprint $table) {
|
||||
$table->string('owner_type')->nullable()->change();
|
||||
$table->unsignedBigInteger('owner_id')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('key_value_pairs', function (Blueprint $table) {
|
||||
$table->string('owner_type')->nullable(false)->change();
|
||||
$table->unsignedBigInteger('owner_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\KVPKey;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\KeyValuePair;
|
||||
|
||||
|
||||
class KeyValuePairSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$data = [
|
||||
[
|
||||
'key' => KVPKey::UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED,
|
||||
'value' => 0,
|
||||
],
|
||||
[
|
||||
'key' => KVPKey::UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED,
|
||||
'value' => 0,
|
||||
],
|
||||
[
|
||||
'key' => KVPKey::UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED,
|
||||
'value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($data as $item) {
|
||||
KeyValuePair::updateOrCreate(
|
||||
[
|
||||
'owner_type' => null,
|
||||
'owner_id' => null,
|
||||
'key' => $item['key'],
|
||||
],
|
||||
[
|
||||
'value' => $item['value'],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,10 +51,10 @@
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="col-auto position-static no-padding requestModal" data-type="cancelBillGroup" v-if="section === 'paidBillGroupList'">
|
||||
<div class="btn btn-xs btn-outline-danger">
|
||||
Cancel
|
||||
<div class="btn btn-xs" :class="item.ui_supplier_paid_currency_tab_is_locked ? 'btn-disabled-custom' : 'btn-outline-danger'" :disabled="item.ui_supplier_paid_currency_tab_is_locked">
|
||||
{{ item.ui_supplier_paid_currency_tab_is_locked ? 'Cancel Disabled' : 'Cancel' }}
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="cancelBillGroup">
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="cancelBillGroup" v-if="!item.ui_supplier_paid_currency_tab_is_locked">
|
||||
<general-confirmation-form-component
|
||||
contentText="Are you sure you want to cancel this Bill Group?"
|
||||
modalType="delete"
|
||||
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded">
|
||||
<div class="row m-b-10">
|
||||
@@ -195,7 +195,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-20 m-b-20" v-if="item.payment_history.length === 0">
|
||||
<div class="col">
|
||||
@@ -261,7 +261,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,13 +62,18 @@
|
||||
<div class="row m-b-15 p-b-10 b-b b-grey">
|
||||
<div class="col">
|
||||
<small class="all-caps muted fs-10">Complete Currency Orders</small>
|
||||
<list-component key="lock-1" section="lockCompleteCurrencyOrderSection" :endpoint="route('api.setting.list.lock')" :options="{'key_value_pair_in': ['UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED']}" style="min-height: 50px;width:100%">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<component-lock section="lockCompleteCurrencyOrderSection" :data="data"></component-lock>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<list-component :key="currencyOrderKey" section="completeTransactionGroupsListSection" :options="{'per_page': 20, 'status': 3, ...this.filterSupplier && {'issuer_in': [this.filterSupplier]}}" :endpoint="route('api.transaction.group.list')">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<transaction-group-component section="transactionGroupsListSection" :data="data"></transaction-group-component>
|
||||
<transaction-group-component section="completeTransactionGroupsListSection" :data="data"></transaction-group-component>
|
||||
</template>
|
||||
</list-component>
|
||||
<!-- <list-component key="2" section="currencyOrdersListSection" :options="{'per_page': 20, 'document_type_in': ['CURRENCY_VENDOR_ORDER'], 'status': 2, 'with_company': true}" :endpoint="route('api.document.list')">
|
||||
@@ -83,13 +88,18 @@
|
||||
<div class="row m-b-15 p-b-10 b-b b-grey">
|
||||
<div class="col">
|
||||
<small class="all-caps muted fs-10">Open Currency Orders</small>
|
||||
<list-component key="lock-2" section="lockOpenCurrencyOrderSection" :endpoint="route('api.setting.list.lock')" :options="{'key_value_pair_in': ['UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED']}" style="min-height: 50px;width:100%">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<component-lock section="lockOpenCurrencyOrderSection" :data="data"></component-lock>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<list-component :key="currencyOrderKey" section="transactionGroupsListSection" :options="{'per_page': 20, 'status_in': [0, 1, 2], ...this.filterSupplier && {'issuer_in': [this.filterSupplier]}}" :endpoint="route('api.transaction.group.list')">
|
||||
<list-component :key="currencyOrderKey" section="openTransactionGroupsListSection" :options="{'per_page': 20, 'status_in': [0, 1, 2], ...this.filterSupplier && {'issuer_in': [this.filterSupplier]}}" :endpoint="route('api.transaction.group.list')">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<transaction-group-component section="transactionGroupsListSection" :data="data"></transaction-group-component>
|
||||
<transaction-group-component section="openTransactionGroupsListSection" :data="data"></transaction-group-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
|
||||
@@ -114,16 +114,16 @@
|
||||
<button class="btn btn-xs btn-complete b-rad-none">
|
||||
<i class="fa fa-refresh" @click="updateDo()"></i>
|
||||
</button>
|
||||
<button class="btn btn-xs btn-warning b-rad-none requestModal" data-type="editTransactionGroup">
|
||||
<button class="btn btn-xs btn-warning b-rad-none requestModal" data-type="editTransactionGroup" :disabled="isButtonLocked(item, section)">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</button>
|
||||
<modal-component small type="editTransactionGroup">
|
||||
<modal-component small type="editTransactionGroup" v-if="!isButtonLocked(item, section)">
|
||||
<edit-transaction-group-form-component :section="section" :currency_rate="item.currency_rate" :supplier_id ="data.issuer_id" :id="item.id"></edit-transaction-group-form-component>
|
||||
</modal-component>
|
||||
<button class="btn btn-xs btn-danger b-rad-none requestModal" data-type="deleteTransactionGroup">
|
||||
<button class="btn btn-xs btn-danger b-rad-none requestModal" data-type="deleteTransactionGroup" :disabled="isButtonLocked(item, section)">
|
||||
<i class="fa fa-times"></i>
|
||||
</button>
|
||||
<modal-component small type="deleteTransactionGroup">
|
||||
<modal-component small type="deleteTransactionGroup" v-if="!isButtonLocked(item, section)">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
@@ -191,6 +191,15 @@
|
||||
updateDo() {
|
||||
this.isLoading = true;
|
||||
this.submit(this.route('api.transaction.group.bulk.po'), 'post', this.section, true, true);
|
||||
},
|
||||
isButtonLocked(item, section) {
|
||||
if (section === 'completeTransactionGroupsListSection') {
|
||||
return item.ui_payments_complete_currecy_orders_is_locked === 1;
|
||||
}
|
||||
if (section === 'openTransactionGroupsListSection') {
|
||||
return item.ui_payments_open_currecy_orders_is_locked === 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<transition name="fade">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button v-if="item.value === '0' && $store.getters.isAdmin" @click="lock(item.key)">
|
||||
🔒 Click to Lock {{ postfix ? ` ${postfix}` : '' }}
|
||||
</button>
|
||||
<button v-if="item.value === '1' && $store.getters.isAdmin" @click="lock(item.key)">
|
||||
🔓 Click to Unlock {{ postfix ? ` ${postfix}` : '' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
name: "ComponentLock",
|
||||
props: {
|
||||
section:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
postfix: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
lock(key){
|
||||
this.parameters = {
|
||||
key: key
|
||||
};
|
||||
this.submit(
|
||||
route("api.setting.update.lock"),
|
||||
"post",
|
||||
this.section,
|
||||
true,
|
||||
false
|
||||
);
|
||||
},
|
||||
successHandler(response, section, payload){
|
||||
this.$store.dispatch('reloadList', {'name': this.section});
|
||||
if(section === 'lockPaidBillGroup'){
|
||||
this.$store.dispatch('reloadList', {'name': 'paidBillGroupListSection'});
|
||||
}
|
||||
else if(section === 'lockCompleteCurrencyOrderSection'){
|
||||
this.$store.dispatch('reloadList', {'name': 'completeTransactionGroupsListSection'});
|
||||
}
|
||||
else if(section === 'lockOpenCurrencyOrderSection'){
|
||||
this.$store.dispatch('reloadList', {'name': 'openTransactionGroupsListSection'});
|
||||
}
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-15 parentContainer">
|
||||
<div class="col">
|
||||
<list-component key="lock-1" section="lockSectionCompleteCurrencyOrderSection" :endpoint="route('api.setting.list.lock')" :options="{'key_value_pair_in': ['UI_PAYMENTS_COMPLETE_CURRENCY_ORDERS_IS_LOCKED']}" style="min-height: 25px;width:100%">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<component-lock section="lockSectionCompleteCurrencyOrderSection" :data="data" :postfix="'Payments > Complete Current Orders'"></component-lock>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15 parentContainer">
|
||||
<div class="col">
|
||||
<list-component key="lock-2" section="lockSectionOpenCurrencyOrderSection" :endpoint="route('api.setting.list.lock')" :options="{'key_value_pair_in': ['UI_PAYMENTS_OPEN_CURRENCY_ORDERS_IS_LOCKED']}" style="min-height: 25px;width:100%">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<component-lock section="lockSectionOpenCurrencyOrderSection" :data="data" :postfix="'Payments > Open Current Orders'"></component-lock>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15 parentContainer">
|
||||
<div class="col">
|
||||
<list-component key="lock-3" section="lockSectionPaidBillGroup" :endpoint="route('api.setting.list.lock')" :options="{'key_value_pair_in': ['UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED']}" style="min-height: 25px;width:100%">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<component-lock section="lockSectionPaidBillGroup" :data="data" :postfix="'Supplier Current Orders > Paid Current Order Tab'"></component-lock>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "LockSectionComponent",
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,8 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<lock-section-component></lock-section-component>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -122,6 +122,11 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<list-component key="lock-1" section="lockPaidBillGroup" :endpoint="route('api.setting.list.lock')" :options="{'key_value_pair_in': ['UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED']}" style="min-height: 50px;width:100%">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<component-lock section="lockPaidBillGroup" :data="data"></component-lock>
|
||||
</template>
|
||||
</list-component>
|
||||
<bill-group-list-section-component section="paidBillGroupList"></bill-group-list-section-component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -135,4 +140,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@@ -76,6 +76,8 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
|
||||
|
||||
require __DIR__ . '/export.php';
|
||||
|
||||
require __DIR__ . '/setting.php';
|
||||
|
||||
// require __DIR__ . '/rate.php';
|
||||
// require __DIR__ . '/receipt.php';
|
||||
});
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Settings\CreateLockController;
|
||||
use App\Http\Controllers\Settings\ListLocksController;
|
||||
use App\Http\Controllers\Settings\UpdateLockController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::prefix('setting')
|
||||
->as('setting.')
|
||||
->group(function () {
|
||||
Route::post('/create/lock', [CreateLockController::class, 'create'])->name('create.lock');
|
||||
Route::post('/update/lock', [UpdateLockController::class, 'update'])->name('update.lock');
|
||||
Route::get('/list/lock', [ListLocksController::class, 'list'])->name('list.lock');
|
||||
});
|
||||
@@ -1398,3 +1398,8 @@ Route::get('/preview-unfinished-payment-orders', function (Request $request) {
|
||||
Route::get('/run-batch-unfinished-payment-orders', function (Request $request) {
|
||||
return (new UnfinishedPaymentOrders())->execute($request);
|
||||
});
|
||||
|
||||
|
||||
Route::get('/period-lock', function () {
|
||||
return view('pages.dashboards.admin_lock');
|
||||
})->name('admin.admin_lock');
|
||||
|
||||
Reference in New Issue
Block a user