package ru.kayashov.bar.model.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import static ru.kayashov.bar.model.entity.UserRole.USER;

@Entity
@Getter
@Setter
public class BarResident {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne
    private Visitor visitor;

    @ManyToOne
    private BarEntity bar;

    private Boolean invited = true;
    private Boolean active = true;

    @Enumerated(value = EnumType.STRING)
    private UserRole role = USER;
}
