import { getLogger } from '../utils/logger.js';
export class NotificationService {
    notificationRepo;
    logger = getLogger();
    constructor(notificationRepo) {
        this.notificationRepo = notificationRepo;
    }
    create(input) {
        const id = this.notificationRepo.create({
            type: input.type,
            title: input.title,
            message: input.message,
            priority: input.priority ?? 0,
            project_id: input.projectId ?? null,
        });
        this.logger.info(`Notification created (id=${id}, type=${input.type})`);
        return id;
    }
    list(projectId) {
        return this.notificationRepo.findUnacknowledged(projectId);
    }
    acknowledge(id) {
        this.notificationRepo.acknowledge(id);
    }
    getById(id) {
        return this.notificationRepo.getById(id);
    }
}
//# sourceMappingURL=notification.service.js.map