Add rate plans, room stay rates, and payments ledger
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
This commit is contained in:
@@ -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
|
||||
)
|
||||
Reference in New Issue
Block a user