package com.zioinfo.mes.admin.dto;

import com.zioinfo.mes.auth.MesUser;
import lombok.Data;

import java.time.LocalDateTime;

/** 사용자 응답 DTO — password_hash 노출 차단. */
@Data
public class UserDto {
    private Long id;
    private String username;
    private String displayName;
    private String role;
    private boolean active;
    private LocalDateTime createdAt;

    public static UserDto from(MesUser u) {
        UserDto d = new UserDto();
        d.id = u.getId();
        d.username = u.getUsername();
        d.displayName = u.getDisplayName();
        d.role = u.getRole();
        d.active = u.isActive();
        d.createdAt = u.getCreatedAt();
        return d;
    }
}
