We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8f9eb6 commit f74f5e9Copy full SHA for f74f5e9
src/main/kotlin/site/billilge/api/backend/domain/rental/entity/RentalHistory.kt
@@ -31,7 +31,7 @@ class RentalHistory(
31
val rentAt: LocalDateTime,
32
33
@Column(name = "returned_at", nullable = true)
34
- val returnedAt: LocalDateTime? = null,
+ var returnedAt: LocalDateTime? = null,
35
36
@Column(name = "rented_count", nullable = false)
37
val rentedCount: Int,
@@ -54,6 +54,10 @@ class RentalHistory(
54
55
56
fun updateStatus(newStatus: RentalStatus) {
57
+ if (newStatus == RentalStatus.RETURNED) {
58
+ returnedAt = LocalDateTime.now()
59
+ }
60
+
61
this.rentalStatus = newStatus
62
}
63
0 commit comments