Skip to content

Commit f74f5e9

Browse files
committed
HOTFIX: 반납 시간이 기록되지 않던 현상 수정
1 parent f8f9eb6 commit f74f5e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/kotlin/site/billilge/api/backend/domain/rental/entity/RentalHistory.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RentalHistory(
3131
val rentAt: LocalDateTime,
3232

3333
@Column(name = "returned_at", nullable = true)
34-
val returnedAt: LocalDateTime? = null,
34+
var returnedAt: LocalDateTime? = null,
3535

3636
@Column(name = "rented_count", nullable = false)
3737
val rentedCount: Int,
@@ -54,6 +54,10 @@ class RentalHistory(
5454

5555

5656
fun updateStatus(newStatus: RentalStatus) {
57+
if (newStatus == RentalStatus.RETURNED) {
58+
returnedAt = LocalDateTime.now()
59+
}
60+
5761
this.rentalStatus = newStatus
5862
}
5963

0 commit comments

Comments
 (0)