dbmsv4 init...3
This commit is contained in:
parent
32c2f61ef7
commit
3de5fd617b
@ -5,7 +5,6 @@ namespace App\Services\Customer\Wallet;
|
||||
use App\DTOs\Customer\Wallet\AccountDTO;
|
||||
use App\Entities\Customer\ClientEntity;
|
||||
use App\Entities\Customer\Wallet\AccountEntity;
|
||||
use App\Entities\PaymentEntity;
|
||||
use App\Forms\Customer\Wallet\AccountForm;
|
||||
use App\Helpers\Customer\Wallet\AccountHelper;
|
||||
use App\Models\Customer\Wallet\AccountModel;
|
||||
@ -167,7 +166,7 @@ class AccountService extends WalletService
|
||||
));
|
||||
}
|
||||
//최종처리
|
||||
$formDatas['bank'] = BANKS['결제차감'];
|
||||
$formDatas['bank'] = array_key_exists('bank', $formDatas) ? $formDatas['bank'] : BANKS['결제차감'];
|
||||
$formDatas['alias'] = array_key_exists('alias', $formDatas) ? $formDatas['alias'] : $clientEntity->getTitle();
|
||||
$formDatas['balance'] = $clientEntity->getAccountBalance() - $formDatas['amount'];
|
||||
if ($formDatas['balance'] < 0) {
|
||||
|
||||
@ -13,6 +13,7 @@ use RuntimeException;
|
||||
|
||||
class CouponService extends WalletService
|
||||
{
|
||||
const CLIENTINFO_BALANCE_FIELD = 'coupon_balance';
|
||||
private $_form = null;
|
||||
private $_helper = null;
|
||||
public function __construct(CouponModel $model)
|
||||
@ -112,7 +113,6 @@ class CouponService extends WalletService
|
||||
protected function create_process(array $formDatas): CouponEntity
|
||||
{
|
||||
$entity = parent::create_process($formDatas);
|
||||
service('customer_clientservice')->updateBalance($entity->getClientInfoUID(), "쿠폰", PAYMENT['PAY']['COUPON'], $entity->getCnt(), $entity->getStatus());
|
||||
return $entity;
|
||||
}
|
||||
protected function modify_process($entity, array $formDatas): CouponEntity
|
||||
@ -123,6 +123,21 @@ class CouponService extends WalletService
|
||||
//FormFilter 조건절 처리
|
||||
//검색어조건절처리
|
||||
|
||||
//입금,쿠폰 충전 처리
|
||||
protected function deposit_process(ClientEntity $clientEntity, array $formDatas): array
|
||||
{
|
||||
if (!array_key_exists('cnt', $formDatas)) {
|
||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 쿠폰수가 정의되지 않았습니다.");
|
||||
}
|
||||
//최종처리
|
||||
$formDatas['balance'] = $clientEntity->getCouponBalance() + $formDatas['cnt'];
|
||||
if ($formDatas['balance'] < 0) {
|
||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 쿠폰수가 0보다 작은 값이 정의 되었습니다.");
|
||||
}
|
||||
//고객 잔액 갱신
|
||||
service('customer_clientservice')->modify_process($clientEntity, [self::CLIENTINFO_BALANCE_FIELD => $formDatas['balance']]);
|
||||
return parent::deposit_process($clientEntity, $formDatas);
|
||||
}
|
||||
//결제 관련 쿠폰 사용 처리
|
||||
protected function withdrawalByPayment_process(ClientEntity $clientEntity, PaymentEntity $paymentEntity, array $formDatas): array
|
||||
{
|
||||
|
||||
@ -112,7 +112,6 @@ class PointService extends WalletService
|
||||
protected function create_process(array $formDatas): PointEntity
|
||||
{
|
||||
$entity = parent::create_process($formDatas);
|
||||
service('customer_clientservice')->updateBalance($entity->getClientInfoUID(), "포인트", PAYMENT['PAY']['POINT'], $entity->getAmount(), $entity->getStatus());
|
||||
return $entity;
|
||||
}
|
||||
protected function modify_process($entity, array $formDatas): PointEntity
|
||||
|
||||
Loading…
Reference in New Issue
Block a user