Skip to content

Commit

Permalink
Merge branch 'test' into suyeon
Browse files Browse the repository at this point in the history
  • Loading branch information
ibaesuyeon committed Dec 8, 2023
2 parents c72a00d + f2bc2c4 commit 87ce6b4
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import aplus.insurancesystem.common.dto.SuccessResponse;
import aplus.insurancesystem.domain.Insurance.dto.request.ApprovalInsuranceApplicationRequest;
import aplus.insurancesystem.domain.Insurance.dto.request.CreateInsuranceApplicationRequest;
import aplus.insurancesystem.domain.Insurance.dto.request.ApplyInsuranceRequest;
import aplus.insurancesystem.domain.Insurance.dto.request.RejectInsuranceApplicationRequest;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationDetailResponse;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationInfoResponse;
Expand Down Expand Up @@ -55,7 +55,7 @@ public class InsuranceApplicationController {
public ResponseEntity<Void> applyInsurance(
@Parameter(description = "보험 id", in = ParameterIn.PATH)
@PathVariable("id") Long insuranceId,
@ModelAttribute CreateInsuranceApplicationRequest request) {
@ModelAttribute ApplyInsuranceRequest request) {
insuranceApplicationService.applyInsurance(insuranceId, request);
return ResponseEntity.ok().build();
}
Expand All @@ -68,9 +68,9 @@ public ResponseEntity<Void> applyInsurance(
})
@GetMapping
public ResponseEntity<SuccessResponse<List<InsuranceApplicationInfoResponse>>>
getInsuranceApplicationList() {
getInsuranceApplicationInfoList() {
return SuccessResponse.of(
insuranceApplicationService.getInsuranceApplicationList()
insuranceApplicationService.getInsuranceApplicationInfoList()
).asHttp(HttpStatus.OK);
}

Expand All @@ -87,10 +87,10 @@ public ResponseEntity<Void> applyInsurance(
})
@GetMapping("/{id}/detail")
public ResponseEntity<SuccessResponse<InsuranceApplicationDetailResponse>>
getInsuranceApplication(@Parameter(description = "보험 신청 id", in = ParameterIn.PATH)
getInsuranceApplicationDetail(@Parameter(description = "보험 신청 id", in = ParameterIn.PATH)
@PathVariable("id") Long insuranceApplicationId) {
return SuccessResponse.of(
insuranceApplicationService.getInsuranceApplication(insuranceApplicationId)
insuranceApplicationService.getInsuranceApplicationDetail(insuranceApplicationId)
).asHttp(HttpStatus.OK);
}

Expand Down Expand Up @@ -183,7 +183,7 @@ public ResponseEntity<Void> rejectionInsuranceApplication(
})
@GetMapping("/{id}/result")
public ResponseEntity<SuccessResponse<InsuranceApplicationResultResponse>>
getInsuranceApplicationInfo(@Parameter(description = "보험 신청 id", in = ParameterIn.PATH)
getInsuranceApplicationResult(@Parameter(description = "보험 신청 id", in = ParameterIn.PATH)
@PathVariable("id") Long insuranceApplicationId) {
return SuccessResponse.of(
insuranceApplicationService.getInsuranceApplicationResult(insuranceApplicationId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public class InsuranceController {
content = @Content(schema = @Schema(hidden = true)))
})
@GetMapping("/{id}")
public ResponseEntity<SuccessResponse<InsuranceDetailResponse>> getInsurance(
public ResponseEntity<SuccessResponse<InsuranceDetailResponse>> getInsuranceDetail(
@Parameter(description = "보험 id", in = ParameterIn.PATH)
@PathVariable("id") Long insuranceId) {
return SuccessResponse.of(
insuranceService.getInsuranceInfo(insuranceId)
insuranceService.getInsuranceDetail(insuranceId)
).asHttp(HttpStatus.OK);
}

Expand All @@ -63,9 +63,9 @@ public ResponseEntity<SuccessResponse<InsuranceDetailResponse>> getInsurance(
description = "전체 보험 정보 list 반환(보험이 없다면 빈 리스트 반환)")
})
@GetMapping("/all")
public ResponseEntity<SuccessResponse<List<InsuranceDetailResponse>>> getInsuranceList() {
public ResponseEntity<SuccessResponse<List<InsuranceDetailResponse>>> getInsuranceDetailList() {
return SuccessResponse.of(
insuranceService.getInsuranceList()
insuranceService.getInsuranceDetailList()
).asHttp(HttpStatus.OK);
}

Expand All @@ -80,7 +80,7 @@ public ResponseEntity<SuccessResponse<List<InsuranceDetailResponse>>> getInsuran
content = @Content(schema = @Schema(hidden = true)))
})
@GetMapping("/{id}/terms")
public ResponseEntity<SuccessResponse<List<TermInfoResponse>>> getInsuranceTerms(
public ResponseEntity<SuccessResponse<List<TermInfoResponse>>> getInsuranceTermList(
@Parameter(description = "보험 id", in = ParameterIn.PATH)
@PathVariable("id") Long insuranceId) {
return SuccessResponse.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Getter
@Schema(description = "보험 신청 Request")
@RequiredArgsConstructor
public class CreateInsuranceApplicationRequest {
public class ApplyInsuranceRequest {

private final Long customerId;
private final PaymentCycle paymentCycle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

import org.springframework.core.io.InputStreamResource;

import aplus.insurancesystem.domain.Insurance.dto.request.CreateInsuranceApplicationRequest;
import aplus.insurancesystem.domain.Insurance.dto.request.ApplyInsuranceRequest;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationDetailResponse;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationInfoResponse;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationResultResponse;
import aplus.insurancesystem.domain.Insurance.dto.response.MyInsuranceApplicationResponse;

public interface InsuranceApplicationService {

void applyInsurance(Long insuranceId, CreateInsuranceApplicationRequest request);
void applyInsurance(Long insuranceId, ApplyInsuranceRequest request);

List<InsuranceApplicationInfoResponse> getInsuranceApplicationList();
List<InsuranceApplicationInfoResponse> getInsuranceApplicationInfoList();

InsuranceApplicationDetailResponse getInsuranceApplication(Long insuranceApplicationId);
InsuranceApplicationDetailResponse getInsuranceApplicationDetail(Long insuranceApplicationId);

InputStreamResource getSubscription(Long insuranceApplicationId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.springframework.web.multipart.MultipartFile;

import aplus.insurancesystem.common.service.FileService;
import aplus.insurancesystem.domain.Insurance.dto.request.CreateInsuranceApplicationRequest;
import aplus.insurancesystem.domain.Insurance.dto.request.ApplyInsuranceRequest;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationDetailResponse;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationInfoResponse;
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceApplicationResultResponse;
Expand Down Expand Up @@ -45,7 +45,7 @@ public class InsuranceApplicationServiceImpl implements InsuranceApplicationServ

@Override
@Transactional
public void applyInsurance(Long insuranceId, CreateInsuranceApplicationRequest request) {
public void applyInsurance(Long insuranceId, ApplyInsuranceRequest request) {
Insurance insurance = insuranceQueryService.getInsurance(insuranceId);
Customer customer = customerQueryService.getCustomer(request.getCustomerId());

Expand Down Expand Up @@ -74,18 +74,18 @@ public void applyInsurance(Long insuranceId, CreateInsuranceApplicationRequest r
}

@Override
public List<InsuranceApplicationInfoResponse> getInsuranceApplicationList() {
public List<InsuranceApplicationInfoResponse> getInsuranceApplicationInfoList() {
return insuranceApplicationRepository.findAll().stream()
.map(InsuranceApplicationInfoResponse::of)
.toList();
}

@Override
public InsuranceApplicationDetailResponse getInsuranceApplication(Long insuranceApplicationId) {
public InsuranceApplicationDetailResponse getInsuranceApplicationDetail(Long insuranceApplicationId) {
InsuranceApplication insuranceApplication =
insuranceApplicationQueryService.getInsurance(insuranceApplicationId);
List<FamilyHistory> familyHistories =
familyHistoryService.getFamilyHistories(insuranceApplication.getCustomer());
familyHistoryService.getFamilyHistoryList(insuranceApplication.getCustomer());
return InsuranceApplicationDetailResponse.of(insuranceApplication, familyHistories);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import aplus.insurancesystem.domain.Insurance.dto.response.InsuranceDetailResponse;

public interface InsuranceService {
InsuranceDetailResponse getInsuranceInfo(Long insuranceId);
List<InsuranceDetailResponse> getInsuranceList();
InsuranceDetailResponse getInsuranceDetail(Long insuranceId);
List<InsuranceDetailResponse> getInsuranceDetailList();
void designInsurance(DesignInsuranceRequest request);

void updateInsurance(Long insuranceId, UpdateInsuranceRequest request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public class InsuranceServiceImpl implements InsuranceService {
private final TermsQueryService termsQueryService;

@Override
public InsuranceDetailResponse getInsuranceInfo(Long insuranceId) {
public InsuranceDetailResponse getInsuranceDetail(Long insuranceId) {
return insuranceRepository.findById(insuranceId)
.map(InsuranceDetailResponse::of)
.orElseThrow(InsuranceNotFoundException::new);
}

@Override
public List<InsuranceDetailResponse> getInsuranceList() {
public List<InsuranceDetailResponse> getInsuranceDetailList() {
return insuranceRepository.findAllWithGuarantees()
.stream()
.map(InsuranceDetailResponse::of)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package aplus.insurancesystem.domain.compensationClaim.controller;

import aplus.insurancesystem.common.dto.SuccessResponse;
import aplus.insurancesystem.domain.Insurance.dto.request.CreateInsuranceApplicationRequest;
import aplus.insurancesystem.domain.compensationClaim.dto.request.CreateCarAccidentRequest;
import aplus.insurancesystem.domain.compensationClaim.dto.request.CreateCompensationClaimRequest;
import aplus.insurancesystem.domain.compensationClaim.dto.request.CreateSurveyRequest;
import aplus.insurancesystem.domain.compensationClaim.dto.request.UpdateSurveyRequest;
import aplus.insurancesystem.domain.compensationClaim.dto.response.CarAccidentResponse;
import aplus.insurancesystem.domain.compensationClaim.dto.response.CompensationClaimResponse;
import aplus.insurancesystem.domain.compensationClaim.dto.response.SurveyResponse;
import aplus.insurancesystem.domain.compensationClaim.service.CompensationClaimService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class CustomerController {
content = @Content(schema = @Schema(hidden = true)))
})
@GetMapping("/{id}")
public ResponseEntity<SuccessResponse<CustomerInfoResponse>> getCustomer(
public ResponseEntity<SuccessResponse<CustomerInfoResponse>> getCustomerInfo(
@Parameter(description = "고객 id", in = ParameterIn.PATH)
@PathVariable("id") Long customerId) {
return SuccessResponse.of(
Expand All @@ -68,9 +68,9 @@ public ResponseEntity<SuccessResponse<CustomerInfoResponse>> getCustomer(
description = "고객 정보 전체 반환(고객이 없다면 빈 리스트 반환)")
})
@GetMapping("/all")
public ResponseEntity<SuccessResponse<List<CustomerAllInfoResponse>>> getCustomerList() {
public ResponseEntity<SuccessResponse<List<CustomerAllInfoResponse>>> getCustomerAllInfoList() {
return SuccessResponse.of(
customerService.getCustomerList()
customerService.getCustomerAllInfoList()
).asHttp(HttpStatus.OK);
}

Expand All @@ -85,7 +85,7 @@ public ResponseEntity<SuccessResponse<List<CustomerAllInfoResponse>>> getCustome
content = @Content(schema = @Schema(hidden = true)))
})
@GetMapping("/{id}/all")
public ResponseEntity<SuccessResponse<CustomerAllInfoResponse>> getCustomerList(
public ResponseEntity<SuccessResponse<CustomerAllInfoResponse>> getCustomerAllInfo(
@Parameter(description = "고객 id", in = ParameterIn.PATH)
@PathVariable("id") Long customerId
) {
Expand Down Expand Up @@ -181,11 +181,11 @@ public ResponseEntity<SuccessResponse<CustomerIdResponse>> validateCustomer(
content = @Content(schema = @Schema(hidden = true)))
})
@GetMapping("/{id}/families")
public ResponseEntity<SuccessResponse<List<FamilyHistoryInfoResponse>>> getFamilyHistories(
public ResponseEntity<SuccessResponse<List<FamilyHistoryInfoResponse>>> getFamilyHistoryList(
@Parameter(description = "고객 id", in = ParameterIn.PATH)
@PathVariable("id") Long customerId) {
return SuccessResponse.of(
familyHistoryService.getFamilyHistories(customerId)
familyHistoryService.getFamilyHistoryList(customerId)
).asHttp(HttpStatus.OK);
}

Expand All @@ -197,11 +197,11 @@ public ResponseEntity<SuccessResponse<List<FamilyHistoryInfoResponse>>> getFamil
description = "고객 가족력 반환")
})
@GetMapping("/contract-maintenance")
public ResponseEntity<SuccessResponse<List<CustomerAllInfoResponse>>> getContractMaintenanceCustomers(
public ResponseEntity<SuccessResponse<List<CustomerAllInfoResponse>>> getContractMaintenanceCustomerList(
@Parameter(description = "계약 유지 대상자 타입", in = ParameterIn.QUERY)
@RequestParam TargetType targetType) {
return SuccessResponse.of(
customerService.getContractMaintenanceCustomers(targetType)
customerService.getContractMaintenanceCustomerList(targetType)
).asHttp(HttpStatus.OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public interface CustomerService {

CustomerAllInfoResponse getCustomerAllInfo(Long customerId);

List<CustomerAllInfoResponse> getContractMaintenanceCustomers(TargetType targetType);
List<CustomerAllInfoResponse> getContractMaintenanceCustomerList(TargetType targetType);

void join(JoinRequest request);

Boolean isAdmin(Long customerId);

Boolean validateLoginId(String customerId);

List<CustomerAllInfoResponse> getCustomerList();
List<CustomerAllInfoResponse> getCustomerAllInfoList();

void setAdmin(Long customerId, boolean setAdmin);
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public CustomerDetailResponse getCustomerDetail(Long customerId) {
Customer customer = customerQueryService.getCustomer(customerId);
return CustomerDetailResponse.of(
customer,
familyHistoryService.getFamilyHistories(customer),
familyHistoryService.getFamilyHistoryList(customer),
contractService.getContracts(customer)
);
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public CustomerAllInfoResponse getCustomerAllInfo(Long customerId) {
}

@Override
public List<CustomerAllInfoResponse> getContractMaintenanceCustomers(TargetType targetType) {
public List<CustomerAllInfoResponse> getContractMaintenanceCustomerList(TargetType targetType) {
return targetType.applyFunction(customerRepository)
.stream()
.map(CustomerAllInfoResponse::of)
Expand Down Expand Up @@ -121,7 +121,7 @@ public Boolean validateLoginId(String loginId) {
}

@Override
public List<CustomerAllInfoResponse> getCustomerList() {
public List<CustomerAllInfoResponse> getCustomerAllInfoList() {
return customerRepository.findAll()
.stream()
.map(CustomerAllInfoResponse::of)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import aplus.insurancesystem.domain.customer.entity.customer.Customer;

public interface FamilyHistoryService {
List<FamilyHistory> getFamilyHistories(Customer customer);
List<FamilyHistory> getFamilyHistoryList(Customer customer);

List<FamilyHistoryInfoResponse> getFamilyHistories(Long customerId);
List<FamilyHistoryInfoResponse> getFamilyHistoryList(Long customerId);

void createFamilyHistory(Customer customer, CreateFamilyHistoryRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public class FamilyHistoryServiceImpl implements FamilyHistoryService{
private final CustomerQueryService customerQueryService;

@Override
public List<FamilyHistory> getFamilyHistories(Customer customer) {
public List<FamilyHistory> getFamilyHistoryList(Customer customer) {
return familyHistoryRepository.findAllByCustomer(customer);
}

@Override
public List<FamilyHistoryInfoResponse> getFamilyHistories(Long customerId) {
public List<FamilyHistoryInfoResponse> getFamilyHistoryList(Long customerId) {
return familyHistoryRepository.findAllByCustomer(customerQueryService.getCustomer(customerId))
.stream()
.map(FamilyHistoryInfoResponse::of)
Expand Down

0 comments on commit 87ce6b4

Please sign in to comment.