import { Router } from 'express';
import * as birthdayController from '../controllers/birthday.controller.js';
import { authenticate, requirePermission } from '../middleware/auth.js';

const router = Router();

// Admin: Kommende und vergangene Geburtstage
router.get('/upcoming', authenticate, requirePermission('customers:read'), birthdayController.getUpcomingBirthdays);

// Admin: Gruß-Marker zurücksetzen + Gruß senden
router.post('/:customerId/reset', authenticate, requirePermission('customers:update'), birthdayController.resetBirthdayGreeting);
router.post('/:customerId/send', authenticate, requirePermission('customers:update'), birthdayController.sendBirthdayGreeting);

// Portal: eigener Geburtstag-Check
router.get('/my-birthday', authenticate, birthdayController.getMyBirthday);
router.post('/my-birthday/acknowledge', authenticate, birthdayController.acknowledgeMyBirthday);

export default router;
