Consolidate 3 separate applications (reports-app, data-entry-app, telegram-bot) into a unified
architecture with single backend and frontend:
Backend Changes:
- Unified FastAPI backend at backend/ with modular structure
- Modules: reports, data_entry, telegram in backend/modules/
- Centralized config.py and main.py with all routers registered
- Single worker mode (--workers 1) for Telegram bot compatibility
- Shared Oracle connection pool and JWT authentication
- Unified requirements.txt and environment configuration
Frontend Changes:
- Single Vue.js SPA with module-based routing
- Unified frontend at src/ with modules in src/modules/{reports,data-entry}/
- Shared components and stores in src/shared/
- Error boundaries for module isolation
- Dual API proxy in Vite for module communication
Infrastructure:
- New unified startup scripts: start-prod.sh, start-test.sh, start-backend.sh
- Environment templates: .env.dev.example, .env.test.example, .env.prod.example
- Updated deployment scripts for Windows IIS
- Simplified SSH tunnel management
Documentation:
- Comprehensive CLAUDE.md with architecture overview
- Module-specific docs in docs/{data-entry,telegram}/
- Architecture decision records in docs/ARCHITECTURE-DECISIONS.md
- Deployment guides consolidated in deployment/windows/docs/
This migration reduces complexity, improves maintainability, and enables easier
deployment while maintaining all existing functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
103 lines
4.0 KiB
Python
103 lines
4.0 KiB
Python
"""
|
|
Pydantic models for Trial Balance (Balanță de Verificare)
|
|
Maps to Oracle VBAL VIEW (exists in each company schema)
|
|
"""
|
|
from pydantic import BaseModel, Field
|
|
from typing import Optional, List
|
|
from decimal import Decimal
|
|
|
|
class TrialBalanceItem(BaseModel):
|
|
"""
|
|
Individual trial balance record from VBAL VIEW
|
|
Real structure from Oracle:
|
|
- CONT: account number
|
|
- DENUMIRE: account description
|
|
- PRECDEB/PRECCRED: previous balance debit/credit
|
|
- RULDEB/RULCRED: monthly movement debit/credit
|
|
- SOLDDEB/SOLDCRED: final balance debit/credit
|
|
"""
|
|
cont: str = Field(description="Număr cont contabil (CONT)")
|
|
denumire: Optional[str] = Field(default="", description="Denumire cont (DENUMIRE)")
|
|
sold_precedent_debit: Decimal = Field(description="Sold precedent debit (PRECDEB)", decimal_places=2)
|
|
sold_precedent_credit: Decimal = Field(description="Sold precedent credit (PRECCRED)", decimal_places=2)
|
|
rulaj_lunar_debit: Decimal = Field(description="Rulaj lunar debit (RULDEB)", decimal_places=2)
|
|
rulaj_lunar_credit: Decimal = Field(description="Rulaj lunar credit (RULCRED)", decimal_places=2)
|
|
sold_final_debit: Decimal = Field(description="Sold final debit (SOLDDEB)", decimal_places=2)
|
|
sold_final_credit: Decimal = Field(description="Sold final credit (SOLDCRED)", decimal_places=2)
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class TrialBalanceFilters(BaseModel):
|
|
"""
|
|
Filters applied to trial balance data
|
|
"""
|
|
luna: int = Field(description="Luna (1-12)")
|
|
an: int = Field(description="An")
|
|
cont_filter: Optional[str] = Field(default=None, description="Filtru număr cont (partial match)")
|
|
denumire_filter: Optional[str] = Field(default=None, description="Filtru denumire cont (partial match, case-insensitive)")
|
|
|
|
|
|
class TrialBalancePagination(BaseModel):
|
|
"""
|
|
Pagination metadata
|
|
"""
|
|
total_items: int = Field(description="Total number of items")
|
|
total_pages: int = Field(description="Total number of pages")
|
|
current_page: int = Field(description="Current page number")
|
|
page_size: int = Field(description="Items per page")
|
|
|
|
|
|
class TrialBalanceTotals(BaseModel):
|
|
"""
|
|
Totals for all 6 columns from all filtered records (not just current page)
|
|
"""
|
|
total_sold_precedent_debit: Decimal = Decimal('0.00')
|
|
total_sold_precedent_credit: Decimal = Decimal('0.00')
|
|
total_rulaj_lunar_debit: Decimal = Decimal('0.00')
|
|
total_rulaj_lunar_credit: Decimal = Decimal('0.00')
|
|
total_sold_final_debit: Decimal = Decimal('0.00')
|
|
total_sold_final_credit: Decimal = Decimal('0.00')
|
|
|
|
|
|
class TrialBalanceResponse(BaseModel):
|
|
"""
|
|
Complete response for trial balance endpoint
|
|
"""
|
|
success: bool = Field(default=True, description="Request success status")
|
|
data: dict = Field(description="Trial balance data with items, pagination, and filters")
|
|
|
|
class Config:
|
|
json_schema_extra = {
|
|
"example": {
|
|
"success": True,
|
|
"data": {
|
|
"items": [
|
|
{
|
|
"cont": "4111",
|
|
"dcont": "Furnizori interni",
|
|
"sold_precedent_debit": 0.00,
|
|
"sold_precedent_credit": 15000.00,
|
|
"rulaj_lunar_debit": 5000.00,
|
|
"rulaj_lunar_credit": 8000.00,
|
|
"sold_final_debit": 0.00,
|
|
"sold_final_credit": 18000.00
|
|
}
|
|
],
|
|
"pagination": {
|
|
"total_items": 150,
|
|
"total_pages": 3,
|
|
"current_page": 1,
|
|
"page_size": 50
|
|
},
|
|
"filters_applied": {
|
|
"luna": 11,
|
|
"an": 2025,
|
|
"cont_filter": None,
|
|
"denumire_filter": "furnizori"
|
|
}
|
|
}
|
|
}
|
|
}
|