package ru.kayashov.bar.controller.dto;

import lombok.Getter;
import lombok.Setter;
import ru.kayashov.bar.model.entity.Visitor;

@Getter
@Setter
public class VisitorResponseDto {

    private Long id;
    private String name;
    private String lastName;
    private Boolean invited;
    private Boolean isActive;
    private String role;

    public static VisitorResponseDto mapToDto(Visitor e) {
        VisitorResponseDto d = new VisitorResponseDto();

        d.setId(e.getId());
        d.setName(e.getName());
        d.setLastName(e.getLastName());
//        d.setInvited(e.getInvited());
//        d.setRole(e.getRole().toString());

        return d;
    }

    public static VisitorResponseDto mapToDto(Visitor e, Boolean invited, String role, Boolean isActive) {
        VisitorResponseDto d = mapToDto(e);
        d.setInvited(invited);
        d.setRole(role);
        d.setIsActive(isActive);
        return d;
    }
}
