feat: complete phase six backoffice operations

This commit is contained in:
2026-07-28 14:31:43 +08:00
parent 747ff59d76
commit 99e4e43122
31 changed files with 23504 additions and 26 deletions

View File

@@ -5,6 +5,10 @@ namespace Tiku.Application.TenantAdmin;
public interface ITenantAdminDirectService
{
Task<TenantAdminOverviewItem> GetOverviewAsync(
TenantAdminActor actor,
CancellationToken cancellationToken = default);
Task<TenantAdminClassList> GetClassesAsync(
TenantAdminActor actor,
TenantAdminClassFilter filter,
@@ -50,6 +54,56 @@ public interface ITenantAdminDirectService
UpdateTenantAdminStudentStatusCommand command,
CancellationToken cancellationToken = default);
Task<TenantAdminStudentImportPreview> PreviewStudentImportAsync(
TenantAdminActor actor,
TenantAdminStudentImportCommand command,
CancellationToken cancellationToken = default);
Task<TenantAdminStudentImportResult> ImportStudentsAsync(
TenantAdminActor actor,
TenantAdminStudentImportCommand command,
CancellationToken cancellationToken = default);
Task<TenantAdminBulkOperationResult> BulkAssignClassAsync(
TenantAdminActor actor,
TenantAdminBulkAssignClassCommand command,
CancellationToken cancellationToken = default);
Task<TenantAdminBulkOperationResult> BulkUpdateStudentStatusAsync(
TenantAdminActor actor,
TenantAdminBulkStatusCommand command,
CancellationToken cancellationToken = default);
Task<CatalogList<TenantSupervisionRuleItem>> GetSupervisionRulesAsync(
TenantAdminActor actor,
CancellationToken cancellationToken = default);
Task<ContentManagementResult<TenantSupervisionRuleItem>> UpsertSupervisionRuleAsync(
TenantAdminActor actor,
UpsertTenantSupervisionRuleCommand command,
CancellationToken cancellationToken = default);
Task<TenantSupervisionPreview> PreviewSupervisionAsync(
TenantAdminActor actor,
CancellationToken cancellationToken = default);
Task<TenantSupervisionGenerateResult> GenerateSupervisionFollowupsAsync(
TenantAdminActor actor,
TenantSupervisionGenerateCommand command,
CancellationToken cancellationToken = default);
Task<TenantFollowupReport> GetFollowupReportAsync(
TenantAdminActor actor,
CancellationToken cancellationToken = default);
Task<TenantFeedbackReport> GetFeedbackReportAsync(
TenantAdminActor actor,
CancellationToken cancellationToken = default);
Task<TenantPointRiskReport> GetPointRiskReportAsync(
TenantAdminActor actor,
CancellationToken cancellationToken = default);
Task<CatalogList<TenantAdminStudentNoteItem>> GetStudentNotesAsync(
TenantAdminActor actor,
TenantAdminStudentActivityFilter filter,

View File

@@ -78,6 +78,20 @@ public sealed record TenantAdminFeedbackFilter(
string? Keyword = null,
int? Limit = null);
public sealed record TenantAdminOverviewItem(
int StudentCount,
int ClassCount,
int StaffCount,
int ActivePracticeCount,
int TodayPracticeCount,
int PendingFollowupCount,
int UnreadNotificationCount,
int PaidOrderCount,
int RevenueCents,
int PendingRefundCount,
int OpenReconciliationIssueCount,
DateTimeOffset GeneratedAt);
public sealed record UpsertTenantAdminClassCommand(
Guid? Id,
Guid? RegionId,
@@ -120,6 +134,109 @@ public sealed record UpdateTenantAdminStudentStatusCommand(
string? Status,
string? Reason);
public sealed record TenantAdminStudentImportRowCommand(
UserLookupCommand User,
Guid? RegionId,
Guid? ClassId,
string? AvatarPreset,
JsonElement RawProfile);
public sealed record TenantAdminStudentImportCommand(
IReadOnlyCollection<TenantAdminStudentImportRowCommand> Rows);
public sealed record TenantAdminStudentImportPreview(
int TotalCount,
int ValidCount,
int InvalidCount,
IReadOnlyCollection<TenantAdminStudentImportPreviewItem> Items);
public sealed record TenantAdminStudentImportPreviewItem(
int RowNo,
bool Valid,
string? Reason,
string? Phone,
string? Email,
string? Name,
Guid? RegionId,
Guid? ClassId);
public sealed record TenantAdminStudentImportResult(
int TotalCount,
int CreatedOrUpdatedCount,
int ClassAssignedCount,
IReadOnlyCollection<TenantAdminStudentImportPreviewItem> InvalidItems);
public sealed record TenantAdminBulkAssignClassCommand(
Guid ClassId,
IReadOnlyCollection<Guid> UserIds);
public sealed record TenantAdminBulkStatusCommand(
IReadOnlyCollection<Guid> UserIds,
string? Status,
string? Reason);
public sealed record TenantAdminBulkOperationResult(
int RequestedCount,
int SucceededCount,
int FailedCount,
IReadOnlyCollection<Guid> FailedUserIds);
public sealed record TenantSupervisionRuleItem(
string Code,
string Title,
bool Enabled,
int? DaysWithoutCheckIn,
int? MaxQuestionsAnsweredToday,
string FollowupType,
string Priority,
JsonElement Metadata);
public sealed record UpsertTenantSupervisionRuleCommand(
string Code,
string Title,
bool Enabled,
int? DaysWithoutCheckIn,
int? MaxQuestionsAnsweredToday,
string? FollowupType,
string? Priority,
JsonElement Metadata);
public sealed record TenantSupervisionPreview(
IReadOnlyCollection<TenantSupervisionRiskStudentItem> Items);
public sealed record TenantSupervisionRiskStudentItem(
Guid UserId,
string? Name,
string? PhoneMasked,
Guid? RegionId,
IReadOnlyCollection<string> RuleCodes,
IReadOnlyCollection<string> Reasons);
public sealed record TenantSupervisionGenerateCommand(
IReadOnlyCollection<Guid>? UserIds,
Guid? AssignedToUserId,
DateTimeOffset? DueAt);
public sealed record TenantSupervisionGenerateResult(int CreatedCount);
public sealed record TenantFollowupReport(
int OpenCount,
int InProgressCount,
int DoneCount,
int OverdueCount);
public sealed record TenantFeedbackReport(
int PendingCount,
int AcceptedCount,
int RejectedCount,
int ResolvedCount,
int ClosedCount);
public sealed record TenantPointRiskReport(
int NegativeScoreUserCount,
int HighPointClaimUserCount,
int CancelledExchangeOrderCount);
public sealed record UpsertTenantAdminStudentNoteCommand(
Guid? Id,
Guid StudentUserId,