package de.oaa.xxx.location.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Setter
@Entity
@Table(name = "location_inbox_lock",
       uniqueConstraints = @UniqueConstraint(columnNames = {"location_id", "visitor_id"}))
public class LocationInboxLockEntity {

    @Id
    @Column
    private UUID lockId;

    @Column(name = "location_id", nullable = false)
    private UUID locationId;

    /** Die kontaktierende Person */
    @Column(name = "visitor_id", nullable = false)
    private UUID visitorId;

    /** Der Admin/Inhaber, der gerade antwortet */
    @Column(name = "locked_by_user_id", nullable = false)
    private UUID lockedByUserId;

    /** Letzte Aktivität des Lock-Inhabers (wird bei jeder Antwort erneuert) */
    @Column(nullable = false)
    private LocalDateTime lockedAt;
}
