Commit Graph

7 Commits

Author SHA1 Message Date
Martin Hohenberg
ccf6a64787 Add job brackets for grouping multi-part or repeated jobs
- JobBracket model: name, customer, notes
- Migration 0006: job_brackets table + bracket_id FK on print_jobs
- /brackets: list with per-bracket progress bar
- /brackets/{id}: detail with jobs table + Add Job(s) modal (quantity field
  creates N identical jobs in one shot, each with its own UUID and log entry)
- /jobs Add Job modal: optional bracket selector
- Sidebar: Brackets nav item added

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 22:03:01 +02:00
Martin Hohenberg
977e0deb24 Make printer optional on job creation — assigned when job starts
Migration 0005 makes print_jobs.printer_id nullable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 21:57:07 +02:00
Martin Hohenberg
fe594e8675 Add job creation with UUID, STL upload/library, search, job log, TZ, and CLAUDE.md
- PrintJob: job_uuid (UUID4), customer, logs relationship
- JobLog model + migration 0004 (also includes job_logs table)
- POST /jobs: upload STL or select from library, auto-logs 'Job created'
- GET /jobs?q=: search by customer or filename across all statuses
- app/stl.py: STL_UPLOAD_DIR helper (from env, default /data/stl)
- docker-compose: named volume stl_files mounted at /data/stl
- .env.install: added STL_UPLOAD_DIR and TZ=Europe/Berlin
- CLAUDE.md: full project context for future sessions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 21:55:49 +02:00
Martin Hohenberg
c78f8c91cd Add printer lifecycle fields and printer log
- Printer: bought_at, last_maintenance_at, decommissioned_at (all Date, nullable)
- PrinterLog: per-printer timestamped text entries (CASCADE delete)
- Migration 0003: adds columns + printer_logs table
- /printers/{id}: detail page showing lifecycle info + scrollable log
- POST /printers/{id}/log: add a log entry via modal form
- Printer names in list are now links to the detail page
- Add Printer modal includes optional purchase date

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 21:47:48 +02:00
Martin Hohenberg
750edbbcec Add printer types with bed volume + add-printer UI
- PrinterType model: name, bed_x_mm/y/z, linked to Printer via type_id
- Migration 0002: creates printer_types, adds type_id to printers, drops model
- /printer-types page: table + Add Type modal form
- /printers page: Add Printer modal with type dropdown (disabled if no types)
- API: GET/POST/DELETE /api/printer-types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 21:46:26 +02:00
Martin Hohenberg
ee0b1b39e9 Add Jinja2 web UI with Bootstrap 5 dark theme
- app/templates/: base layout with sidebar nav + 6 pages
  (dashboard, printers, jobs, filaments, todos, pricing)
- app/routers/ui.py: HTML routes querying the DB live
- API routes moved to /api/* prefix
- requirements: jinja2, python-multipart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 21:26:23 +02:00
Martin Hohenberg
d092c19b41 Scaffold SQLAlchemy models, routers, and Alembic migrations
- app/models/: Printer, Filament, PrintJob, Todo, PricingConfig with full
  SQLAlchemy 2.x mapped columns and relationships
- app/routers/: list + get-by-id endpoints for all five resources
- app/db.py: SQLAlchemy engine + SessionLocal + get_db dependency
- alembic/: env.py reads MYSQL_* env vars; 0001_initial_schema mirrors db.sql
- alembic.ini: script_location configured, URL injected at runtime

Since db.sql already created the tables, stamp the DB before running future
migrations:  alembic stamp head

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 21:19:59 +02:00