package com.smartoffice.notification;

import java.time.Instant;

public record NotificationDto(
        Long id,
        NotificationType type,
        String title,
        String content,
        Instant readAt,
        Instant createdAt
) {
    public static NotificationDto from(Notification notification) {
        return new NotificationDto(
                notification.getId(),
                notification.getType(),
                notification.getTitle(),
                notification.getContent(),
                notification.getReadAt(),
                notification.getCreatedAt()
        );
    }
}
