Add charge ledger for booking commissions
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
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 = "charge")
|
||||
class Charge(
|
||||
@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,
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type", nullable = false)
|
||||
var type: ChargeType,
|
||||
|
||||
@Column(name = "amount", nullable = false)
|
||||
var amount: Long,
|
||||
|
||||
@Column(name = "currency", nullable = false)
|
||||
var currency: String,
|
||||
|
||||
@Column(name = "notes")
|
||||
var notes: String? = null,
|
||||
|
||||
@Column(name = "occurred_at", nullable = false, columnDefinition = "timestamptz")
|
||||
var occurredAt: OffsetDateTime = OffsetDateTime.now(),
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "created_by")
|
||||
var createdBy: AppUser? = null
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.android.trisolarisserver.models.booking
|
||||
|
||||
enum class ChargeType {
|
||||
COMMISSION
|
||||
}
|
||||
Reference in New Issue
Block a user