Skip to content

Commit

Permalink
fix: 발송 옵션 미설정시 id 자동 설정 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
623nana committed Aug 21, 2021
1 parent be822d6 commit c50d4a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/com/nexters/covid/letter/domain/Letter.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Letter(LetterRequest request, User user) {
this.state = State.PENDING;
this.sticker = request.getSticker();
this.questionId = request.getQuestionId();
this.sendOptionId = request.getSendOptionId();
this.sendOptionId = markLetterSendOptionId(request.getSendOptionId());
this.encryptedId = generateEncryptedId();
}

Expand All @@ -83,4 +83,11 @@ public void updateLetterState() {
public String decodeContents() {
return new String(decodeBase64(this.contents));
}

public Long markLetterSendOptionId(Long sendOptionId) {
if (sendOptionId == null) {
return 7L;
}
return sendOptionId;
}
}

0 comments on commit c50d4a7

Please sign in to comment.