-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
245 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ava/aplus/insurancesystem/domain/contract/dto/response/ContractCancelContentResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package aplus.insurancesystem.domain.contract.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Schema(description = "계약 해지 정보 Response") | ||
@AllArgsConstructor(access = lombok.AccessLevel.PRIVATE) | ||
public class ContractCancelContentResponse { | ||
private final String insuranceName; | ||
private final String customerName; | ||
private final String totalPremiumPaid; | ||
private final String refundAmount; | ||
|
||
public static ContractCancelContentResponse of(String insuranceName, String customerName, | ||
String totalPremiumPaid, String refundAmount) { | ||
return new ContractCancelContentResponse(insuranceName, customerName, totalPremiumPaid, refundAmount); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/aplus/insurancesystem/domain/contract/dto/response/ContractCancelResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package aplus.insurancesystem.domain.contract.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Schema(description = "계약 해지 Response") | ||
@AllArgsConstructor(access = lombok.AccessLevel.PRIVATE) | ||
public class ContractCancelResponse { | ||
@Schema(description = "이미 해지된 계약인지 여부") | ||
private final Boolean isAlreadyCancelled; | ||
|
||
public static ContractCancelResponse of(Boolean isAlreadyCancelled) { | ||
return new ContractCancelResponse(isAlreadyCancelled); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/aplus/insurancesystem/domain/contract/service/ContractQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package aplus.insurancesystem.domain.contract.service; | ||
|
||
public interface ContractQueryService { | ||
Integer getPremium(Long contractId); | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
src/main/java/aplus/insurancesystem/domain/contract/service/ContractQueryServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package aplus.insurancesystem.domain.contract.service; | ||
|
||
import aplus.insurancesystem.domain.contract.exception.ContractNotFoundException; | ||
import aplus.insurancesystem.domain.contract.repository.ContractRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class ContractQueryServiceImpl implements ContractQueryService { | ||
|
||
private final ContractRepository contractRepository; | ||
|
||
@Override | ||
public Integer getPremium(Long contractId) { | ||
return contractRepository.findById(contractId) | ||
.orElseThrow(ContractNotFoundException::new).getPremium(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/main/java/aplus/insurancesystem/domain/payment/service/PaymentService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package aplus.insurancesystem.domain.payment.service; | ||
|
||
import aplus.insurancesystem.domain.Insurance.entity.insurauceApplication.InsuranceApplication; | ||
import aplus.insurancesystem.domain.contract.entity.Contract; | ||
import aplus.insurancesystem.domain.payment.dto.PaymentInfoResponse; | ||
import aplus.insurancesystem.domain.payment.dto.PaymentUpdateResponse; | ||
import java.util.List; | ||
|
||
public interface PaymentService { | ||
// 납입 생성 | ||
|
||
void createPayment(Contract contract); | ||
List<PaymentInfoResponse> getPaymentList(Long contractId); | ||
|
||
Double getTotalPremiumPaid(Long contractId); | ||
PaymentUpdateResponse updatePayment(Long paymentId); | ||
} |
Oops, something went wrong.