package ru.vyatsu.qr_access_admin.rent.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.SourceType;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

@Table(name = "rents")
@Entity
@Getter
@Setter
public class RentEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private String id;

    @Column
    private LocalTime startTime;

    @Column
    private LocalTime endTime;

    @Column
    private String clientId;

    @Column
    private LocalDate date;

    @Column
    private String doorId;

    @Column
    private String qrCode;

    @Column
    private Boolean payed;

    @Column
    @CreationTimestamp(source = SourceType.DB)
    private LocalDateTime dateCreated;
}
