package pl.polskalokalnie.notification;

import java.time.Instant;

public record NotificationResponse(
        Long id,
        String category,
        String icon,
        String title,
        String body,
        String link,
        boolean read,
        Instant createdAt
) {
    public static NotificationResponse from(Notification n) {
        return new NotificationResponse(
                n.getId(),
                n.getCategory(),
                n.getIcon(),
                n.getTitle(),
                n.getBody(),
                n.getLink(),
                n.isRead(),
                n.getCreatedAt()
        );
    }
}
