package com.example.nto.mapper;

import com.example.nto.model.dto.EmployeeDTO;
import com.example.nto.model.entity.Employee;
import org.springframework.stereotype.Component;

@Component
public class EmployeeDTOMapper {
    public EmployeeDTO map (final Employee employee) {
        return EmployeeDTO.builder()
                .name(employee.getName())
                .login(employee.getLogin())
                .photo(employee.getPhoto())
                .position(employee.getPosition())
                .lastVisit(employee.getLastVisit())
                .role(employee.getRole())
                .isBanned(employee.getIsBanned())
                .build();
    }
}
