PreRelease v1

This commit is contained in:
2026-03-25 13:52:45 +01:00
parent 94b0c68703
commit 6bf998a52a
56 changed files with 11427 additions and 847 deletions

83
types/contract.types.ts Normal file
View File

@@ -0,0 +1,83 @@
// src/types/contract.types.ts
export type ContractType =
| "INSURANCE_AUTO"
| "INSURANCE_HOME"
| "INSURANCE_HEALTH"
| "INSURANCE_LIFE"
| "LOAN"
| "CREDIT_CARD"
| "INVESTMENT"
| "OTHER";
export type ContractStatus = "UPLOADED" | "PROCESSING" | "COMPLETED" | "FAILED";
export interface Contract {
id: string;
userId: string;
fileName: string;
fileUrl: string;
fileSize: number;
mimeType: string;
// AI-determined
title: string | null;
type: ContractType | null;
provider: string | null;
policyNumber: string | null;
startDate: Date | null;
endDate: Date | null;
premium: number | null;
status: ContractStatus;
extractedText: string | null;
summary: string | null;
keyPoints: {
guarantees?: string[];
exclusions?: string[];
franchise?: string;
importantDates?: string[];
} | null;
documentHash: string | null;
txHash: string | null;
ipfsUrl: string | null;
createdAt: Date;
updatedAt: Date;
}
export interface UploadContractInput {
file: File;
}
export interface ContractFilters {
type?: ContractType;
status?: ContractStatus;
search?: string;
}
export interface ContractStats {
total: number;
active: number;
expired: number;
expiringSoon: number;
}
export interface AIAnalysisResult {
title: string;
type: ContractType;
provider?: string;
policyNumber?: string;
startDate?: Date;
endDate?: Date;
premium?: number;
summary: string;
keyPoints: {
guarantees?: string[];
exclusions?: string[];
franchise?: string;
importantDates?: string[];
};
}