-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Refactor/#351] WorkBookSubscriberWriter 책임 분리 리펙토링 #352
Conversation
/** 이메일 전송을 위한 데이터 조회 */ | ||
val memberEmailRecords = browseMemberEmailService.execute(memberIds) | ||
val workbooksMappedLastDayCol = browseWorkbookLastDayColService.execute(targetWorkBookIds) | ||
val memberReceiveArticles = | ||
browseMemberReceiveArticlesService.execute(targetWorkBookProgress) | ||
val articleContents = browseArticleContentsService.execute(memberReceiveArticles.getArticleIds()) |
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.
필요한 정보를 조회하는 과정은 browseXXXService로 분리하였습니다.
val emailServiceArgs = MailServiceArgsGenerator( | ||
LocalDate.now(), | ||
items, | ||
memberEmailRecords, | ||
memberReceiveArticles, | ||
articleContents | ||
).generate() |
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.
MailServiceArgsGenerator로 MailServiceArgs를 생성하도록 수정하였습니다.
/** 이메일 전송 결과에 따라 진행률 업데이트 및 구독 해지 처리를 위한 데이터 생성 */ | ||
val receiveLastDayRecords = | ||
ReceiveLastArticleRecordFilter(items, workbooksMappedLastDayCol).filter() | ||
.map { | ||
ReceiveLastArticleRecord(it.memberId, it.targetWorkBookId) | ||
} | ||
|
||
val receiveLastDayMemberIds = receiveLastDayMembers.map { | ||
it.memberId | ||
val updateTargetMemberRecords = UpdateProgressRecordFilter( | ||
items, | ||
mailSendRecorder.getSuccessMemberIds(), | ||
receiveLastDayRecords.getMemberIds() | ||
).filter().map { | ||
UpdateProgressRecord(it.memberId, it.targetWorkBookId, it.progress) |
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.
item에서 원하는 결과만 필터링하는 것ㅇ르 xxxFilter 클래스로 분리하였습니다.
val targetWorkBookId: Long, | ||
val progress: Long, | ||
) { | ||
val updatedProgress: Long = progress + 1 |
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.
해당 값의 경우 프로퍼티가 적절할 것 같아 프로퍼티로 구현하였습니다.
🎫 연관 이슈
resolved: #351
💁♂️ PR 내용
🙏 작업
🙈 PR 참고 사항
📸 스크린샷
🤖 테스트 체크리스트