diff --git a/app/Interfaces/Equipment/ServerInterface.php b/app/Interfaces/Equipment/ServerInterface.php index 2098eec..58a65a3 100644 --- a/app/Interfaces/Equipment/ServerInterface.php +++ b/app/Interfaces/Equipment/ServerInterface.php @@ -7,7 +7,7 @@ use App\Entities\Equipment\ServerEntity; interface ServerInterface { - public function attachToService(ServiceEntity $serviceEntity, string $serverinfo_uid, array $formDatas = []): ServerEntity; - public function detachFromService(string $serverinfo_uid): ServerEntity; + public function attachToService(ServiceEntity $serviceEntity, $serverinfo_uid, array $formDatas = []): ServerEntity; + public function detachFromService($serverinfo_uid): ServerEntity; public function setAmount(ServerEntity $entity): ServerEntity; } diff --git a/app/Interfaces/Part/IPInterface.php b/app/Interfaces/Part/IPInterface.php index 394e8e0..feabf03 100644 --- a/app/Interfaces/Part/IPInterface.php +++ b/app/Interfaces/Part/IPInterface.php @@ -2,11 +2,19 @@ namespace App\Interfaces\Part; +use App\Entities\Equipment\LineEntity; use App\Entities\Equipment\ServerEntity; +use App\Entities\Equipment\ServerPartEntity; use App\Entities\Part\IPEntity; interface IPInterface { + //회선관련 작업 + public function attachToLine(LineEntity $lineEntity, string $ip): IPEntity; + //서버관련 작업 public function attachToServer(ServerEntity $serverEntity, array $formDatas = []): IPEntity; public function detachFromServer(ServerEntity $serverEntity): IPEntity; + //서버파트관련 작업 + public function attachToServerPart(ServerPartEntity $serverPartEntity): IPEntity; + public function detachFromServerPart(ServerPartEntity $serverPartEntity): IPEntity; } diff --git a/app/Interfaces/PaymentInterface.php b/app/Interfaces/PaymentInterface.php index f1105de..30a38b5 100644 --- a/app/Interfaces/PaymentInterface.php +++ b/app/Interfaces/PaymentInterface.php @@ -9,8 +9,8 @@ use App\Entities\PaymentEntity; interface PaymentInterface { //서비스 결제(월과금 서비스 사용) - public function createForService(ServiceEntity $serviceEntity): PaymentEntity; - public function updateForService(ServiceEntity $serviceEntity): PaymentEntity; + public function createForService(ServiceEntity $serviceEntity, int $amount): PaymentEntity; + public function updateForService(ServiceEntity $serviceEntity, int $amount): PaymentEntity; public function unlinkFromService(ServiceEntity $serviceEntity): PaymentEntity; //서버 파트 결제(파트/기타 일회성 서비스 사용) diff --git a/app/Models/CommonModel.php b/app/Models/CommonModel.php index e9ab8f5..3807083 100644 --- a/app/Models/CommonModel.php +++ b/app/Models/CommonModel.php @@ -10,6 +10,7 @@ abstract class CommonModel extends Model protected $primaryKey = ''; protected $useAutoIncrement = true; // protected $returnType = 'array'; + //true이면 모든 delete * 메소드 호출은 실제로 행을 삭제하는 것이 아니라 플래그를 데이터베이스로 설정 protected $useSoftDeletes = false; protected $protectFields = true; protected $allowedFields = []; diff --git a/app/Models/Customer/CustomerModel.php b/app/Models/Customer/CustomerModel.php index d1cffe3..768360e 100644 --- a/app/Models/Customer/CustomerModel.php +++ b/app/Models/Customer/CustomerModel.php @@ -6,6 +6,7 @@ use App\Models\CommonModel; abstract class CustomerModel extends CommonModel { + //true이면 모든 delete * 메소드 호출은 실제로 행을 삭제하는 것이 아니라 플래그를 데이터베이스로 설정 protected $useSoftDeletes = true; protected function __construct() diff --git a/app/Processors/Customer/ServiceV1Processor.php b/app/Processors/Customer/ServiceV1Processor.php index 0221943..778e104 100644 --- a/app/Processors/Customer/ServiceV1Processor.php +++ b/app/Processors/Customer/ServiceV1Processor.php @@ -58,7 +58,7 @@ class ServiceV1Processor { $this->db->transStart(); // 서버 변경이면 기존 서버 해지 - if ($entity->getServerInfoUID() !== null && $entity->getServerInfoUID() !== $formDatas['serverinfo_uid']) { + if ($entity->getServerInfoUID() !== null && $entity->getServerInfoUID() != $formDatas['serverinfo_uid']) { $this->serverService->detachFromService($entity->getServerInfoUID()); } // 1) 서비스 정보 수정 @@ -98,11 +98,11 @@ class ServiceV1Processor $this->paymentService->unlinkFromService($entity); } // 2) 연결된 모든 서버 해지 - foreach ($this->serverService->getEntities($entity->getPK()) as $serverEntity) { + foreach ($this->serverService->getEntities(['serviceinfo_uid' => $entity->getPK()]) as $serverEntity) { $this->serverService->detachFromService($serverEntity->getPK()); } // 3) 서비스 삭제 - $this->service->getModel()->delete($entity); + $this->service->getModel()->delete($entity->getPK()); // 4) 결제정보 반영(서비스번호,서버번호 Null처리) $this->paymentService->unlinkFromService($entity); // 4) 로그 diff --git a/app/Processors/Equipment/ServerPartV1Processor.php b/app/Processors/Equipment/ServerPartV1Processor.php index 0119840..b2668c0 100644 --- a/app/Processors/Equipment/ServerPartV1Processor.php +++ b/app/Processors/Equipment/ServerPartV1Processor.php @@ -117,7 +117,7 @@ class ServerPartV1Processor if (!$serverEntity instanceof ServerEntity) { throw new \Exception(__METHOD__ . "에서 오류발생: {$entity->getServerInfoUID()} 서버 정보를 찾을수 없습니다."); } - $this->service->getModel()->delete($entity); + $this->service->getModel()->delete($entity->getPK()); // 3) 과금정의 $this->service->setAmount($entity, "unlinkFromServerPart"); // 4) 로그 diff --git a/app/Processors/Equipment/ServerV1Processor.php b/app/Processors/Equipment/ServerV1Processor.php index 66f69fa..28a8a2f 100644 --- a/app/Processors/Equipment/ServerV1Processor.php +++ b/app/Processors/Equipment/ServerV1Processor.php @@ -122,9 +122,12 @@ class ServerV1Processor if ($entity->getIP()) { $this->ipService->detachFromServer($entity); } - // 3) 서버정보 삭제 + // 3) 서버파트 정보 해지 + $this->serverPartService->detachFromServer($entity); + // 4) 서버정보 삭제() $this->service->getModel()->delete($entity->getPK()); - // 4) 로그 + // dd($entity); + // 5) 로그 $this->logService->create(formDatas: [ 'title' => "{$entity->getTitle()} 서버 삭제", 'status' => $entity->getStatus(), diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index a7b49d0..2b6b916 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -165,8 +165,8 @@ class ServiceService extends CustomerService implements ServiceInterface //기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액 $amount = $entity->getRack() + $entity->getLine() + $calculatedServerAmount - $entity->getSale(); //결제정보 반영 - $this->getPaymentService()->$callBack($entity, $amount); - return $this->getModel()->modify($entity, ['amount' => $amount,]); + $paymentEntity = $this->getPaymentService()->$callBack($entity, $amount); + return $this->getModel()->modify($entity, ['amount' => $amount, 'payment_uid' => $paymentEntity->getPK()]); } //기본 기능부분 //FieldForm관련용 diff --git a/app/Services/Equipment/LineService.php b/app/Services/Equipment/LineService.php index fef7cb2..1f1b0af 100644 --- a/app/Services/Equipment/LineService.php +++ b/app/Services/Equipment/LineService.php @@ -51,11 +51,7 @@ class LineService extends EquipmentService $entity = parent::create_process($formDatas); //Prefixed IP to array 자동 등록 foreach ($this->getHelper()->cidrToIpRange($formDatas['bandwith']) as $ip) { - $this->getIPService()->create([ - 'lineinfo_uid' => $entity->getPK(), - 'ip' => $ip, - 'status' => STATUS['AVAILABLE'], - ]); + $this->getIPService()->attachToLine($entity, $ip); } return $entity; } diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php index ca8babc..030e8b7 100644 --- a/app/Services/Equipment/ServerPartService.php +++ b/app/Services/Equipment/ServerPartService.php @@ -4,9 +4,11 @@ namespace App\Services\Equipment; use App\Entities\Equipment\ServerEntity; use App\Entities\Equipment\ServerPartEntity; +use App\Entities\Part\PartEntity; use App\Helpers\Equipment\ServerPartHelper; use App\Interfaces\Equipment\ServerPartInterface; use App\Models\Equipment\ServerPartModel; +use App\Processors\Equipment\ServerPartV1Processor as Proceessor; use App\Services\Customer\ServiceService; use App\Services\Equipment\EquipmentService; use App\Services\Equipment\ServerService; @@ -18,7 +20,6 @@ use App\Services\Part\RAMService; use App\Services\Part\SOFTWAREService; use App\Services\Part\SWITCHService; use App\Services\PaymentService; -use App\Processors\Equipment\ServerPartV1Processor as Proceessor; class ServerPartService extends EquipmentService implements ServerPartInterface { @@ -219,8 +220,12 @@ class ServerPartService extends EquipmentService implements ServerPartInterface //해당 server_type의 정의된 상수값이 있으면 if (array_key_exists($serverEntity->getTitle(), SERVERPART[$parttype])) { foreach (SERVERPART[$parttype][$serverEntity->getTitle()] as $part) { - $partEntity = $this->getPartService($parttype)->getEntity($part['UID']); //해당 파트정보 가져오기 + $partEntity = $this->getPartService($parttype)->getEntity($part['UID']); + if (!$partEntity instanceof PartEntity) { + throw new \Exception(__METHOD__ . "에서 오류발생: {$part['UID']} 서버 정보를 찾을수 없습니다."); + } + //서버파트정보 생성 $formDatas = []; $formDatas['serverinfo_uid'] = $serverEntity->getPK(); $formDatas["part_uid"] = $partEntity->getPK(); @@ -230,19 +235,24 @@ class ServerPartService extends EquipmentService implements ServerPartInterface $formDatas['amount'] = $partEntity->getPrice(); //파트 금액 $formDatas['cnt'] = $part["CNT"]; $formDatas['extra'] = $part["EXTRA"]; - $this->create($formDatas); + $entity = $this->getModel()->create($formDatas); + $this->getPartService($entity->getTeyp())->attachToServerPart($entity); } } } } public function detachFromServer(ServerEntity $serverEntity): void { - //서버정보에 해당하는 ServerPart정보 모두 회수처리 후 서버정보에 기본 ServerPart를 다시 등록해준다. - foreach ($this->getEntities(['serverinfo_uid' => $serverEntity->getPK()]) as $entity) { - $this->delete($entity); + //서버정보에 해당하는 ServerPart정보 상태가 기본인것 제외한 모두 회수처리. + foreach ( + $this->getEntities([ + 'serverinfo_uid' => $serverEntity->getPK(), + "billing !=" => PAYMENT['BILLING']['BASE'] + ]) as $entity + ) { + $this->getPartService($entity->getType())->detachFromServerPart($entity); + $this->getModel()->delete($entity); } - //서버정보에 기본 ServerPart를 다시 등록해준다. - $this->attachToServer($serverEntity); } //기본 기능부분 // FieldForm관련용 diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 516e2a9..89562bc 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -184,7 +184,7 @@ class ServerService extends EquipmentService implements ServerInterface } return $caculatedAmount; } - //서비스금액관련처리 + //결제관련처리 public function setAmount(ServerEntity $entity): ServerEntity { if ($entity->getServiceInfoUID() === null) { @@ -199,30 +199,33 @@ class ServerService extends EquipmentService implements ServerInterface return $entity; } //Service관련 - public function attachToService(ServiceEntity $serviceEntity, string $serverinfo_uid, array $formDatas = []): ServerEntity + public function attachToService(ServiceEntity $serviceEntity, $serverinfo_uid, array $formDatas = []): ServerEntity { - $serverEntity = $this->getEntity($serverinfo_uid); - if (!$serverEntity instanceof ServerEntity) { + $entity = $this->getEntity($serverinfo_uid); + if (!$entity instanceof ServerEntity) { throw new \Exception("[{$serverinfo_uid}]에 대한 서버정보를 찾을 수 없습니다."); } $formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID(); $formDatas['serviceinfo_uid'] = $serviceEntity->getPK(); $formDatas['status'] = STATUS['OCCUPIED']; - return $this->getModel()->modify($serverEntity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } - public function detachFromService(string $serverinfo_uid): ServerEntity + public function detachFromService($serverinfo_uid): ServerEntity { - $serverEntity = $this->getEntity($serverinfo_uid); - if (!$serverEntity instanceof ServerEntity) { + $entity = $this->getEntity($serverinfo_uid); + if (!$entity instanceof ServerEntity) { throw new \Exception("[{$serverinfo_uid}]에 대한 서버정보를 찾을 수 없습니다."); } - return $this->getModel()->modify($serverEntity, [ + $entity = $this->getModel()->modify($entity, [ 'clientinfo_uid' => null, 'serviceinfo_uid' => null, 'format_at' => date("Y-m-d"), 'status' => STATUS['AVAILABLE'], ]); + //서버파트 삭제(기본제외) + $this->getServerPartService()->detachFromServer($entity); + return $entity; } //기본 기능부분 //FieldForm관련용 diff --git a/app/Services/Part/CSService.php b/app/Services/Part/CSService.php index 4d7d083..52df42a 100644 --- a/app/Services/Part/CSService.php +++ b/app/Services/Part/CSService.php @@ -117,7 +117,7 @@ class CSService extends PartService if ($entity->getStatus() !== STATUS['AVAILABLE']) { throw new \Exception(__METHOD__ . ":에서 오류발생: {$serverPartEntity->getTitle()}는 사용중입니다."); } - $entity = $this->modify($entity, $formDatas); + $entity = $this->getModel()->modify($entity, $formDatas); } return $entity; } @@ -137,6 +137,6 @@ class CSService extends PartService throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 CS정보를 찾을수없습니다."); } //CS정보 수정 - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } } diff --git a/app/Services/Part/DISKService.php b/app/Services/Part/DISKService.php index b825e0e..8347feb 100644 --- a/app/Services/Part/DISKService.php +++ b/app/Services/Part/DISKService.php @@ -67,6 +67,6 @@ class DISKService extends PartService if ($entity->getStock() < $serverPartEntity->getCnt()) { throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다."); } - return $this->modify($entity, ['format' => $entity->getFormat() + $serverPartEntity->getCnt()]); + return $this->getModel()->modify($entity, ['format' => $entity->getFormat() + $serverPartEntity->getCnt()]); } } diff --git a/app/Services/Part/IPService.php b/app/Services/Part/IPService.php index a663c9b..1e6ba8c 100644 --- a/app/Services/Part/IPService.php +++ b/app/Services/Part/IPService.php @@ -2,6 +2,7 @@ namespace App\Services\Part; +use App\Entities\Equipment\LineEntity; use App\Entities\Equipment\ServerEntity; use App\Entities\Equipment\ServerPartEntity; use App\Entities\Part\IPEntity; @@ -111,6 +112,16 @@ class IPService extends PartService implements IPInterface $this->getModel()->orderBy('INET_ATON(ip)', 'ASC'); parent::setOrderBy($field, $value); } + //회선 관련작업 + public function attachToLine(LineEntity $lineEntity, string $ip): IPEntity + { + $entity = $this->getModel()->create([ + 'lineinfo_uid' => $lineEntity->getPK(), + 'ip' => $ip, + 'status' => STATUS['AVAILABLE'], + ]); + return $entity; + } //서버관련 작업 public function attachToServer(ServerEntity $serverEntity, array $formDatas = []): IPEntity { @@ -127,7 +138,7 @@ class IPService extends PartService implements IPInterface if ($entity->getStatus() !== STATUS['AVAILABLE']) { throw new \Exception(__METHOD__ . ":에서 오류발생: {$serverEntity->getTitle()}는 사용중입니다."); } - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } public function detachFromServer(ServerEntity $serverEntity): IPEntity { @@ -143,7 +154,7 @@ class IPService extends PartService implements IPInterface throw new \Exception("{$serverEntity->getIP()}에 해당하는 IP정보를 찾을수없습니다."); } //IP정보 수정 - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } //서버파트관련 작업 public function attachToServerPart(ServerPartEntity $serverPartEntity): IPEntity @@ -159,7 +170,7 @@ class IPService extends PartService implements IPInterface if ($entity->getStatus() !== STATUS['AVAILABLE']) { throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다."); } - $entity = $this->modify($entity, $formDatas); + $entity = $this->getModel()->modify($entity, $formDatas); } return $entity; } @@ -177,6 +188,6 @@ class IPService extends PartService implements IPInterface throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다."); } //IP정보 수정 - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } } diff --git a/app/Services/Part/PartService.php b/app/Services/Part/PartService.php index 07da8dd..18ecdce 100644 --- a/app/Services/Part/PartService.php +++ b/app/Services/Part/PartService.php @@ -28,7 +28,7 @@ abstract class PartService extends CommonService implements PartInterface if ($entity->getStock() < $serverPartEntity->getCnt()) { throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다."); } - return $this->modify($entity, ['stock' => $entity->getStock() - $serverPartEntity->getCnt()]); + return $this->getModel()->modify($entity, ['stock' => $entity->getStock() - $serverPartEntity->getCnt()]); } public function detachFromServerPart(ServerPartEntity $serverPartEntity): mixed { @@ -41,6 +41,8 @@ abstract class PartService extends CommonService implements PartInterface if ($entity->getStock() < $serverPartEntity->getCnt()) { throw new \Exception("현재 재고수[{$entity->getStock()}]보다 지정하신 갯수({$serverPartEntity->getCnt()})가 더 많습니다."); } - return $this->modify($entity, ['stock' => $entity->getStock() + $serverPartEntity->getCnt()]); + $entity = $this->getModel()->modify($entity, ['stock' => $entity->getStock() + $serverPartEntity->getCnt()]); + // dd($entity); + return $entity; } } diff --git a/app/Services/Part/SWITCHService.php b/app/Services/Part/SWITCHService.php index 6028e52..0a974da 100644 --- a/app/Services/Part/SWITCHService.php +++ b/app/Services/Part/SWITCHService.php @@ -109,7 +109,7 @@ class SWITCHService extends PartService implements SWITCHInterface if ($entity->getStatus() !== STATUS['AVAILABLE']) { throw new \Exception(__METHOD__ . ":에서 오류발생: {$serverEntity->getTitle()}는 사용중입니다."); } - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } public function detachFromServer(ServerEntity $serverEntity): SWITCHEntity { @@ -128,7 +128,7 @@ class SWITCHService extends PartService implements SWITCHInterface throw new \Exception("{$serverEntity->getSwitch()}에 해당하는 Switch정보를 찾을수없습니다."); } //Switch정보 수정 - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } //서버파트관련 작업 public function attachToServerPart(ServerPartEntity $serverPartEntity): SWITCHEntity @@ -147,7 +147,7 @@ class SWITCHService extends PartService implements SWITCHInterface if ($entity->getStatus() !== STATUS['AVAILABLE']) { throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다."); } - $entity = $this->modify($entity, $formDatas); + $entity = $this->getModel()->modify($entity, $formDatas); } return $entity; } @@ -168,6 +168,6 @@ class SWITCHService extends PartService implements SWITCHInterface throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 Switch정보를 찾을수없습니다."); } //Switch정보 수정 - return $this->modify($entity, $formDatas); + return $this->getModel()->modify($entity, $formDatas); } } diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 7bdbd2c..e7d9fad 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -122,7 +122,7 @@ class PaymentService extends CommonService implements PaymentInterface return $unPaids; } //서비스생성 - public function createForService(ServiceEntity $serviceEntity): PaymentEntity + public function createForService(ServiceEntity $serviceEntity, int $amount): PaymentEntity { $billingAt = new DateTimeImmutable($serviceEntity->getBillingAt(), new DateTimeZone('Asia/Tokyo')); return $this->getModel()->create([ @@ -130,14 +130,15 @@ class PaymentService extends CommonService implements PaymentInterface 'serviceinfo_uid' => $serviceEntity->getPK(), 'serverinfo_uid' => $serviceEntity->getServerInfoUID(), //서버정보 번호 'title' => sprintf('[%s] %s 서비스비용', $serviceEntity->getTitle(), $billingAt->format('Y년 n월')), - 'amount' => $serviceEntity->getAmount(), + 'amount' => $amount, 'billing' => PAYMENT['BILLING']['MONTH'], 'billing_at' => $billingAt->format('Y-m-d'), ]); } //서비스수정 - public function updateForService(ServiceEntity $serviceEntity): PaymentEntity + public function updateForService(ServiceEntity $serviceEntity, int $amount): PaymentEntity { + // dd($serviceEntity); if ($serviceEntity->getPaymentUID() === null) { throw new \Exception(__METHOD__ . "에서 오류발생:서비스정보에 결제정보가 정의되지 않았습니다."); } @@ -151,7 +152,7 @@ class PaymentService extends CommonService implements PaymentInterface 'serviceinfo_uid' => $serviceEntity->getPK(), 'serverinfo_uid' => $serviceEntity->getServerInfoUID(), 'title' => sprintf('[%s] %s 서비스비용', $serviceEntity->getTitle(), $billingAt->format('Y년 n월')), - 'amount' => $serviceEntity->getAmount(), + 'amount' => $amount, 'billing' => PAYMENT['BILLING']['MONTH'], 'billing_at' => $billingAt->format('Y-m-d'), ]); @@ -187,14 +188,14 @@ class PaymentService extends CommonService implements PaymentInterface public function updateForServerPart(ServerPartEntity $serverPartEntity): PaymentEntity { if ($serverPartEntity->getPaymentUID() === null) { - throw new \Exception(__METHOD__ . "에서 오류발생:일회성서비스정보에 결제정보가 정의되지 않았습니다."); + throw new \Exception(__METHOD__ . "에서 오류발생:서비스파트정보에 일회성 결제정보가 정의되지 않았습니다."); } $entity = $this->getEntity($serverPartEntity->getPaymentUID()); if (!$entity instanceof PaymentEntity) { throw new \Exception(__METHOD__ . "에서 오류발생:결제정보를 찾을수 없습니다."); } if ($entity->getStatus() === STATUS['PAID']) { - throw new \Exception(__METHOD__ . "에서 오류발생:결제완료된 서비스는 수정할수 없습니다."); + throw new \Exception(__METHOD__ . "에서 오류발생:결제완료된 결제정보는 수정할수 없습니다."); } $formDatas = []; $formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID(); @@ -209,14 +210,14 @@ class PaymentService extends CommonService implements PaymentInterface public function unlinkFromServerPart(ServerPartEntity $serverPartEntity): PaymentEntity { if ($serverPartEntity->getPaymentUID() === null) { - throw new \Exception(__METHOD__ . "에서 오류발생:일회성서비스정보에 결제정보가 정의되지 않았습니다."); + throw new \Exception(__METHOD__ . "에서 오류발생:서비스파트정보에 일회성 결제정보가 정의되지 않았습니다."); } $entity = $this->getEntity($serverPartEntity->getPaymentUID()); if (!$entity instanceof PaymentEntity) { throw new \Exception(__METHOD__ . "에서 오류발생:결제정보를 찾을수 없습니다."); } if ($entity->getStatus() === STATUS['PAID']) { - throw new \Exception(__METHOD__ . "에서 오류발생:결제완료된 서비스는 수정할수 없습니다."); + throw new \Exception(__METHOD__ . "에서 오류발생:결제완료된 결제정보는 삭제할수 없습니다."); } //서비스해지시에는 고객정보로 서비스금액을 전환 서비스정보 NULL처리 return $this->getModel()->modify($entity, [