fix(can-coupon): 쿠폰 사용 본인인증 예외를 성인 노출 정책에 맞춘다
This commit is contained in:
@@ -8,6 +8,7 @@ import kr.co.vividnext.sodalive.common.SodaException
|
||||
import kr.co.vividnext.sodalive.i18n.LangContext
|
||||
import kr.co.vividnext.sodalive.i18n.SodaMessageSource
|
||||
import kr.co.vividnext.sodalive.member.MemberRepository
|
||||
import kr.co.vividnext.sodalive.member.contentpreference.MemberContentPreferenceService
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook
|
||||
import org.springframework.context.ApplicationEventPublisher
|
||||
import org.springframework.data.repository.findByIdOrNull
|
||||
@@ -29,6 +30,7 @@ class CanCouponService(
|
||||
private val couponNumberRepository: CanCouponNumberRepository,
|
||||
|
||||
private val memberRepository: MemberRepository,
|
||||
private val memberContentPreferenceService: MemberContentPreferenceService,
|
||||
|
||||
private val objectMapper: ObjectMapper,
|
||||
private val applicationEventPublisher: ApplicationEventPublisher,
|
||||
@@ -133,7 +135,8 @@ class CanCouponService(
|
||||
val member = memberRepository.findByIdOrNull(id = memberId)
|
||||
?: throw SodaException(messageKey = "common.error.bad_credentials")
|
||||
|
||||
if (member.auth == null) throw SodaException(messageKey = "can.coupon.auth_required")
|
||||
val viewerContentPreference = memberContentPreferenceService.getStoredPreference(member)
|
||||
if (!viewerContentPreference.isAdult) throw SodaException(messageKey = "can.coupon.auth_required")
|
||||
|
||||
issueService.validateAvailableUseCoupon(couponNumber, memberId)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user