add booking flow

This commit is contained in:
androidlover5842
2026-01-24 22:58:54 +05:30
parent 72d9f5bb12
commit 57ca477c08
6 changed files with 466 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package com.android.trisolarisserver.models.room
import com.android.trisolarisserver.models.property.Property
import jakarta.persistence.*
import java.time.OffsetDateTime
import java.util.UUID
@Entity
@Table(
name = "room_stay_change",
uniqueConstraints = [UniqueConstraint(columnNames = ["room_stay_id", "idempotency_key"])]
)
class RoomStayChange(
@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 = "room_stay_id", nullable = false)
var roomStay: RoomStay,
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "new_room_stay_id", nullable = false)
var newRoomStay: RoomStay,
@Column(name = "idempotency_key", nullable = false)
var idempotencyKey: String,
@Column(name = "created_at", nullable = false, columnDefinition = "timestamptz")
val createdAt: OffsetDateTime = OffsetDateTime.now()
)