test #316
|
@ -54,11 +54,13 @@ class UserActionService(
|
||||||
todayAt15
|
todayAt15
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate =
|
||||||
|
policyType == PolicyType.DAILY && policyTypeDailyStartDate >= policy.startDate
|
||||||
val order = if (contentId != null) {
|
val order = if (contentId != null) {
|
||||||
orderRepository.findByMemberIdAndContentId(
|
orderRepository.findByMemberIdAndContentId(
|
||||||
memberId = memberId,
|
memberId = memberId,
|
||||||
contentId = contentId,
|
contentId = contentId,
|
||||||
createdAt = if (policyType == PolicyType.DAILY) {
|
createdAt = if (isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate) {
|
||||||
policyTypeDailyStartDate
|
policyTypeDailyStartDate
|
||||||
} else {
|
} else {
|
||||||
policy.startDate
|
policy.startDate
|
||||||
|
@ -72,7 +74,7 @@ class UserActionService(
|
||||||
val actionCount = repository.countByMemberIdAndActionTypeAndCreatedAtBetween(
|
val actionCount = repository.countByMemberIdAndActionTypeAndCreatedAtBetween(
|
||||||
memberId = memberId,
|
memberId = memberId,
|
||||||
actionType = actionType,
|
actionType = actionType,
|
||||||
startDate = if (policyType == PolicyType.DAILY) {
|
startDate = if (isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate) {
|
||||||
policyTypeDailyStartDate
|
policyTypeDailyStartDate
|
||||||
} else {
|
} else {
|
||||||
policy.startDate
|
policy.startDate
|
||||||
|
@ -84,7 +86,7 @@ class UserActionService(
|
||||||
val grantedCount = grantLogRepository.countByMemberIdAndPolicyIdAndStartDate(
|
val grantedCount = grantLogRepository.countByMemberIdAndPolicyIdAndStartDate(
|
||||||
memberId,
|
memberId,
|
||||||
policy.id!!,
|
policy.id!!,
|
||||||
startDate = if (policyType == PolicyType.DAILY) {
|
startDate = if (isValidPolicyTypeDailyAndDailyStartDateAfterPolicyStartDate) {
|
||||||
policyTypeDailyStartDate
|
policyTypeDailyStartDate
|
||||||
} else {
|
} else {
|
||||||
policy.startDate
|
policy.startDate
|
||||||
|
|
Loading…
Reference in New Issue