Public Access
1
0

feat: complete admin phase C and add safe mutation pilot

This commit is contained in:
pguerrerox
2026-05-28 12:46:06 +00:00
parent c58945353d
commit ce49497a6a
17 changed files with 1568 additions and 21 deletions
+105
View File
@@ -62,6 +62,111 @@ export interface AdminApplicationAdminResponse {
admin: ApplicationAdminSummary;
}
export type AdminAuditAction =
| 'admin_access_list'
| 'admin_access_upsert'
| 'admin_access_status_changed'
| 'analytics_summary'
| 'billing_workspaces_list'
| 'billing_workspace_detail'
| 'bootstrap_admin_claimed'
| 'admin_ops_audit_list'
| 'admin_ops_security_posture'
| 'admin_ops_diagnostics'
| 'admin_mutation_billing_resync_requested';
export interface AdminAuditLogItem {
id: string;
actorUserId: string | null;
actorEmail: string | null;
route: string;
action: AdminAuditAction;
targetWorkspaceId: string | null;
targetWorkspaceName: string | null;
metadataJson: Record<string, unknown>;
occurredAt: string;
}
export interface AdminAuditLogFilters {
actorEmail?: string;
action?: AdminAuditAction;
workspaceId?: string;
from?: string;
to?: string;
page?: number;
pageSize?: number;
}
export interface AdminAuditLogListResponse {
items: AdminAuditLogItem[];
page: number;
pageSize: number;
total: number;
}
export interface AdminSecurityPostureResponse {
bootstrapRequired: boolean;
bootstrapEnabled: boolean;
activeApplicationAdminCount: number;
adminAllowlistConfigured: boolean;
usingDeprecatedBillingAdminFallback: boolean;
}
export interface AdminFailedWebhookIssue {
id: string;
eventType: string;
workspaceId: string | null;
workspaceName: string | null;
errorMessage: string | null;
receivedAt: string;
externalEventId: string;
}
export interface AdminStaleBillingSyncIssue {
workspaceId: string;
workspaceName: string;
billingSyncStatus: BillingSyncStatus;
lastStripeSyncAt: string | null;
status: AccountBillingStatus;
planCode: PlanCode | null;
pendingPlanCode: PlanCode | null;
pendingPlanEffectiveAt: string | null;
}
export interface AdminTimelineAnomalySummary {
repeatedPaymentFailedCount: number;
pendingPlanPastEffectiveCount: number;
staleSyncThresholdCount: number;
}
export interface AdminSupportDiagnosticsResponse {
windowDays: number;
staleSyncThresholdHours: number;
failedWebhooks: {
count: number;
items: AdminFailedWebhookIssue[];
};
staleBillingSync: {
count: number;
items: AdminStaleBillingSyncIssue[];
};
timelineAnomalies: AdminTimelineAnomalySummary;
}
export interface AdminBillingResyncRequest {
workspaceId: string;
reason: string;
confirmationText: string;
ticketRef?: string;
}
export interface AdminBillingResyncResponse {
accepted: boolean;
message: string;
workspaceId: string;
externalSubscriptionRef: string;
}
export type WorkspaceType = 'personal' | 'company';
export type WorkspaceRole = 'owner' | 'member';