Commit Graph

8 Commits

Author SHA1 Message Date
HotSwapp
1eb8ba8edd API: Standardized JSON list responses with Pydantic schemas and Pagination; add sort_by/sort_dir validation with whitelists; consistent JSON 401 for /api/*; structured logging for sorting/pagination; add pydantic dep; add Docker smoke script and README docs. 2025-10-07 16:05:09 -05:00
HotSwapp
950d261eb4 File Cabinet MVP: case detail with inline Ledger CRUD
- Extend Transaction with ledger fields (item_no, employee_number, t_code, t_type_l, quantity, rate, billed)
- Startup SQLite migration to add missing columns on transactions
- Ledger create/update/delete endpoints with validations and auto-compute Amount = Quantity × Rate
- Uniqueness: ensure (transaction_date, item_no) per case by auto-incrementing
- Compute case totals (billed/unbilled/overall) and display in case view
- Update case.html for master-detail ledger UI; add client-side auto-compute JS
- Enhance import_ledger_data to populate extended fields
- Close/Reopen actions retained; case detail sorting by date/item
- Auth: switch to pbkdf2_sha256 default (bcrypt fallback) and seed admin robustness

Tested in Docker: health OK, login OK, import ROLODEX/FILES OK, ledger create persisted and totals displayed.
2025-10-07 09:26:58 -05:00
HotSwapp
f9c3b3cc9c MVP legacy features: payments search page, phone book report (HTML+CSV), Rolodex bulk selection + actions; audit logging for Rolodex/Phone CRUD; nav updates 2025-10-06 23:31:02 -05:00
HotSwapp
0637fc2a63 chore: add structured logging with structlog; add request_id middleware; replace std logging 2025-10-06 22:22:04 -05:00
HotSwapp
4dbc452b65 items 2025-10-06 20:28:00 -05:00
HotSwapp
216adcc1f6 feat: Implement comprehensive admin panel with CSV import system
- Add ImportLog model for tracking import history and results
- Create admin.html template with file upload form and progress display
- Implement POST /admin/upload route for CSV file handling with validation
- Build CSV import engine with dispatcher routing by filename patterns:
  * ROLODEX*.csv → Client model import
  * PHONE*.csv → Phone model import with client linking
  * FILES*.csv → Case model import
  * LEDGER*.csv → Transaction model import
  * QDROS*.csv → Document model import
  * PAYMENTS*.csv → Payment model import
- Add POST /admin/import/{data_type} route for triggering imports
- Implement comprehensive validation, error handling, and progress tracking
- Support for CSV header validation, data type conversions, and duplicate handling
- Real-time progress tracking with ImportLog database model
- Responsive UI with Bootstrap components for upload and results display
- Enhanced navigation with admin panel link already in place
- Tested import functionality with validation and error handling

The admin panel enables bulk importing of legacy CSV data from the old-csv/ directory, making the system fully functional with real data.
2025-10-06 19:52:31 -05:00
HotSwapp
6aa4d59a25 feat(auth): add session-based login/logout with bcrypt hashing, seed default admin, templates and navbar updates; add auth middleware; pin SQLAlchemy 1.4.x for Py3.13; update TODOs 2025-10-06 19:04:36 -05:00
HotSwapp
de983a73d2 Set up database configuration and connection management
- Created app/database.py with SQLAlchemy engine, session management, and connection utilities
- Added comprehensive database models in app/models.py for User, Client, Phone, Case, Transaction, Document, and Payment
- Implemented FastAPI application with database lifecycle management in app/main.py
- Added health check endpoint to verify database connectivity
- Created README.md with database configuration documentation
- Verified database connection works correctly with SQLite backend
2025-10-06 18:22:18 -05:00