initial commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
public record LoginRequest(string Username, string Password);
|
||||
@@ -0,0 +1 @@
|
||||
public record LoginResponse(string Token, Guid UserId, string Username, string FullName, string Role);
|
||||
@@ -0,0 +1 @@
|
||||
public record AssignBatchRequest(Guid EntryClerkUserId);
|
||||
@@ -0,0 +1,47 @@
|
||||
/// <summary>
|
||||
/// API representation of a digitization batch. Hides EF navigation properties
|
||||
/// and exposes enum fields as DB string literals.
|
||||
/// </summary>
|
||||
public record BatchDetailResponse(
|
||||
Guid Id,
|
||||
string Status,
|
||||
string BatchType,
|
||||
string Track,
|
||||
Guid? PatientId,
|
||||
string DocumentRef,
|
||||
string? DocumentUrl,
|
||||
bool EnableRetroactiveAlerts,
|
||||
Guid? EnteredByUserId,
|
||||
Guid? VerifiedByUserId,
|
||||
Guid? ApprovedByUserId,
|
||||
string? RejectionReason,
|
||||
DateTimeOffset? PromotedAt,
|
||||
Guid? PromotionEncounterId,
|
||||
Guid? SupersedesBatchId,
|
||||
bool ClinicianAttestation,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt
|
||||
)
|
||||
{
|
||||
public static BatchDetailResponse FromEntity(DigitizationBatch batch, string? documentUrl = null) =>
|
||||
new(
|
||||
batch.Id,
|
||||
batch.Status.ToDbString(),
|
||||
batch.BatchType.ToDbString(),
|
||||
batch.Track.ToDbString(),
|
||||
batch.PatientId,
|
||||
batch.DocumentRef,
|
||||
documentUrl,
|
||||
batch.EnableRetroactiveAlerts,
|
||||
batch.EnteredByUserId,
|
||||
batch.VerifiedByUserId,
|
||||
batch.ApprovedByUserId,
|
||||
batch.RejectionReason,
|
||||
batch.PromotedAt,
|
||||
batch.PromotionEncounterId,
|
||||
batch.SupersedesBatchId,
|
||||
batch.ClinicianAttestation,
|
||||
batch.CreatedAt,
|
||||
batch.UpdatedAt
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/// <summary>
|
||||
/// Multipart form metadata for batch creation (file is bound separately as <c>IFormFile</c>).
|
||||
/// </summary>
|
||||
public record CreateBatchRequest(
|
||||
string BatchType,
|
||||
string? Track,
|
||||
Guid? PatientId
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
public record PagedResult<T>(
|
||||
IReadOnlyList<T> Items,
|
||||
int Page,
|
||||
int PageSize,
|
||||
int TotalCount
|
||||
)
|
||||
{
|
||||
public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||
}
|
||||
Reference in New Issue
Block a user