-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mail): change to send mail to members only #753
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8bbb2aa
feat: MailTargetResponse에 memberId 추가
woowabrie eb63290
feat: MailData와 MailHistory가 email 대신 memberId를 갖도록 변경
woowabrie 90b1bec
refactor: email 기반으로 MailTarget을 찾는 메서드는 사용하지 않아 삭제
woowabrie 4626bbb
feat: 메일 작성 폼에서 이메일 개별 입력 Input 삭제
woowabrie 62423b2
refactor: MailTarget의 id 기본 값 삭제
woowabrie d52dee7
feat: 보낸 메일 확인 시 탈퇴 회원의 수를 포함한 총 받는 사람 수 노출
woowabrie 81a6306
test: 회원 id 기반으로 MailTarget 조회 시 현재 회원인 수신자의 목록만 응답받는지 확인
woowabrie 4aaef87
chore: 현재 구현에서 고려하지 않을 todo 삭제
woowabrie bede24b
feat: 탈퇴한 회원의 경우 default 정보가 노출되는 정책 적용
woowabrie 0d9b4e9
refactor: AttributeConverter 추상화
woowabrie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -449,7 +449,7 @@ class DatabaseInitializer( | |
subject = "[우아한테크코스] 프리코스를 진행하는 목적과 사전 준비", | ||
body = "안녕하세요.", | ||
sender = "[email protected]", | ||
recipients = listOf("[email protected]", "[email protected]", "[email protected]", "[email protected]"), | ||
recipients = listOf(1L, 2L, 3L, 4L), | ||
sentTime = createLocalDateTime(2020, 11, 5, 10) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,14 @@ import java.time.LocalDateTime | |
private const val SUBJECT: String = "메일제목" | ||
private const val BODY: String = "메일 본문 입니다." | ||
private const val SENDER: String = "[email protected]" | ||
private val RECIPIENTS: List<String> = listOf("[email protected]", "[email protected]") | ||
private val RECIPIENTS: List<Long> = listOf(1L, 2L) | ||
private val SENT_TIME: LocalDateTime = LocalDateTime.now() | ||
|
||
fun createMailHistory( | ||
subject: String = SUBJECT, | ||
body: String = BODY, | ||
sender: String = SENDER, | ||
recipients: List<String> = RECIPIENTS, | ||
recipients: List<Long> = RECIPIENTS, | ||
sentTime: LocalDateTime = SENT_TIME, | ||
id: Long = 0L | ||
): MailHistory { | ||
|
@@ -25,7 +25,7 @@ fun createMailData( | |
subject: String = SUBJECT, | ||
body: String = BODY, | ||
sender: String = SENDER, | ||
recipients: List<String> = RECIPIENTS, | ||
recipients: List<Long> = RECIPIENTS, | ||
sentTime: LocalDateTime = SENT_TIME, | ||
id: Long = 0L | ||
): MailData { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import apply.domain.evaluationtarget.EvaluationStatus.PENDING | |
import apply.domain.evaluationtarget.EvaluationStatus.WAITING | ||
import apply.domain.evaluationtarget.EvaluationTargetRepository | ||
import apply.domain.member.MemberRepository | ||
import apply.domain.member.findAllByEmailIn | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.kotest.matchers.collections.shouldBeEmpty | ||
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder | ||
|
@@ -69,7 +68,7 @@ class MailTargetServiceTest : BehaviorSpec({ | |
|
||
Then("평가 대상자의 이름 및 이메일을 확인할 수 있다") { | ||
actual shouldHaveSize 1 | ||
actual[0] shouldBe MailTargetResponse(member.email, member.name) | ||
actual[0] shouldBe MailTargetResponse(member) | ||
} | ||
} | ||
} | ||
|
@@ -88,7 +87,7 @@ class MailTargetServiceTest : BehaviorSpec({ | |
|
||
Then("평가 대상자의 이름 및 이메일을 확인할 수 있다") { | ||
actual shouldHaveSize 1 | ||
actual[0] shouldBe MailTargetResponse(member.email, member.name) | ||
actual[0] shouldBe MailTargetResponse(member) | ||
} | ||
} | ||
} | ||
|
@@ -107,7 +106,7 @@ class MailTargetServiceTest : BehaviorSpec({ | |
|
||
Then("평가 대상자의 이름 및 이메일을 확인할 수 있다") { | ||
actual shouldHaveSize 1 | ||
actual[0] shouldBe MailTargetResponse(member.email, member.name) | ||
actual[0] shouldBe MailTargetResponse(member) | ||
} | ||
} | ||
} | ||
|
@@ -141,16 +140,21 @@ class MailTargetServiceTest : BehaviorSpec({ | |
} | ||
} | ||
|
||
Given("특정 이메일을 가진 회원이 없는 경우") { | ||
val email = "[email protected]" | ||
// TODO[#754]: 탈퇴한 회원의 경우 default 정보가 노출된다. | ||
Given("메일 이력을 통해 회원 id 목록을 확인할 수 있는 경우") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a: 탈퇴한 회원이 구분되지 않아 테스트 코드 수정이 필요해 보이네요. 병합 후 #754 에서 수정하면 될 것 같아요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이후 작업을 놓치지 않게 하기위해 아래 주석을 추가해뒀습니다.
|
||
val members = listOf( | ||
createMember(id = 1L), | ||
createMember(id = 2L), | ||
createMember(id = 3L) | ||
) | ||
|
||
every { memberRepository.findAllByEmailIn(any()) } returns emptyList() | ||
every { memberRepository.findAllById(any()) } returns members | ||
|
||
When("해당 이메일로 이메일 정보를 조회하면") { | ||
val actual = mailTargetService.findAllByEmails(listOf(email)) | ||
When("회원 id를 사용해 메일 수신자 정보를 조회하면") { | ||
val actual = mailTargetService.findAllByMemberIds(listOf(1L, 2L, 3L, 4L)) | ||
|
||
Then("이름이 비어있는 것을 확인할 수 있다") { | ||
actual[0] shouldBe MailTargetResponse(email, null) | ||
Then("현재 회원인 메일 수신자만 확인할 수 있다") { | ||
actual shouldHaveSize 3 | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,7 @@ class EvaluationTargetRestControllerTest : RestControllerTest() { | |
@EnumSource(names = ["PASS", "FAIL", "WAITING"]) | ||
@ParameterizedTest | ||
fun `메일 발송 대상(합격자)들의 이메일 정보를 조회한다`(enumStatus: EvaluationStatus) { | ||
val responses = listOf(MailTargetResponse("[email protected]", "김로키")) | ||
val responses = listOf(MailTargetResponse("[email protected]", "김로키", 1L)) | ||
every { mailTargetService.findMailTargets(any(), any()) } returns responses | ||
|
||
mockMvc.get("/api/recruitments/{recruitmentId}/evaluations/{evaluationId}/targets/emails", 1L, 1L) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a: IN 절과 관련하여 재밌는 내용이 있네요.