Commit Graph

22 Commits

Author SHA1 Message Date
d42bfecab4 chore: ajoute ruff (lint) et corrige les violations
- Config ruff dans pyproject.toml : règles E/W/F/I/UP/B, whitelist des appels
  d'injection FastAPI (Depends/File/Form/Query) pour B008, B904 ignoré
  (traduction volontaire des exceptions en réponses HTTP)
- Auto-fixes : tri des imports, suppression d'imports inutilisés, annotations
  PEP 604, f-strings sans placeholder, modes open redondants
- Suppression de variables inutilisées (config.reset_setting, parser locataires)

ruff check . : All checks passed ; 61 tests OK

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 10:20:36 +02:00
4606d6785b refactor: factorise la création d'engine et normalise solde_montant
- connection: création de l'engine centralisée dans _build_engine (source
  unique de config) ; init_db réutilise reset_connection + get_engine au lieu
  de dupliquer create_engine
- service: _normalize_amount garantit qu'un montant non numérique issu de
  l'extraction (string, dict…) n'entre jamais en base dans une colonne Float ;
  appliqué à solde_montant
- tests: couverture de _normalize_amount et du solde sous forme de string

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 10:15:09 +02:00
635a094591 feat: durcit l'exécution SQL IA, borne les uploads et ajoute des tests
- sql_executor: remplace le filtre regex fragile par une autorisation SQLite
  (set_authorizer) en complément de mode=ro ; rejette les instructions multiples
- uploads: lecture bornée des PDF (helper read_upload_limited, limite 20 Mo,
  HTTP 413) branchée sur /extract et /save-with-pdf
- tests: suite pytest (54 tests) couvrant amounts, dates, storage, sql_executor,
  uploads et DatabaseService.save_document ; pytest ajouté en dépendance dev

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 10:11:07 +02:00
c15b65f0d9 fix: corrige path traversal, fuites d'erreurs et dépréciations
- Empêche le path traversal du catch-all SPA (vérif is_relative_to dist)
- Migre on_event("startup") vers le handler lifespan de FastAPI
- Masque les exceptions internes des erreurs 500 (log au lieu de str(e))
- Remplace datetime.utcnow déprécié par un helper UTC timezone-aware
- Simplifie except (ValueError, Exception) redondant

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 10:01:48 +02:00
bd8b9a044c feat: add config page with LLM settings and tag management
Add ConfigPage.vue with two sections: Ollama configuration (URL, model,
timeout) with source badges and per-field reset, and tag management with
inline rename and creation. Add /config route and nav link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:09:37 +01:00
a1d708d083 feat: add settings service and config API routes
Add a key-value settings table (Setting model) with DB > env > default
resolution chain. Replace hardcoded Ollama constants in ollama_service
with dynamic _get_config() lookups. Add /api/config/ endpoints for
settings CRUD and tag management (create, rename).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:09:02 +01:00
4fe6a4b2c9 feat: first IA page 2026-02-13 12:18:24 +01:00
5c9a8c9b5e feat: highlight source element when navigating from tables to edit page
Clicking the pencil icon in revenus/depenses tables now passes query
params to identify the source row. The edit page auto-expands the
matching section, scrolls to the element, and briefly highlights it
with a blue ring that fades after 2 seconds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 06:16:29 +01:00
04db85c688 feat: seed predefined tags on database initialization
Automatically insert predefined tags when the tags table is empty
during DB init.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:34:48 +01:00
d8b2278491 feat: upload PDF file on save via multipart FormData
Switch save endpoint from JSON to multipart upload so the PDF file is
sent alongside extracted data and tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:34:34 +01:00
a119514319 refactor: replace pdfjs-dist with native browser iframe for PDF preview
Remove pdfjs-dist dependency and simplify PdfPreview component to use
a native browser iframe, reducing bundle size and complexity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:34:20 +01:00
ae1978b17c docs: add project README with setup and usage instructions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:34:01 +01:00
d271697d43 feat: add Docker deployment configuration
Add backend and frontend Dockerfiles, docker-compose setup with nginx
reverse proxy, .dockerignore files and Makefile for dev/prod workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:33:41 +01:00
4f0ca67dc4 feat: reimport pdf 2026-01-22 21:23:46 +01:00
981fabcc27 feat: add rental income dashboard with comprehensive analytics
- Add new /api/revenus endpoints for rental income data
  - GET /summary: KPIs, monthly trends, breakdown by property, top unpaid
  - GET /details: detailed rental records with filtering
  - GET /by-lot: revenue aggregation by unit
  - GET /immeubles: properties list with revenue stats

- Add RevenusPage with full dashboard layout
  - 6 KPI cards: total revenue, payments, unpaid, collection rate, active tenants, occupied units
  - Monthly evolution chart (rent, payments, unpaid)
  - Property breakdown donut chart
  - Top unpaid tenants list
  - Detailed revenue table with pagination and CSV export

- Add filters panel (property, type, dates, unpaid only, history months)
- Display property address instead of code in all components
- Add navigation link in header (Revenus)
2026-01-20 10:05:57 +01:00
281f69f39e feat: enhance homepage with financial summary and sparklines
- Add dashboard API endpoints for financial summary, recent revenus, monthly trends, and immeuble shortcuts
- Create new dashboard components: FinancialSummary with sparklines, QuickActions, RecentRevenus, MiniTrendChart, ImmeubleShortcuts
- Refactor HomePage with prominent drag & drop zone and data-driven cards
- Financial cards now show last document data with 6-month trend sparklines in background
- Remove redundant import button, keep single upload zone at top
2026-01-20 04:53:04 +01:00
cae8d5b963 feat: add inline editing for extracted data and autocomplete for tagging
- Add EditableField component for inline editing of any field
- Update DataRow, LocataireCard, OperationCard to support inline editing
- Add CRUD operations for locataires and operations (add/remove)
- Update JsonViewer to propagate changes via v-model
- Add TagAutocomplete component with search/filter functionality
- Replace select dropdown with autocomplete in TaggingStep
2026-01-19 22:02:28 +01:00
aac4d194e3 feat: add analytics 2026-01-19 21:40:10 +01:00
0fd6bdaeb3 feat: add depense tagging 2026-01-19 05:19:11 +01:00
c5e51a7513 feat: add homepage 2026-01-18 21:11:35 +01:00
ee1db93298 feat: fix parsing 2026-01-18 10:33:09 +01:00
6bad5fbaf9 feat: init plesna-gerance - extracteur de comptes rendus de gerance
- Backend Python (uv + click + FastAPI)
  - CLI: plesna-gerance extract <pdf> pour extraire les donnees
  - CLI: plesna-gerance serve pour lancer le serveur API
  - API REST: POST /api/extract pour upload et extraction de PDF
  - Parsers modulaires: metadata, locataires, operations
  - Utilise pdftotext (poppler-utils) pour l'extraction de texte

- Frontend Vue.js + Tailwind CSS
  - Interface split-screen: PDF a gauche, donnees a droite
  - Preview PDF avec zoom et navigation pages (pdf.js)
  - Visualisation structuree des donnees extraites
  - Sections depliables: metadata, locataires, operations
  - Drag & drop pour upload de PDF
  - Extraction automatique a la selection du fichier
2026-01-18 05:36:27 +01:00