Skip to content

Commit

Permalink
[Fix/#338] 구독 학습지 마지막 아티클을 받고 progess를 증가하는 문제해결 (#339)
Browse files Browse the repository at this point in the history
* fix: 구독 학습지 마지막 아티클을 받고 progess를 증가하는 문제해결

* fix: WorkBookSubscriberWriterTest Disabled 처리
  • Loading branch information
belljun3395 authored Aug 11, 2024
1 parent 3245017 commit 71a2094
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,16 @@ class WorkBookSubscriberWriter(
(it.progress.toInt() + 1) == lastDayCol[it.targetWorkBookId]
}.map {
ReceiveLastDayMember(it.memberId, it.targetWorkBookId)
}.filter {
memberSuccessRecords[it.memberId] == true
}

val receiveLastDayMemberIds = receiveLastDayMembers.map {
it.memberId
}

/** 이메일 전송에 성공한 구독자들의 진행률을 업데이트한다.*/
val successMemberIds = memberSuccessRecords.filter { it.value }.keys
val updateTargetMemberRecords = items.filter { it.memberId in successMemberIds }
val updateTargetMemberRecords = items.filter { it.memberId in successMemberIds }.filterNot { it.memberId in receiveLastDayMemberIds }

val updateQueries = mutableListOf<UpdateConditionStep<*>>()
for (updateTargetMemberRecord in updateTargetMemberRecords) {
updateQueries.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import jooq.jooq_dsl.tables.Subscription
import org.jooq.DSLContext
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.mockito.Mockito.*
import org.springframework.beans.factory.annotation.Autowired
import kotlin.random.Random

@Disabled
class WorkBookSubscriberWriterTest : BatchTestSpec() {

@Autowired
Expand Down

0 comments on commit 71a2094

Please sign in to comment.