feature: Approval and Promotion to VigilCareClinical

This commit is contained in:
voltsrage
2026-06-26 14:04:52 +08:00
parent 7121520926
commit 470df683dd
21 changed files with 2638 additions and 4 deletions
@@ -0,0 +1,20 @@
/// <summary>
/// Handles batch verification, rejection, and separation-of-duties enforcement.
/// </summary>
public interface IVerificationService
{
/// <summary>
/// Verifies a batch that is in PendingVerification status.
/// Enforces separation of duties: the verifier cannot be the same user who entered the data.
/// On pass, transitions to Verified or AwaitingClinicalApproval based on site config.
/// On fail (Passed = false), transitions to Rejected with field check notes as the reason.
/// </summary>
Task<DigitizationBatch> VerifyAsync(Guid batchId, VerifyBatchRequest request, Guid verifierUserId);
/// <summary>
/// Rejects a batch that is in PendingVerification or AwaitingClinicalApproval status.
/// Stores the rejection reason on the batch and transitions status to Rejected.
/// The batch returns to the entry work queue for re-entry by a data entry clerk.
/// </summary>
Task<DigitizationBatch> RejectAsync(Guid batchId, RejectBatchRequest request, Guid actorUserId);
}
@@ -0,0 +1,27 @@
/// <summary>
/// Provides work queue views for each workflow stage.
/// Each queue returns batches filtered by status and sorted by submission time ASC.
/// </summary>
public interface IWorkQueueService
{
/// <summary>
/// Returns batches in PendingVerification status, sorted by UpdatedAt ASC (oldest first).
/// This is the verifier's work queue — the next batch to verify is always at the top.
/// </summary>
Task<WorkQueueResponse> GetVerificationQueueAsync(int page, int pageSize);
/// <summary>
/// Returns batches that are awaiting or currently in data entry:
/// - Status = Uploaded (awaiting assignment and entry)
/// - Status = InEntry (currently being entered)
/// - Status = Rejected (returned for re-entry after verification rejection)
/// Sorted by UpdatedAt ASC so rejected batches surface for re-entry.
/// </summary>
Task<WorkQueueResponse> GetEntryQueueAsync(int page, int pageSize);
/// <summary>
/// Returns batches in AwaitingClinicalApproval status, sorted by UpdatedAt ASC.
/// This is the clinical approver's work queue.
/// </summary>
Task<WorkQueueResponse> GetClinicalApprovalQueueAsync(int page, int pageSize);
}