package com.yaoyuan.jiscuss.service;

import com.yaoyuan.jiscuss.entity.Notification;
import org.springframework.data.domain.Page;

public interface INotificationService {

    /** Create a notification for a user. */
    Notification create(Integer toUserId, Integer fromUserId, String type, String title, String content,
                        Integer relatedId, String relatedType);

    /** Convenience: create a "reply" notification. */
    void notifyReply(Integer toUserId, Integer fromUserId, Integer discussionId, String discussionTitle);

    /** Convenience: create a "like" notification for a post. */
    void notifyLike(Integer toUserId, Integer fromUserId, Integer postId, Integer discussionId);

    /** Unread notification count for a user. */
    long countUnread(Integer userId);

    /** Paged notification list for a user. */
    Page<Notification> listByUser(Integer userId, int page, int size);

    void markAllRead(Integer userId);

    void markOneRead(Integer notificationId, Integer userId);
}
