Add charge ledger for booking commissions
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-01-29 07:38:22 +05:30
parent a1db58ec95
commit e61393fc41
5 changed files with 187 additions and 0 deletions

View File

@@ -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
)

View File

@@ -0,0 +1,5 @@
package com.android.trisolarisserver.models.booking
enum class ChargeType {
COMMISSION
}