Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ public record OcrPassportResponse(
@Schema(description = "Full Name", example = "Hong Seungwon")
String fullName,

@Schema(description = "국가", example = "AFGHANISTAN")
Country country,
@Schema(description = "국가 코드 및 라벨", example = "{\"code\": \"south-korea\", \"label\": \"South Korea\"}")
LocalizedItemResponse country,

@Schema(description = "생년월일")
LocalDate birthDate
) {
public static OcrPassportResponse from(PassportOcrParser.PassportInfo passportInfo) {
Country country = passportInfo.country();
return OcrPassportResponse.builder()
.fullName(passportInfo.fullName())
.country(passportInfo.country())
.country(country != null ? new LocalizedItemResponse(country.getCode(), country.getCountryName()) : null)
.birthDate(passportInfo.birthDate())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ public enum Country {
country -> country.countryName.toLowerCase(),
Function.identity()));

public String getCode() {
return name().toLowerCase().replace("_", "-");
}

public static List<String> getCountries() {
return Arrays.stream(Country.values())
.map(Country::getCountryName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ public void agreeTerms(Long memberId, MemberTermsRequest request) {
public MemberCompletionResponse getCompletion(Long memberId){
Member member = getById(memberId);

MemberVisa memberVisa = memberVisaRepository.findActiveByMemberId(memberId)
.orElseThrow(() -> new MemberException(MemberErrorCode.VISA_NOT_FOUND));

boolean onboardingRequired = member.getStatus().equals(MemberStatus.PENDING);
boolean agreedTerm = memberTermRepository.existsByMemberIdAndAgreedTrue(memberId);

Expand Down
Loading