- Add file_hash and is_identical_file columns to proof_versions table - Compute MD5 hash on file upload and compare with previous version - Display warning banner when uploading identical file as revision - Return is_identical_file in WebSocket response and API endpoints Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
85 lines
2 KiB
TypeScript
Executable file
85 lines
2 KiB
TypeScript
Executable file
// Fix: Broke a circular dependency by defining the AgentName type directly in this file instead of importing it.
|
|
export type AgentName = 'Legal Agent' | 'Brand Agent' | 'Channel Best Practices Agent' | 'Channel Tech Specs Agent';
|
|
|
|
export type AgentStatus = 'pending' | 'in-progress' | 'complete' | 'issues-found' | 'error';
|
|
|
|
export type ReviewStatus = {
|
|
[key in AgentName]?: AgentStatus;
|
|
};
|
|
|
|
export type RagStatus = 'Red' | 'Amber' | 'Green' | 'Error';
|
|
|
|
export interface SubReview {
|
|
ragStatus: RagStatus;
|
|
feedback: string;
|
|
issues: string[];
|
|
// Revision-aware fields (populated when analyzing version N > 1)
|
|
resolvedIssues?: string[];
|
|
outstandingIssues?: string[];
|
|
newIssues?: string[];
|
|
}
|
|
|
|
export type OverallStatus = 'Passed' | 'Failed' | 'Analysis Error' | 'Requires Manual Legal Review';
|
|
|
|
export interface AgentReview {
|
|
legalAgentReview: SubReview;
|
|
brandAgentReview: SubReview;
|
|
channelBestPracticesAgentReview: SubReview;
|
|
channelTechSpecsAgentReview: SubReview;
|
|
leadAgentSummary: string;
|
|
overallStatus: OverallStatus;
|
|
financialPromotionReason?: string;
|
|
}
|
|
|
|
export interface FlaggedItem {
|
|
id: string;
|
|
campaignName: string;
|
|
proofName: string;
|
|
version: number;
|
|
submitter: string;
|
|
submitAgency: string;
|
|
agentFlagged: string;
|
|
comments: string;
|
|
timestamp: string;
|
|
}
|
|
|
|
export interface ResolvedItem {
|
|
id: string;
|
|
campaignName: string;
|
|
proofName: string;
|
|
version: number;
|
|
submitter: string;
|
|
submitAgency: string;
|
|
agent: string;
|
|
issue: string;
|
|
resolution: string;
|
|
timestamp: string;
|
|
}
|
|
|
|
export interface ErrorItem {
|
|
id: string;
|
|
campaignName: string;
|
|
proofName: string;
|
|
version: number;
|
|
submitter: string;
|
|
submitAgency: string;
|
|
errorSummary: string;
|
|
timestamp: string;
|
|
}
|
|
|
|
export interface PDFPage {
|
|
page: number;
|
|
data_url: string;
|
|
width: number;
|
|
height: number;
|
|
}
|
|
|
|
export interface ProofVersion {
|
|
version: number;
|
|
timestamp: string;
|
|
workfrontId: string;
|
|
proofPreviewUrl?: string;
|
|
fileStorageKey?: string;
|
|
feedback: AgentReview;
|
|
isIdenticalFile?: boolean;
|
|
}
|