Álvaro Valenzuela Valdes commited on
Commit ·
6465c28
1
Parent(s): 29a7a62
fix: Create missing models and fix python module discovery
Browse files- backend/app/main.py +4 -0
- backend/app/models/__init__.py +0 -0
- backend/app/models/analysis.py +20 -0
- backend/app/models/company.py +14 -0
- backend/app/routers/__init__.py +0 -0
- backend/app/services/__init__.py +0 -0
- start.sh +0 -4
backend/app/main.py
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
from app.routers import analysis, company, health, tenders, documents
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import os
|
| 3 |
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 4 |
+
|
| 5 |
from fastapi import FastAPI
|
| 6 |
from fastapi.middleware.cors import CORSMiddleware
|
| 7 |
from app.routers import analysis, company, health, tenders, documents
|
backend/app/models/__init__.py
ADDED
|
File without changes
|
backend/app/models/analysis.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, Integer, String, Float, DateTime, Text
|
| 2 |
+
from app.database import Base
|
| 3 |
+
from datetime import datetime
|
| 4 |
+
|
| 5 |
+
class AnalysisHistoryModel(Base):
|
| 6 |
+
__tablename__ = "analysis_history"
|
| 7 |
+
|
| 8 |
+
id = Column(Integer, primary_key=True, index=True)
|
| 9 |
+
tender_code = Column(String(50), index=True)
|
| 10 |
+
tender_name = Column(String(255))
|
| 11 |
+
decision = Column(String(50))
|
| 12 |
+
score = Column(Integer)
|
| 13 |
+
summary = Column(Text)
|
| 14 |
+
risks = Column(Text) # JSON string
|
| 15 |
+
technical_analysis = Column(Text)
|
| 16 |
+
legal_analysis = Column(Text)
|
| 17 |
+
commercial_analysis = Column(Text)
|
| 18 |
+
proposal_draft = Column(Text)
|
| 19 |
+
report_markdown = Column(Text)
|
| 20 |
+
created_at = Column(DateTime, default=datetime.utcnow)
|
backend/app/models/company.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, Integer, String, Text
|
| 2 |
+
from app.database import Base
|
| 3 |
+
|
| 4 |
+
class CompanyProfileModel(Base):
|
| 5 |
+
__tablename__ = "company_profile"
|
| 6 |
+
|
| 7 |
+
id = Column(Integer, primary_key=True, index=True)
|
| 8 |
+
name = Column(String(255))
|
| 9 |
+
industry = Column(String(255))
|
| 10 |
+
services = Column(Text)
|
| 11 |
+
experience = Column(Text)
|
| 12 |
+
certifications = Column(Text)
|
| 13 |
+
regions = Column(Text)
|
| 14 |
+
documents_available = Column(Text)
|
backend/app/routers/__init__.py
ADDED
|
File without changes
|
backend/app/services/__init__.py
ADDED
|
File without changes
|
start.sh
CHANGED
|
@@ -1,9 +1,5 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Seed Database with sample data for demo
|
| 4 |
-
echo "Seeding database..."
|
| 5 |
-
cd /app/backend && python3 seed_db.py
|
| 6 |
-
|
| 7 |
# Start Backend
|
| 8 |
echo "Starting Backend..."
|
| 9 |
cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 &
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Start Backend
|
| 4 |
echo "Starting Backend..."
|
| 5 |
cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 &
|