fix: 포인트 사용내역

- 포인트를 어디에 사용했는지 알기 위해 포인트 사용내역 저장시 orderId 추가
This commit is contained in:
2025-05-19 20:49:16 +09:00
parent 36b8e8169e
commit 56542a7bf1
3 changed files with 5 additions and 4 deletions

View File

@@ -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