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:
@@ -4,7 +4,7 @@ import com.android.trisolarisserver.models.property.Property
|
||||
import jakarta.persistence.*
|
||||
import java.time.OffsetDateTime
|
||||
import java.util.UUID
|
||||
|
||||
//TODO:store signature image of guest
|
||||
@Entity
|
||||
@Table(
|
||||
name = "guest",
|
||||
|
||||
@@ -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
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.android.trisolarisserver.models.booking
|
||||
|
||||
enum class PaymentMethod {
|
||||
CASH,
|
||||
CARD,
|
||||
UPI,
|
||||
BANK,
|
||||
ONLINE
|
||||
}
|
||||
Reference in New Issue
Block a user