fix: 포인트 사용내역
- 포인트를 어디에 사용했는지 알기 위해 포인트 사용내역 저장시 orderId 추가
This commit is contained in:
@@ -8,7 +8,7 @@ class PointUsageService(
|
||||
private val memberPointRepository: MemberPointRepository,
|
||||
private val usePointRepository: UsePointRepository
|
||||
) {
|
||||
fun usePoint(memberId: Long, contentPrice: Int): Int {
|
||||
fun usePoint(memberId: Long, contentPrice: Int, orderId: Long?): Int {
|
||||
val now = LocalDateTime.now()
|
||||
val maxUsablePoint = contentPrice * 10
|
||||
|
||||
@@ -33,7 +33,7 @@ class PointUsageService(
|
||||
|
||||
if (used > 0) {
|
||||
memberPointRepository.saveAll(points)
|
||||
usePointRepository.save(UsePoint(memberId = memberId, amount = used))
|
||||
usePointRepository.save(UsePoint(memberId = memberId, amount = used, orderId = orderId))
|
||||
}
|
||||
|
||||
return used
|
||||
|
Reference in New Issue
Block a user