from app.extensions import db
from app.models import Notification


class NotificationService:
    @staticmethod
    def create_in_app(employee_id, event_code, title, message, link_url=None):
        notification = Notification(
            employee_id=employee_id,
            event_code=event_code,
            title=title,
            message=message,
            link_url=link_url,
        )
        db.session.add(notification)
        return notification
