Commit Graph

131 Commits

Author SHA1 Message Date
Claude Agent
b86aa6c5d2 feat(unified-mobile-material-design): Complete US-101b - Creare MobileBottomNav.vue component
Implemented by Ralph autonomous loop.
Iteration: 2

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 09:47:50 +00:00
Claude Agent
dfbaca2477 feat(unified-mobile-material-design): Complete US-101a - Creare MobileTopBar.vue component
Implemented by Ralph autonomous loop.
Iteration: 1

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 09:46:30 +00:00
Claude Agent
7b3541403f feat(data-entry): Bulk Receipt Upload cu Mobile UX Android Nativ
## Funcționalități Principale

### Bulk Upload & Processing
- Drag & drop pentru upload bonuri multiple oriunde pe pagină
- Batch processing cu job queue și worker pool
- Real-time updates via SSE (Server-Sent Events) cu fallback polling
- Duplicate detection via SHA-256 file hash
- Auto-retry pentru job-uri failed
- Cancel individual jobs sau batch complet

### Mobile UX - Android Native Style
- Top bar fixă cu hamburger, titlu centrat, acțiuni (search/filter)
- Bottom navigation cu 4 tab-uri (Bonuri, Upload, Rapoarte, Setări)
- FAB (Floating Action Button) cu hide/show on scroll
- Filter chips orizontal scrollabile
- Selecție multiplă prin long-press (500ms)
- Select All + Bulk Delete cu confirmare
- Layout Android pentru Create/Edit/View bon (Gmail compose style)

### Bug Fixes
- Refresh individual via SSE în loc de refresh total pagină
- Bonurile cu eroare OCR rămân vizibile pentru editare manuală
- Afișare nume fișier original pentru toate bonurile
- Upload stabil pe mobil (fix race condition File API)
- Păstrare ordine bonuri la refresh (nu se reordonează)

### Backend
- SSE endpoint pentru status updates real-time
- Bulk delete endpoint cu partial success
- Auto-cleanup bonuri failed după 7 zile
- Batch model cu tracking complet

### Testing
- E2E tests cu Playwright
- Unit tests pentru bulk upload, auto-create, cleanup

## Commits Squashed: 43 user stories (US-001 → US-043)
## Branch: ralph/bulk-receipt-upload
## Timp dezvoltare: ~3 zile (Ralph autonomous)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 08:33:17 +00:00
Claude Agent
b4a226409c feat(data-entry): Add unified receipt form with OCR confidence tracking
New unified receipt creation system with:
- UnifiedReceiptForm component with inline OCR preview and confidence indicators
- Compact upload zone with drag-drop and camera support
- TVA and Payment fields with dynamic add/remove
- Supplier dual-field with autocomplete and OCR hint
- Receipt form sections with collapsible auxiliary data

Backend OCR improvements:
- Add confidence_tva and confidence_payment to extraction results
- Update TVA extraction to return confidence scores
- Include TVA (15%) and payment (10%) in overall_confidence calculation

Also includes:
- CSS design system rules documentation
- Port check helper function for service scripts
- Expanded design tokens documentation in CLAUDE.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 21:48:37 +00:00
Claude Agent
cc98d6f21f ocr extract 2026-01-07 14:34:07 +00:00
Claude Agent
22eca953ce beads 2026-01-07 10:08:22 +00:00
Claude Agent
aed70f6a66 beads 2026-01-07 10:02:37 +00:00
Claude Agent
cab96ad5f4 bon lidl 2026-01-07 09:49:21 +00:00
Claude Agent
28f259cd05 fix(ocr): Fix store profile extraction patterns and module loading
Major fixes to OCR store profiles for Romanian receipt extraction:

- Fix ProfileRegistry module path resolution (was loading 0 profiles)
- Add multiline TVA extraction for Brick, Electrobering, Gama Ink
- Add "CARTE CREDIT" payment detection for OMV/SOCAR gas stations
- Handle OCR artifacts: TVA→TUA, "-"→"4", I→L in CUI markers
- Add client CUI patterns for Brick receipts
- Add profile selection logging to ocr_extractor.py
- Create test script for all 29 PDFs (test_all_profiles.py)

Test results: 13/29 passing (improved from 9/29)
Remaining failures are primarily OCR quality issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 09:40:58 +00:00
Claude Agent
099556213d feat(ocr): Add modular store profiles with hot-reload support
## Store Profiles System
- Add ProfileRegistry for CUI-based profile lookup
- Add BaseStoreProfile with generic extraction patterns
- Implement hot-reload via POST /api/data-entry/ocr/profiles/reload

## 12 Store Profiles
- LIDL: Multi-rate TVA (A, B, C, D codes)
- OMV, SOCAR: B2B with client CUI, YYYY.MM.DD dates
- BRICK, DEDEMAN: Standard TVA, e-factura support
- KINETERRA, BEST PRINT: Non-VAT payers (returns [])
- STEPOUT MARKET: TVA 5% (books/reduced rate)
- UNLIMITED KEYS: NUMERAR payment detection
- GAMA INK, ELECTROBERING, PICTUS VELUM: Standard TVA

## Flexible TVA Patterns
- All patterns use (\d{1,2})% to accept any rate
- Supports historical (19%, 9%, 5%) and current (21%, 11%)

## Payment Methods Fix
- Fixed base.py to support multiple payments of same type
- Changed deduplication from method-only to (method, amount) tuple
- Returns separate entries for split payments

## Tools
- Add generate_store_profile.py for automatic profile generation
- Analyzes PDFs via OCR API and detects patterns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 23:07:07 +00:00
Claude Agent
67b0082df0 docs: Restructure styling documentation and add theme toggle docs
- Simplify CLAUDE.md from ~460 to ~145 lines with imports
- Add Theme System section to css-design-system.md (3 modes: auto/light/dark)
- Document theme toggle UI, localStorage persistence, CSS priority order
- Add paths: frontmatter to authentication.md and company-period.md
- Update DESIGN_TOKENS.md Dark Mode section with toggle documentation
- Clean auto-build-memory.md header (remove non-existent auto-sync reference)
- Remove non-existent plugin from settings.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:58:24 +00:00
Claude Agent
1bb3a382de feat: Add PWA support and consolidate CSS design system
- Add PWA manifest, icons (192x192, 512x512), and service worker
- Register service worker in index.html with Apple mobile web app support
- Consolidate CSS variables and design tokens documentation
- Update PrimeVue overrides for consistent theming
- Refactor data-entry components to use shared CSS patterns
- Add frontend-style-auditor agent for style consistency checks
- Minor OCR validation and job worker improvements
- Update start-prod.sh configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:00:21 +00:00
Claude Agent
b2fe26da3a feat(ui): Add DevTools button for mobile debugging
Add Eruda DevTools integration accessible from hamburger menu on mobile devices.
- Add DevTools menu item with mobileOnly flag
- Load Eruda dynamically from CDN when clicked
- Filter menu items based on device type

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 14:24:19 +00:00
Claude Agent
bb72b690ab fix(ocr): Fix mobile file upload ERR_NETWORK on Android/iOS
Clone file to memory immediately after selection to avoid SnapshotState
invalidation in W3C File API. Android/iOS browsers invalidate File object
references after accessing properties (name, size, type).

See: https://issues.chromium.org/40703873

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 14:22:56 +00:00
13fc5e9abb fix(data-entry): Show action buttons after saving new receipt
Vue Router reuses the component when navigating from create to view mode,
so onMounted doesn't run again and loadReceipt() was never called. This
left receipt.value as null, causing the Edit/Submit buttons to not appear.

Added a watcher for route.params.id that loads the receipt when navigating
from create to view mode, and resets the form when navigating back to create.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 05:49:10 +02:00
2f7ef55868 fix(ocr): Improve CUI matching and vendor name extraction
- Add CUI variant matching for Romanian fiscal codes (handles "RO22891860",
  "RO 22891860", and "22891860" formats) in both sync_service and validation
- Fix vendor name extraction to properly handle "SC." prefix (Societate
  Comercială) vs "SC" as staircase in addresses
- Remove problematic TVA pattern that was incorrectly matching percentage values
- Add docTR Plus engine option to dropdown with "(recomandat)" label

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 05:34:31 +02:00
f1f6760bef refactor: Remove deprecated INTERNAL_API_PORT (ultrathin monolith cleanup)
Architecture cleanup after migration to ultrathin monolith:

- Remove INTERNAL_API_PORT from .env files (was port 8002)
- Clean up bot_main.py: remove uvicorn, Thread, run_internal_api()
- Update validate.md to check /api/telegram/health instead of port 8002
- Add deprecation notices to old Windows deployment docs
- Update docs/telegram/README.md with architecture note

The Telegram internal API is now served at /api/telegram/internal/*
on the main backend port (8000/8001) instead of separate port 8002.

Also includes: menu updates, ServerLogsView improvements, script fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 03:56:27 +02:00
1e244eefea chore: Add custom status line configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 02:50:02 +02:00
9ced8c49ba chore: Standardize Oracle tunnel port to 1521
Changed SSH tunnel local port from 1526 to 1521 to match Oracle's
default port, simplifying configuration across environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 02:49:25 +02:00
Claude Agent
02a8c8682c feat: Add Linux deployment scripts and server logs view
- Add deployment/linux/ with deploy.sh for deploying from Claude-Agent LXC to Windows server
- Add ServerLogsView.vue for viewing server logs from frontend
- Add shared/routes/system.py for system health endpoints
- Update CLAUDE.md with quick deploy instructions
- Improve Windows deployment scripts (ROA2WEB-Console.ps1)
- Fix OCR service validation and worker pool improvements
- Update environment config examples
- Various script permission and startup fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:26:36 +00:00
495790411f feat(ocr): Add docTR OCR engine with metrics infrastructure
Add docTR as primary OCR engine with 2-tier sequential processing,
OCR metrics tracking, and simplified engine selection.

Features:
- docTR OCR engine with light+medium preprocessing tiers
- doctr_plus mode with early exit optimization (~65% fast path)
- OCR metrics dashboard with per-engine statistics
- User OCR preference persistence
- Parallel worker pool for OCR processing
- Cross-validation for extraction quality

Engine options: tesseract, doctr, doctr_plus (recommended), paddleocr

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 05:37:16 +02:00
74f7aefc26 feat(ocr): Implement persistent worker pool with SQLite job queue
Major OCR infrastructure improvements:
- Add persistent SQLite-based job queue for OCR tasks
- Implement worker pool with process isolation and auto-restart
- Add OCR engine selector dropdown (Tesseract/PaddleOCR) in upload zone
- Optimize Tesseract preprocessing based on benchmark results (8x faster)
- Add recognize_cif_optimized() with multi-strategy CIF extraction
- Add Romanian CIF checksum validation
- Increase Telegram long polling timeout from 10s to 30s

Squashed commits:
- feat(ocr): Implement persistent worker pool with SQLite job queue
- feat(ocr): Add OCR engine selector dropdown to upload zone
- perf(telegram): Increase long polling timeout from 10s to 30s
- perf(ocr): Optimize Tesseract preprocessing based on benchmark results

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 12:32:12 +02:00
00f826f7ed docs(data-entry): Add sample receipt PDFs for OCR testing
Test receipts for OCR validation:
- abonament kineterra.pdf
- benzina 14 august.pdf
- benzina 27 octombrie.pdf
- igiena 11 octombrie.pdf
- igiena 14 decembrie five-holding.pdf
- rechizite 12 decembrie pictus.pdf

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-30 22:04:35 +02:00
51d736addf feat(ocr): Add memory management and auto-restart for OCR stability
OCR Service improvements:
- Single worker ThreadPoolExecutor to prevent parallel OCR memory accumulation
- Semaphore to ensure only one OCR operation at a time
- Explicit numpy array cleanup after each OCR step
- Forced garbage collection after every OCR request
- Memory threshold check (2500MB) with pre-processing GC
- Memory usage logging before/after processing

Backend auto-restart:
- Add run-with-restart.sh wrapper script for uvicorn
- Auto-restart on crash (OOM, etc.) with max 10 restarts
- Reset restart counter if process runs >60s (stable)
- Graceful exit on SIGINT/SIGTERM
- Update start-prod.sh and start-test.sh to use wrapper

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-30 22:03:51 +02:00
c5682ead42 fix(data-entry): Fix layout overlap and dropdown styling in receipt form
- Use CSS Grid with fixed columns (140px/120px/200px) to prevent TOTAL/CARD/MOD PLATA overlap
- Move MOD PLATA to end of row to avoid overlapping other fields
- Add borderless dropdown styling matching AutoComplete look
- Remove showClear (X button) from MOD PLATA dropdown
- Align dropdown height (44px) with text inputs for consistent vertical alignment
- Add non-scoped CSS for PrimeVue dropdown overrides (per CSS rules)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-30 21:59:08 +02:00
77d74a9ea0 fix(data-entry): Use CSS Grid to prevent Mod Plata/Total overlap
Changed from flexbox to CSS Grid layout for precise column control:
- grid-template-columns: 150px 200px auto (TOTAL, MOD PLATA, CARD)
- column-gap: 3rem ensures clear separation
- Fixed widths prevent any possibility of overlap

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:43:27 +02:00
4a886f0b64 feat(telegram): Unify Trezorerie button (Casa + Banca combined)
- Replace separate [Trezorerie Casa] and [Trezorerie Banca] buttons
  with single unified [Trezorerie] button in main menu
- Add format_treasury_combined_response() formatter showing:
  - Grand total (Sold Trezorerie)
  - Casa section with total + all accounts
  - Banca section with total + all accounts
- Compact menu layout: Row 2 [Sold Companie][Trezorerie],
  Row 3 [Sold Clienti][Sold Furnizori], Row 4 [Evolutie Incasari]
- Use Romanian number format (period as thousands separator)

Also includes:
- Oracle pool: Support both SERVICE_NAME and SID connections
  (ORACLE_SERVICE_NAME takes priority over ORACLE_SID)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:15:05 +02:00
ab160b628d feat(ocr): Add validation system and CLIENT CUI extraction
OCR Data Extraction Validation System:
- Add 7 validation rules (amount range, TVA ratio, payment sum, etc.)
- Add Medium preprocessing to replace Heavy (fixes digit concatenation)
- Add validation warnings to API responses
- Flag receipts needing manual review (needs_manual_review field)
- Add database migration for needs_manual_review column

CLIENT CUI Extraction Improvements:
- Support all format variations: CIF CLIENT:, CLIENT C.U.I/C.I.F., etc.
- Handle OCR errors (R0 vs RO, C1F vs CIF)
- Add client_name, client_cui, client_address to API response
- Add validation fields to API response (was missing)

QA Review: 12 issues found, 9 fixed (5 errors + 4 warnings)
- Fixed type safety in validation rules
- Fixed ZeroDivisionError risk
- Fixed schema mismatch (Optional[bool] for needs_manual_review)
- All 37 unit tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:12:52 +02:00
ce85e0643b fix: IIS sub-application deployment for production
Fixes 3 critical issues preventing production deployment on Windows IIS:

1. **IIS Sub-Application Path Stripping**
   - Changed URL patterns from ^roa2web/api/(.*) to ^api/(.*)
   - IIS sub-app at /roa2web automatically strips prefix
   - Requests arrive as /api/* not /roa2web/api/*

2. **SPA Fallback Absolute Path**
   - Changed from url="/index.html" to url="index.html"
   - Absolute paths (/) refer to site root, not sub-app
   - Relative path correctly serves from sub-app

3. **MIME Type Duplicates (500 Error)**
   - Added <remove> before <mimeMap> for .js, .json, .webmanifest
   - Prevents "duplicate collection entry" errors
   - Allows override of server-level MIME types

Build Script Improvements:
- Build-ROA2WEB.ps1: Copy public/ folder to temp build dir
- Build-ROA2WEB.ps1: Added verification logging for web.config
- ROA2WEB-Console.ps1: Fixed web.config verification location

Cleanup:
- Removed outdated web.config.10.0.20.36-INTERNAL
- Removed temporary test files and docs

Tested: https://roa2web.romfast.ro/roa2web/ - login page loads successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 16:38:47 +02:00
9008876b16 chore: Remove obsolete microservices directories and update all references
- Delete data-entry-app/ (1.6GB), reports-app/ (447MB), .auto-build-data/
- Saved ~1.4GB disk space (64% reduction: 2.2GB → 845MB)

Updated references across 38 files:
- .claude/rules/ paths: backend/modules/, src/modules/
- .claude/commands/validate.md: all validation paths
- docs/ (13 files): data-entry, telegram, README, CLAUDE.md
- scripts/ (3 files): backup-secrets, restore-secrets, test-docker
- security/ (2 files): git_cleanup, SECURITY_PROCEDURES
- deployment/ & shared/: updated all stale comments

All paths now reflect ultrathin monolith architecture:
- Backend: backend/modules/{reports,data_entry,telegram}/
- Frontend: src/modules/{reports,data-entry}/
- Shared: shared/{auth,database,routes}/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 12:08:20 +02:00
c5e051ad80 feat: Migrate to ultrathin monolith architecture
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>
2025-12-29 23:48:14 +02:00
2a101f1ef5 spec: ultrathin-monolith - unificare 3 backends într-un singur proces
Transformare arhitecturală de la 3 backend-uri separate la monolith ULTRATHIN:
- 1 singur proces FastAPI (port 8000) în loc de 3 (8001, 8003, 8002)
- Telegram bot integrat în același proces (nu separat)
- Structură modulară păstrată: backend/modules/{reports,data-entry,telegram}/
- Log-uri unificate cu prefixe de modul
- Deploy Windows simplificat: 1 serviciu NSSM în loc de 3
- Startup paralel: Oracle pool + PaddleOCR
- Curățenie cod: eliminare duplicări, cod mort
- URL-uri API păstrate: /api/reports/*, /api/data-entry/*, /api/telegram/*

Estimare: 21-31 ore (3-4 zile)
Fișiere afectate: ~70 (10 critice)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-24 22:23:55 +02:00
d507a81b0a feat: Implement unified Vue SPA with granular service control
Consolidate Reports and Data Entry apps into a single Vue.js SPA with:

Architecture:
- Module-based structure with lazy-loaded routes (@reports, @data-entry)
- Error boundaries per module to prevent cascade failures
- Dual API proxy in Vite for microservices (reports:8001, data-entry:8003)
- Pinia store factories for shared auth, company, and period stores
- Vite path aliases for clear module boundaries (@shared, @reports, @data-entry)

Service Management:
- Granular service control scripts (backend-reports.sh, backend-data-entry.sh, bot.sh, frontend.sh)
- 87% faster frontend restart: 7s vs 53s full restart
- 38% faster full startup: 33s vs 53s via parallel backend initialization
- Enhanced start-dev.sh with proper service timeouts (OCR: 30s, Vite: 15s, Bot: 10s)
- status.sh for comprehensive health checks

Features:
- Auto-select first company on login with period auto-load
- Hamburger menu with feature toggle support
- JWT token auto-injection via axios interceptors
- Unified header with company/period selectors
- IIS web.config for production deployment with multi-API routing

UX Improvements:
- Vue watchers for reactive company/period loading
- Lazy store initialization with graceful error handling
- Period persistence per user+company in localStorage
- Feature flags for optional modules

Deployment:
- Single IIS site serves unified frontend with API proxy rules
- Maintains separate backend processes for microservices
- Windows line ending fixes (.env CRLF → LF conversion)

Stats: 112 files changed, 38,342 insertions(+), 2,342 deletions(-)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-24 19:06:23 +02:00
fed2e68fa2 chore: Remove migrated files from old .auto-build-data/ location 2025-12-22 18:15:19 +02:00
04369bed56 chore: Migrate auto-build specs and memory for team sharing 2025-12-22 18:13:42 +02:00
7e67163fb2 Merge branch 'feature/unified-app-pragmatic-monolith' 2025-12-22 10:55:31 +02:00
0bdf079a20 docs: Update unified app spec to use root directory structure
Modified all specification files to reference the project root directory (.)
instead of creating a new unified-app/ subdirectory:

- spec.md: Updated project structure and all file paths
- SUMMARY.md: Updated critical files paths and documentation references
- critical-files.md: Updated all source/destination paths for migration
- MIGRATION_CHECKLIST.md: Updated directory creation and file paths

All implementation files will now be created directly in /mnt/e/proiecte/roa2web/
instead of /mnt/e/proiecte/roa2web/unified-app/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 10:51:08 +02:00
215fd72ac2 unified app plan 2025-12-22 01:01:58 +02:00
ee239eb3f3 fix: Resolve shared component styling and Vite module deduplication
- Add dedupe option for vue, vue-router, pinia, primevue in both Vite configs
  to prevent duplicate module issues when using shared components
- Add optimizeDeps and commonjsOptions for better shared module handling
- Fix CompanySelector and PeriodSelector header variants to support both
  light headers (using CSS variables) and gradient headers (white text)
- Make hamburger button always display:flex for consistent mobile layout

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 12:35:14 +02:00
3295f60faa feat: Improve Windows deployment and fix production paths
Data Entry App:
- Fix shared path finding for both dev and production environments
- Add base URL support for IIS subdirectory deployment (/data-entry/)
- Use import.meta.env.BASE_URL in router for correct path handling
- Add email-validator and python-jose dependencies

Deployment Scripts:
- Enhance Build-ROA2WEB.ps1 with improved build process
- Update ROA2WEB-Console.ps1 with Data Entry support
- Improve Publish-And-Deploy.ps1 deployment workflow
- Update deploy-config.json with new settings

Gitignore:
- Add more build cache patterns to ignore
- Add temp frontend build directories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 19:44:15 +02:00
642ae3a96c docs: Add Windows OCR dependencies and fix IIS API error handling
- Add OCR installation instructions for Windows (Poppler, Tesseract, PaddleOCR)
- Add troubleshooting section for common OCR errors on Windows
- Fix web.config.data-entry to use existingResponse="Auto" instead of "Replace"
  This allows FastAPI JSON error responses to pass through IIS unchanged
- Update system requirements to recommend 16GB RAM for OCR workloads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 19:43:33 +02:00
0851d01917 feat: Make TVA and payment method values editable, remove RON currency
- Make payment methods (CARD/NUMERAR) editable InputNumber fields
- Remove RON currency display from TOTAL, TVA, and payment fields
- Allow editing REJECTED receipts (to fix OCR errors before resubmit)
- Add "Editeaza" button for REJECTED receipts in view mode
- Fix null amount validation by converting to 0 before API call

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 19:13:30 +02:00
bc8a2ad138 feat: Add bulk approval to main list, remove separate approval page
- Remove /approval route and ReceiptApprovalView.vue
- Add checkbox selection column to receipts DataTable
- Add bulk actions bar with "Validează selectate" button
- Add visual indicator (underline) for active status filter
- Update CLAUDE.md with test environment instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 12:47:50 +02:00
a90d9093de feat: Add client extraction, amount cross-validation, and workflow fixes
OCR improvements:
- Extract client data (name, CUI, address) from B2B receipts
- Cross-validate amounts using payment methods and TVA entries
- OCR-tolerant patterns for "TOTAL LEI" with common OCR errors
- Better BON FISCAL vs CHITANTA detection

Backend workflow fixes:
- Fix SQLAlchemy deleted instance error in resubmit/submit workflow
- Add session.refresh() after deleting accounting entries
- Add unapprove endpoint (APPROVED → PENDING_REVIEW)
- Add direction filter for receipt listing

Frontend improvements:
- Fix Vue v-else-if chain broken by Menu component
- Unified OCR Preview layout with values table
- Receipt list filter by direction (plati/incasari)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:16:10 +02:00
93185120df fix: Improve receipt form UX with top buttons, attachment download, and TVA fix
- Add top action buttons in all modes (view/edit/create) aligned to the right
- Merge ReceiptDetailView into ReceiptCreateView for unified receipt handling
- Fix attachment download using blob URLs with auth headers
- Add download button in both view and edit modes for attachments
- Fix TVA InputNumber type mismatch by parsing amounts as floats
- Add fetchAttachmentBlob and downloadAttachment methods to receiptsStore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 17:32:21 +02:00
a6ae628934 feat: Restructure receipt form UI with bon fiscal sections
- Restructure OCRPreview with 5 sections matching Romanian receipt format:
  FURNIZOR, DOCUMENT, TOTAL, PLATA, TVA
- Add collapse button to OCRPreview header with minimize functionality
- Restructure form with matching compact sections for side-by-side comparison
- Add "din OCR" indicator when payment mode is auto-set from OCR
- Remove auto-collapse behavior - OCRPreview stays visible after applying data
- Add prominent TOTAL box styling with gradient background
- Compact form layout with fields on same row where logical
- Add TVA section to form with editable breakdown

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 15:08:55 +02:00
c1220e86a6 feat: Add payment methods extraction, OCR improvements, and AutoComplete fix
Backend:
- Add payment_methods and payment_mode fields to Receipt model
- Add payment method extraction (CARD/NUMERAR) with auto-suggestion logic
- Improve OCR service with TVA validation and reverse calculation
- Fix nomenclature service supplier limit (was 50, now unlimited)
- Add OCR fields migrations (ocr_raw_text, ocr_confidence, payment_mode)

Frontend:
- Fix AutoComplete to properly display supplier name after OCR
- Add payment methods display in OCR preview with suggested payment mode
- Improve ReceiptCreateView form handling and OCR data application

Database migrations:
- 20251215_add_ocr_fields_to_receipt.py
- 20251215_remove_partner_id.py
- 20251216_add_payment_mode.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:43:15 +02:00
46d9be0c08 fix: Resolve OCR left margin truncation issue
- Add safety padding (50px) around images before preprocessing to protect
  edge content during deskew rotation
- Fix _deskew() to expand canvas during rotation instead of using fixed
  canvas size with BORDER_REPLICATE (which lost edge content)
- Add fallback payment method patterns for truncated text detection
  (RD→CARD, ARD→CARD, MERAR→NUMERAR)

This fixes the issue where text near left edge was being cut off,
causing "CARD" to appear as "RD", "SUBTOTAL" as "UBTOTAL", etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 12:54:27 +02:00
1a6e9b17d2 feat: Add shared components, refactor stores, improve data-entry workflow
Shared Components:
- Add CompanySelector.vue and PeriodSelector.vue components
- Add AppHeader.vue and SlideMenu.vue layout components
- Add shared stores factories (companies.js, accountingPeriod.js)
- Add shared routes factories (companies.py, calendar.py)
- Add shared models (company.py, calendar.py)
- Add shared layout styles (header.css, navigation.css)

Data Entry App:
- Update CLAUDE.md with prod/test server documentation
- Improve nomenclature sync service with better error handling
- Update receipts router and CRUD operations
- Add company/period stores using shared factories
- Update App.vue layout with shared components
- Fix OCRUploadZone file handling

Reports App:
- Refactor stores to use shared factories
- Update App.vue to use shared layout components

Infrastructure:
- Replace start-data-entry.sh with separate dev/test scripts
- Add .claude/rules for authentication, backend patterns, etc.
- Add implementation plan for OCR receipt improvements
- Clean up old documentation files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 15:00:45 +02:00
c5fde510a8 feat: Add JWT auth and nomenclature sync to data-entry-app
Integrate shared JWT authentication into data-entry-app:
- Add Oracle pool initialization for auth service
- Add AuthenticationMiddleware to protect API routes
- Update all receipt endpoints to use CurrentUser from JWT
- Add shared auth router (/api/auth/login, /api/auth/refresh)

Add nomenclature synchronization feature:
- Create SQLite models for synced suppliers, local suppliers, and cash registers
- Add nomenclature router with sync triggers and CRUD endpoints
- Add sync service for Oracle → SQLite nomenclature data
- Update nomenclature_service to use synced SQLite data with fallbacks

Create shared frontend components:
- Add shared/frontend/ with LoginView.vue, auth store factory, login.css
- Integrate shared login and auth into data-entry-app frontend
- Add axios-based API service with token refresh interceptor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 18:36:24 +02:00