mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 13:03:12 +00:00
Adds the personal producers behind GET /api/notifications without changing its shape: new assignments (SH-288), unanswered comments on work the user takes part in (SH-289), @mentions, and decisions on uplifts the user requested (SH-215).
52 lines
3 KiB
C#
52 lines
3 KiB
C#
using SeaHaven.DataServices.Models;
|
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// Live work-order conditions behind the notification feed. Every query applies the
|
|
/// base scope (no templates, no deleted rows), the caller's account scope, and the
|
|
/// shared open rule (not Completed/Canceled, including legacy terminal statuses).
|
|
/// </summary>
|
|
public interface INotificationFeedDataService
|
|
{
|
|
/// <summary>Open work orders with no dispatcher assigned in <paramref name="accountId"/> (null is org-wide).</summary>
|
|
Task<UnassignedWorkOrdersSummary> GetUnassignedSummaryAsync(int? accountId, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Open, Aveta-required work orders scheduled on <paramref name="today"/> or the next day with no
|
|
/// Aveta document attached. Items are the <paramref name="limit"/> latest scheduled.
|
|
/// </summary>
|
|
Task<NotificationCandidatePage> GetAvetaMissingAsync(
|
|
NotificationFeedScope scope, DateOnly today, int limit, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Open work orders scheduled at or before <paramref name="cutoff"/> with no active vendor dispatch,
|
|
/// direct or linked. Items are the <paramref name="limit"/> latest scheduled.
|
|
/// </summary>
|
|
Task<NotificationCandidatePage> GetNoVendorAsync(
|
|
NotificationFeedScope scope, DateTime cutoff, int limit, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Open work orders assigned to the user whose latest assignment happened at or after
|
|
/// <paramref name="since"/> and was made by someone else, read from the latest AssignTo audit
|
|
/// entry (board create writes one too). Returns at most <paramref name="limit"/>, newest first.
|
|
/// </summary>
|
|
Task<IReadOnlyList<NotificationAssignmentCandidate>> GetRecentAssignmentsAsync(
|
|
NotificationPersonalScope scope, DateTime since, int limit, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Comments posted at or after <paramref name="since"/> by someone other than the user, on work orders
|
|
/// the user is assigned to, has commented on, or that mention the user, and that the user has not
|
|
/// commented after. Returns at most <paramref name="limit"/>, newest first.
|
|
/// </summary>
|
|
Task<IReadOnlyList<NotificationCommentCandidate>> GetUnansweredCommentsAsync(
|
|
NotificationPersonalScope scope, DateTime since, int limit, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Approve, reject and revoke decisions made at or after <paramref name="since"/> by someone else on
|
|
/// uplifts the user requested. Returns at most <paramref name="limit"/>, newest first.
|
|
/// </summary>
|
|
Task<IReadOnlyList<NotificationUpliftDecisionCandidate>> GetUpliftDecisionsAsync(
|
|
NotificationPersonalScope scope, DateTime since, int limit, CancellationToken cancellationToken);
|
|
}
|
|
}
|