package com.smartoffice.user;

import java.time.Instant;

public record UserDto(
        Long id,
        String username,
        String fullName,
        String email,
        String phone,
        Role role,
        UserStatus status,
        Instant lastLoginAt
) {
    public static UserDto from(User user) {
        return new UserDto(
                user.getId(),
                user.getUsername(),
                user.getFullName(),
                user.getEmail(),
                user.getPhone(),
                user.getRole(),
                user.getStatus(),
                user.getLastLoginAt()
        );
    }
}
