export type PolicyGateReadinessAction =
  | 'contact_admin'
  | 'fix_with_clark'
  | 'request_approval'
  | 'request_suppression'
  | 'rerun_gate'
  | 'view_report'
  | 'wait';

export type PolicyGateReadinessFindingSummary = {
  advisory: number;
  approvalRequired: number;
  blocking: number;
  suppressed: number;
};

export type PolicyGateReadinessItem = {
  actions: PolicyGateReadinessAction[];
  findingSummary: PolicyGateReadinessFindingSummary;
  itemId: string;
  itemType: 'security_agent' | 'security_scan';
  mode: 'advisory' | 'approval' | 'blocking' | 'report_only';
  policyId: string;
  policyVersionId: string;
  reviewRunId?: string;
  staleReason?: string;
  status: PolicyGateReadinessItemStatus;
};

export type PolicyGateReadinessItemStatus =
  | 'advisory_findings'
  | 'approval_required'
  | 'blocked'
  | 'failed'
  | 'missing'
  | 'passed'
  | 'running'
  | 'stale';

export type PolicyGateReadinessResponse = {
  items: PolicyGateReadinessItem[];
  status: PolicyGateReadinessStatus;
  target: PolicyGateReadinessTarget;
};

export type PolicyGateReadinessStatus = 'allowed' | 'approval_required' | 'blocked' | 'failed' | 'running' | 'stale';

export type PolicyGateReadinessTarget = {
  applicationId: string;
  commitId: string;
  directoryContentsHash: string | null;
};
