fix: 포인트 지급 요소 계산시 정책 시작 날짜 이후의 유저 행동들만 반영하도록 수정
This commit is contained in:
parent
0f48c71837
commit
fe84292483
|
@ -54,11 +54,13 @@ class UserActionService(
|
|||
todayAt15
|
||||
}
|
||||
|
||||
val isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate =
|
||||
policyType == PolicyType.DAILY && policyTypeDailyStartDate >= policy.startDate
|
||||
val order = if (contentId != null) {
|
||||
orderRepository.findByMemberIdAndContentId(
|
||||
memberId = memberId,
|
||||
contentId = contentId,
|
||||
createdAt = if (policyType == PolicyType.DAILY) {
|
||||
createdAt = if (isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate) {
|
||||
policyTypeDailyStartDate
|
||||
} else {
|
||||
policy.startDate
|
||||
|
@ -72,7 +74,7 @@ class UserActionService(
|
|||
val actionCount = repository.countByMemberIdAndActionTypeAndCreatedAtBetween(
|
||||
memberId = memberId,
|
||||
actionType = actionType,
|
||||
startDate = if (policyType == PolicyType.DAILY) {
|
||||
startDate = if (isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate) {
|
||||
policyTypeDailyStartDate
|
||||
} else {
|
||||
policy.startDate
|
||||
|
@ -84,7 +86,7 @@ class UserActionService(
|
|||
val grantedCount = grantLogRepository.countByMemberIdAndPolicyIdAndStartDate(
|
||||
memberId,
|
||||
policy.id!!,
|
||||
startDate = if (policyType == PolicyType.DAILY) {
|
||||
startDate = if (isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate) {
|
||||
policyTypeDailyStartDate
|
||||
} else {
|
||||
policy.startDate
|
||||
|
|
Loading…
Reference in New Issue