Skip to content

Commit

Permalink
fix: 초대코드 인증 정보를 저장할 때 status도 저장한다. (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarltj authored Jan 22, 2024
1 parent 67f3c3f commit 5b3552b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ public class InvitationCodeCertification {
@Column(name = "updated_at")
private ZonedDateTime updatedAt;

public static InvitationCodeCertification of(Long userId, Long agencyId) {
public static InvitationCodeCertification of(Long userId, Long agencyId, CertificationStatus status) {
return InvitationCodeCertification.builder()
.userId(userId)
.agencyId(agencyId)
.status(status)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.moneymong.domain.invitationcode.api.request.CertifyInvitationCodeRequest;
import com.moneymong.domain.invitationcode.api.response.CertifyInvitationCodeResponse;
import com.moneymong.domain.invitationcode.api.response.InvitationCodeResponse;
import com.moneymong.domain.invitationcode.entity.CertificationStatus;
import com.moneymong.domain.invitationcode.entity.InvitationCode;
import com.moneymong.domain.invitationcode.entity.InvitationCodeCertification;
import com.moneymong.domain.invitationcode.repository.InvitationCodeCertificationRepository;
Expand Down Expand Up @@ -69,7 +70,7 @@ public CertifyInvitationCodeResponse certify(CertifyInvitationCodeRequest reques

private InvitationCodeCertification getCertification(Long userId, Long agencyId) {
return invitationCodeCertificationRepository.findByUserIdAndAgencyId(userId, agencyId)
.orElseGet(() -> InvitationCodeCertification.of(userId, agencyId));
.orElseGet(() -> InvitationCodeCertification.of(userId, agencyId, CertificationStatus.DONE));
}

private AgencyUser getAgencyUser(Long userId, Long agencyId) {
Expand Down

0 comments on commit 5b3552b

Please sign in to comment.