Add rate plans, room stay rates, and payments ledger
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s

This commit is contained in:
androidlover5842
2026-01-29 04:56:37 +05:30
parent b6ac87d277
commit 71c70c8554
24 changed files with 902 additions and 4 deletions

View File

@@ -0,0 +1,47 @@
package com.android.trisolarisserver.models.booking
import com.android.trisolarisserver.models.property.AppUser
import com.android.trisolarisserver.models.property.Property
import jakarta.persistence.*
import java.time.OffsetDateTime
import java.util.UUID
@Entity
@Table(name = "payment")
class Payment(
@Id
@GeneratedValue
@Column(columnDefinition = "uuid")
val id: UUID? = null,
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "property_id", nullable = false)
var property: Property,
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "booking_id", nullable = false)
var booking: Booking,
@Column(name = "amount", nullable = false)
var amount: Long,
@Column(name = "currency", nullable = false)
var currency: String,
@Enumerated(EnumType.STRING)
@Column(name = "method", nullable = false)
var method: PaymentMethod,
@Column(name = "reference")
var reference: String? = null,
@Column(name = "notes")
var notes: String? = null,
@Column(name = "received_at", nullable = false, columnDefinition = "timestamptz")
var receivedAt: OffsetDateTime = OffsetDateTime.now(),
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "received_by")
var receivedBy: AppUser? = null
)