File size: 2,994 Bytes
b8e6434
0d71eae
 
 
ed7c3f7
0d71eae
b8e6434
ed7c3f7
b8e6434
 
 
ed7c3f7
 
b8e6434
 
 
 
 
0d71eae
b8e6434
0d71eae
b8e6434
0d71eae
 
 
 
 
b8e6434
 
 
 
 
 
5f3c146
 
26fba59
 
b8e6434
 
 
 
 
 
 
 
 
 
8663682
b8e6434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ce0ad80
 
 
 
 
b8e6434
 
 
 
 
 
 
 
 
 
4ceb9d2
ce0ad80
b8e6434
7e01ebe
b8e6434
 
5f2460b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8e6434
 
 
 
 
 
26fba59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8feafb7
 
c24f6b4
 
26fba59
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
export type TenderItem = {
  correlative?: number;
  product_code?: string;
  category?: string;
  name: string;
  description?: string;
  quantity: number;
  unit: string;
};

export type TenderAttachment = {
  name: string;
  url: string;
};

export type Tender = {
  code: string;
  name: string;
  description: string;
  buyer: string;
  buyer_region?: string;
  status: string;
  status_code?: string;
  type?: string;
  currency?: string;
  closing_date: string | null;
  publication_date?: string | null;
  estimated_amount: number | null;
  source: string;
  region?: string;
  sector?: string;
  items?: TenderItem[];
  attachments?: TenderAttachment[];
  evaluation_criteria?: { name?: string; weight?: string; description?: string }[];
  contract_duration?: string;
  buyer_complaints?: number;
  buyer_purchases?: number;
};

export type CompanyProfile = {
  name: string;
  industry: string;
  services: string[];
  experience: string;
  certifications: string[];
  regions: string[];
  documents_available: string[];
  keywords: string[];
};

export type RiskItem = {
  title: string;
  severity: "High" | "Medium" | "Low";
  explanation: string;
};

export type ActionItem = {
  task: string;
  priority: string;
  owner: string;
  timeline: string;
};

export type QAResponse = {
  question: string;
  answer: string;
};

export type AnalysisResult = {
  fit_score: number;
  decision: string;
  executive_summary: string;
  key_requirements: string[];
  risks: RiskItem[];
  compliance_gaps: string[];
  action_plan: ActionItem[];
  proposal_draft: string;
  report_markdown: string;
  strategic_roadmap?: string;
  requirement_responses?: QAResponse[];
  audit_log: string[];
  raw_responses?: Record<string, string>;
};

export type OCItem = {
  correlative?: number;
  product_code?: string;
  name: string;
  description?: string;
  quantity: number;
  unit: string;
  price?: number;
  total?: number;
};

export type PurchaseOrder = {
  code: string;
  name: string;
  status: string;
  status_code?: string;
  buyer: string;
  buyer_rut?: string;
  provider: string;
  provider_rut?: string;
  date_creation: string | null;
  total_amount: number | null;
  currency: string | null;
  type?: string;
  items?: OCItem[];
};

export type AnalysisHistoryItem = {
  tender_code: string;
  tender_name: string;
  analyzed_at: string;
  analysis: AnalysisResult;
};

export type TenderDetailTab = {
  name: string;
  found: boolean;
};

export type TenderDetailInfo = {
  tender_code: string;
  url: string;
  tabs: Record<string, TenderDetailTab>;
  attachments: TenderAttachment[];
  metadata: {
    has_administrative_docs?: boolean;
    has_technical_docs?: boolean;
    has_economic_docs?: boolean;
    question_count?: number;
    has_adjudication?: boolean;
    buyer_complaints?: number;
    buyer_purchases?: number;
    guarantees?: Array<{ type: string; amount: string }>;
    detailed_items?: Array<{ code: string; description: string }>;
  };
  error?: string;
};