## 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>
40 lines
1.5 KiB
Python
40 lines
1.5 KiB
Python
"""Data Entry module router factory."""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
def create_data_entry_router() -> APIRouter:
|
|
"""
|
|
Create and configure Data Entry module router.
|
|
|
|
Includes all data entry endpoints:
|
|
- /receipts - Receipt CRUD and workflow
|
|
- /ocr - OCR processing for receipts
|
|
- /nomenclature - Nomenclature syncing from Oracle
|
|
- /settings - User settings (OCR preferences)
|
|
- /metrics - OCR analytics and metrics
|
|
- /bulk - Bulk upload for batch processing
|
|
|
|
Returns:
|
|
APIRouter: Configured router for data entry module
|
|
"""
|
|
router = APIRouter()
|
|
|
|
# Import routers here to avoid circular imports
|
|
from .receipts import router as receipts_router
|
|
from .ocr import router as ocr_router
|
|
from .nomenclature import router as nomenclature_router
|
|
from .ocr_settings import router as ocr_settings_router
|
|
from .bulk import router as bulk_router
|
|
|
|
# Include all sub-routers (no prefix - already prefixed in main.py with /api/data-entry)
|
|
router.include_router(receipts_router, prefix="/receipts", tags=["data-entry-receipts"])
|
|
router.include_router(ocr_router, prefix="/ocr", tags=["data-entry-ocr"])
|
|
router.include_router(nomenclature_router, prefix="/nomenclature", tags=["data-entry-nomenclature"])
|
|
# OCR settings and metrics (endpoints at /settings/* and /metrics/*)
|
|
router.include_router(ocr_settings_router, tags=["data-entry-settings"])
|
|
# Bulk upload for batch processing
|
|
router.include_router(bulk_router, prefix="/bulk", tags=["data-entry-bulk"])
|
|
|
|
return router
|