package com.devjob.notification.dto;

import com.devjob.notification.domain.Notification;
import com.devjob.notification.domain.NotificationStatus;
import java.time.LocalDateTime;

public record NotificationResponse(
        Long id,
        String recipientEmail,
        String subject,
        NotificationStatus status,
        LocalDateTime createdAt,
        LocalDateTime sentAt
) {
    public static NotificationResponse from(Notification n) {
        return new NotificationResponse(n.getId(), n.getRecipientEmail(), n.getSubject(), n.getStatus(), n.getCreatedAt(), n.getSentAt());
    }
}
