feat: support governed cascade deletion
This commit is contained in:
+20
-2
@@ -6,7 +6,17 @@ export const DEFAULT_CLIENT_TENANT_ID = 'tenant-a';
|
||||
|
||||
export type DeletionTargetType = 'channel' | 'signature' | 'template';
|
||||
|
||||
export type DeletionDependency = { kind: string; label: string; count: number; items: string[] };
|
||||
export type DeletionResolutionAction = 'delete_associated_templates' | 'delete_associated_drainage' | 'abandon_associated_report_tasks';
|
||||
|
||||
export type DeletionDependency = { kind: string; label: string; count: number; items: string[]; detailsVisible: boolean };
|
||||
|
||||
export type DeletionRequiredSelection = {
|
||||
action: DeletionResolutionAction;
|
||||
dependencyKind: string;
|
||||
label: string;
|
||||
description: string;
|
||||
count: number;
|
||||
};
|
||||
|
||||
export type DeletionPreflight = {
|
||||
type: DeletionTargetType;
|
||||
@@ -14,13 +24,21 @@ export type DeletionPreflight = {
|
||||
expectedUpdatedAt: string;
|
||||
identity: Record<string, string>;
|
||||
dependencies: DeletionDependency[];
|
||||
requiredSelections: DeletionRequiredSelection[];
|
||||
impacts: string[];
|
||||
blockedReasons: string[];
|
||||
allowedActions: Array<'delete'>;
|
||||
recoverability: { mode: 'soft_delete'; description: string };
|
||||
};
|
||||
|
||||
export type DeleteTargetRequest = { expectedUpdatedAt: string; idempotencyKey: string; reason: string };
|
||||
export type DeleteTargetRequest = {
|
||||
expectedUpdatedAt: string;
|
||||
idempotencyKey: string;
|
||||
reason?: string;
|
||||
deleteAssociatedTemplates?: boolean;
|
||||
deleteAssociatedDrainage?: boolean;
|
||||
abandonAssociatedReportTasks?: boolean;
|
||||
};
|
||||
|
||||
export type DeletionResult = { operationId: string; status: 'deleted'; replayed: boolean };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user