Skip to content

Commit

Permalink
feat: 회원가입 시 건설 노동자 카드 번호 필드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dgjinsu committed Jan 19, 2025
1 parent ca37776 commit d4a0a24
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/generated/jikgong/domain/member/entity/QWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class QWorker extends BeanPath<Worker> {

public final StringPath workerCardImgPath = createString("workerCardImgPath");

public final StringPath workerCardNumber = createString("workerCardNumber");

public final StringPath workerName = createString("workerName");

public final QWorkerNotificationInfo workerNotificationInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class JoinController {
private final JoinService joinService;

@Operation(summary = "회원 가입: 노동자")
@PostMapping(value = "/api/join/worker/join", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
@PostMapping(value = "/api/join/worker/join", consumes = {"multipart/form-data"})
public ResponseEntity<Response> joinWorkerMember(
@RequestPart(name = "request") @Valid JoinWorkerRequest request,
@RequestPart(name = "educationCertificateImage", required = false) MultipartFile educationCertificateImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public class JoinWorkerRequest {
@Schema(description = "은행 종류", example = "국민은행")
@NotBlank
private String bank; // 은행
@Schema(description = "건설 노동자 카드 번호", example = "null")
private String workerCardNumber;
@Schema(description = "비자 여부", example = "true")
@NotNull
private Boolean hasVisa; // 비자 여부
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/jikgong/domain/member/entity/Worker.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.time.LocalDate;
import jikgong.domain.member.dto.info.WorkerInfoRequest;
import jikgong.domain.member.dto.join.JoinWorkerRequest;
import jikgong.global.exception.ErrorCode;
import jikgong.global.exception.JikgongException;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -29,6 +31,7 @@ public class Worker {

private String educationCertificateImgPath; // 교육 증명서 이미지 경로
private String workerCardImgPath; // 근로자 카드 이미지 경로
private String workerCardNumber; // 근로자 카드 번호

private Boolean credentialLiabilityConsent; // 자격증명 법적 책임 동의 여부

Expand Down Expand Up @@ -81,8 +84,12 @@ public void updateEducationCertificateImgPath(String educationCertificateImgPath
this.educationCertificateImgPath = educationCertificateImgPath;
}

public void updateWorkerCardImgPath(String workerCardImgPath) {
public void updateWorkerCardImgPath(String workerCardImgPath, String workerCardNumber) {
if (workerCardImgPath == null || workerCardNumber == null) {
throw new JikgongException(ErrorCode.MEMBER_UPDATE_WORKER_CARD_FAIL);
}
this.workerCardImgPath = workerCardImgPath;
this.workerCardNumber = workerCardNumber;
}

public void updateVisaExpiryDate(LocalDate visaExpiryDate) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/jikgong/domain/member/service/JoinService.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public Long joinWorkerMember(JoinWorkerRequest request,
if (workerCardImage != null) {
ImageDto workerCardImagePath = s3Handler.uploadImageWithImgType(
workerCardImage, ImgType.WORKER_CARD);
worker.updateWorkerCardImgPath(workerCardImagePath.getS3Url());
worker.updateWorkerCardImgPath(
workerCardImagePath.getS3Url(), request.getWorkerCardNumber()
);
}

// 공통 부분
Expand Down
1 change: 1 addition & 0 deletions src/main/java/jikgong/global/exception/ErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum ErrorCode {
MEMBER_CONSENTS_NEED_TO_AGREE(HttpStatus.FORBIDDEN, "MEMBER-011", "회원가입을 위해선 각종 내용에 동의해야합니다."),
MEMBER_INVALID_AUTH_CODE(HttpStatus.BAD_REQUEST, "MEMBER-012", "인증 코드가 올바르지 않습니다."),
MEMBER_NOT_STAY_WITH_IN_THE_COUNTRY(HttpStatus.BAD_REQUEST, "MEMBER-013", "현재 체류 중인 외국인이 아닙니다."),
MEMBER_UPDATE_WORKER_CARD_FAIL(HttpStatus.BAD_REQUEST, "MEMBER-014", "노동자 카드 정보 업데이트에 실패했습니다."),

/**
* 알림
Expand Down

0 comments on commit d4a0a24

Please sign in to comment.