37 Commits

Author SHA1 Message Date
Johngreen
9f4583229a feat: replace mapping text input with company dropdown selector
All checks were successful
Deploy to Production / deploy (push) Successful in 1m11s
- Add proxy endpoint GET /api/admin/digital-twin/companies
- Fetch company list from digital-twin API on modal open
- Select dropdown shows company name + industry type
- Remove manual UUID input in favor of selection
2026-02-12 15:18:52 +09:00
Johngreen
bcbffc9ce9 feat: add admin UI for tenant-to-digital-twin company mapping
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
- PATCH /api/admin/tenants/{tenant_id}/digital-twin endpoint
- update_tenant() supports digital_twin_company_id param
- Home page mapping modal with set/clear functionality
- Settings gear on tenant cards (superadmin only, visible on hover)
- Tenant type includes digital_twin_company_id field
2026-02-12 14:51:44 +09:00
Johngreen
fcd0b78f3c feat: visually distinguish digital-twin linked tenants
All checks were successful
Deploy to Production / deploy (push) Successful in 2m2s
- Add has_digital_twin flag to tenant API response
- Show cloud badge on tenant card for linked tenants
- Hide sync/import buttons for tenants without mapping
- Add .tenant-badge-dt CSS for the badge
2026-02-12 14:41:58 +09:00
Johngreen
66018e37c4 feat: filter equipment import by tenant-company mapping
All checks were successful
Deploy to Production / deploy (push) Successful in 2m7s
- Add digital_twin_company_id column to tenants table
- Map spifox tenant to its digital-twin companyId
- Pass companyId filter when fetching from digital-twin API
- Return 404 with clear message for unmapped tenants
- Improve API error messages in frontend (show server detail)
2026-02-12 14:30:18 +09:00
Johngreen
a8be53c88e feat: grouped equipment import modal with collapsible groups
All checks were successful
Deploy to Production / deploy (push) Successful in 2m10s
- Group 304 equipment items into 8 groups by name prefix
- Add group-level select/deselect with indeterminate checkbox state
- Add collapsible groups with sticky headers during scroll
- Show imported count per group and total toolbar summary
- Sort groups by item count descending
2026-02-12 14:07:19 +09:00
Johngreen
d3ed2798af fix: fetch all equipment from digital-twin by paginating API
All checks were successful
Deploy to Production / deploy (push) Successful in 1m43s
The digital-twin API defaults to limit=10 per page. Now fetches with
limit=500 and iterates through all pages using hasNextPage pagination
metadata, ensuring every equipment item is available for import.
2026-02-12 12:42:01 +09:00
Johngreen
278cd9d551 feat: bidirectional equipment sync with digital-twin
All checks were successful
Deploy to Production / deploy (push) Successful in 1m37s
Add import, sync, and push capabilities between factoryOps and the
digital-twin (BaSyx AAS) backend. Includes:

- Equipment sync service with field mapping and LWW conflict resolution
- Import preview modal with already-imported detection
- Bidirectional sync (pull updates + push local changes)
- Sync history tracking via equipment_sync_history table
- Machine detail page shows sync status and change history
- Docker networking for container-to-container communication
- UI fixes: responsive layout (375px), touch targets, section spacing
- 30 test cases for sync service
2026-02-12 12:27:21 +09:00
Johngreen
b619355763 feat: collapsible area groups in machine list (30+ auto-collapsed)
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
2026-02-11 09:31:07 +09:00
Johngreen
bfd66703fd fix: add padding to spec-grid so items don't stick to card edge
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
2026-02-11 09:28:21 +09:00
Johngreen
e0de67ad86 fix: re-add spifox data reset migration to clean stale seed data
All checks were successful
Deploy to Production / deploy (push) Successful in 48s
2026-02-10 23:35:36 +09:00
Johngreen
dc43ff5f93 data: import 304 spifox machines from digital twin DB (이천공장 실설비)
All checks were successful
Deploy to Production / deploy (push) Successful in 46s
2026-02-10 23:32:05 +09:00
Johngreen
205e96d719 data: reset spifox data via migration for clean seed re-import
All checks were successful
Deploy to Production / deploy (push) Successful in 49s
2026-02-10 22:56:18 +09:00
Johngreen
62e54ae2ef feat: replace spifox seed data with real factory data from business plan
All checks were successful
Deploy to Production / deploy (push) Successful in 48s
- Replace semiconductor equipment with actual press forming equipment (14 machines)
- Add real equipment: cup presses, finish presses, dryer, washer, heat treatment,
  vision inspectors, conveyor, AMR across 6 area groups
- Add real die parts: cut pin, cut die, forming die with count-based lifecycles
- Add press daily inspection + heat treatment inspection + case dimension inspection templates
- Fix seed.py to pass area/criticality when creating machines
- Add backfill migration to populate area/criticality for existing DB records
- Change spifox industry_type from semiconductor to press_forming
2026-02-10 22:45:53 +09:00
Johngreen
febdbdc4f0 feat: add equipment area grouping, criticality, and batch inspection
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
- Add area and criticality fields to Machine model with DB migration
- Add batch inspection endpoint (POST /inspections/batch) for area-wide inspection creation
- Rewrite MachineList with area grouping, criticality badges, and batch inspect button
- Update machine create/edit forms with area and criticality fields
- Update seed data with area/criticality values for all tenants
2026-02-10 22:38:55 +09:00
Johngreen
4c42f7aff8 ops: change postgres external port from 5433 to 8200
All checks were successful
Deploy to Production / deploy (push) Successful in 46s
2026-02-10 17:43:46 +09:00
Johngreen
b8217543c4 ops: expose production postgres on port 5433 for local dev access
All checks were successful
Deploy to Production / deploy (push) Successful in 51s
2026-02-10 17:19:49 +09:00
Johngreen
b9513897fc fix: prevent horizontal scroll in inspection item modal by adding flex-wrap and overflow-x hidden
All checks were successful
Deploy to Production / deploy (push) Successful in 1m4s
2026-02-10 17:10:53 +09:00
Johngreen
b9e97cc9c8 fix: resolve machine deletion failure after parts removal by nullifying orphaned FK references
All checks were successful
Deploy to Production / deploy (push) Successful in 46s
2026-02-10 17:04:42 +09:00
Johngreen
a4ddc1991e fix: rename nav label from 대시보드 to 설비 관리
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
2026-02-10 16:52:40 +09:00
Johngreen
0c61e7a895 feat: Material Design 3 redesign — elevation-based cards, M3 color system, Google-style navigation, smooth transitions
All checks were successful
Deploy to Production / deploy (push) Successful in 1m9s
2026-02-10 16:42:40 +09:00
Johngreen
c67f114cde fix: custom select dropdown, modal styling, memo label wrap, modal button padding
All checks were successful
Deploy to Production / deploy (push) Successful in 1m5s
2026-02-10 16:28:10 +09:00
Johngreen
00a17c0b86 feat: complete 5 GAP requirements — auto counters, inspection alarms, machine specs, responsive CSS
All checks were successful
Deploy to Production / deploy (push) Successful in 1m8s
- GAP 2+4: auto_time/date counter auto-computation with manual update blocking
- GAP 3: auto-generate alarms on inspection completion for failed items
- GAP 1: machine spec fields (manufacturer, location, capacity, power, description)
- GAP 5: enhanced mobile responsive CSS (768px/480px breakpoints)
- Alembic migration for new columns, seed data enriched with specs and date-type parts
2026-02-10 15:45:51 +09:00
Johngreen
ca29e5b809 feat: Phase 7 — enriched seed data and E2E integration tests
All checks were successful
Deploy to Production / deploy (push) Successful in 49s
- Seed: 9 machines, 24 parts with counters, 6 inspection templates (per tenant)
- Realistic industry data: semiconductor (SpiFox), manufacturing (Enkid), chemical (Alpet)
- E2E tests: full lifecycle flow, tenant isolation, spec-based pass/fail validation
- 70/70 tests passing

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 14:49:20 +09:00
Johngreen
843f72e048 feat: Phase 6 — alarm system (auto-generate, list, acknowledge)
All checks were successful
Deploy to Production / deploy (push) Successful in 1m17s
- Add Alarm model with tenant/part/machine relationships and 3 indexes
- Add alembic migration c5d6e7f8a9b0_add_alarms
- Add alarms API: list (filter by ack/severity), summary, acknowledge
- Auto-generate alarms on counter update (threshold warning, critical at 100%)
- Duplicate alarm prevention for same part+alarm_type
- Add alarms frontend page with active/acknowledged tabs, summary badges
- 9 new tests (67/67 total passing)

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 14:39:03 +09:00
Johngreen
035d62f0e0 feat: Phase 5 — part counter update, replacement, replacement history
All checks were successful
Deploy to Production / deploy (push) Successful in 1m5s
2026-02-10 13:55:49 +09:00
Johngreen
581c845f54 feat: Phase 4 — inspection sessions (create, execute, complete)
All checks were successful
Deploy to Production / deploy (push) Successful in 1m5s
Backend:
- InspectionSession + InspectionRecord models with alembic migration
- 6 API endpoints: create, list, get detail, save records, complete, delete
- Auto pass/fail judgment for numeric (spec range) and boolean items
- Completed inspections are immutable, required items enforced on complete
- 14 new tests (total 53/53 passed)

Frontend:
- Inspection list page with in_progress/completed tabs
- Template select modal for starting new inspections
- Inspection execution page with data-type-specific inputs
- Auto-save with 1.5s debounce, manual save button
- Completion modal with notes and required item validation
- Read-only view for completed inspections
- Pass/fail badges and color-coded item cards

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 13:46:23 +09:00
Johngreen
180cc5b163 fix(ui): improve template editor modal and card-body spacing
All checks were successful
Deploy to Production / deploy (push) Successful in 1m4s
- Add gap to card-body for consistent field spacing
- Wrap modal content in modal-body-form with proper gap
- Use modal-lg for item add modal to prevent field overflow

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 13:28:44 +09:00
Johngreen
7de011621d feat: Phase 3 — inspection templates (backend + frontend)
All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
- Add InspectionTemplate and InspectionTemplateItem models
- Add 9 API endpoints for template CRUD and item management
- Add Alembic migration for inspection_templates tables
- Add 15 backend tests (39/39 total pass)
- Add TemplateEditor component with item management UI
- Add templates list, create, and edit pages
- Add tab bar, template grid, form row CSS classes
- Fix CORS middleware ordering in main.py
- Move CORS middleware before router registration

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 13:24:30 +09:00
Johngreen
ee691be3ce chore: update seed credentials (admin@vexplor.com) and reset DB for re-seed
All checks were successful
Deploy to Production / deploy (push) Successful in 47s
2026-02-10 12:56:23 +09:00
Johngreen
7fc1b767f4 chore(ci): remove one-time volume reset from deploy
All checks were successful
Deploy to Production / deploy (push) Successful in 48s
2026-02-10 12:49:03 +09:00
Johngreen
eb3dd0a4ab fix(ci): reset stale DB volume, skip create_all in prod, handle alembic stamp fallback
All checks were successful
Deploy to Production / deploy (push) Successful in 47s
2026-02-10 12:46:49 +09:00
Johngreen
6b7a2f2b26 fix(ci): add container health check and log output after deploy
All checks were successful
Deploy to Production / deploy (push) Successful in 1m14s
2026-02-10 12:43:36 +09:00
Johngreen
782dc225bf feat(ci): auto-run alembic migrations and seed on container start
All checks were successful
Deploy to Production / deploy (push) Successful in 44s
- Add entrypoint.sh (migrate → seed → uvicorn)
- Add python-dotenv to requirements.txt
- Backend container uses entrypoint instead of direct uvicorn

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 12:36:01 +09:00
Johngreen
741c868367 fix(ci): stop v1 containers before starting v2 to free ports 8100/4000
All checks were successful
Deploy to Production / deploy (push) Successful in 59s
2026-02-10 12:33:20 +09:00
Johngreen
42f8b8131d ci: retry deploy with PEM format SSH key
All checks were successful
Deploy to Production / deploy (push) Successful in 1m51s
2026-02-10 12:30:32 +09:00
Johngreen
fcff23cd7c chore: add CI/CD pipeline and container configs for production deployment
Some checks failed
Deploy to Production / deploy (push) Failing after 1m24s
- Containerfile.backend/frontend for Docker builds
- docker-compose.prod.yml (PostgreSQL + API:8100 + Dashboard:4000)
- Gitea Actions workflow for auto-deploy on push to main
- Frontend dev port changed to 3100

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 12:21:07 +09:00
Johngreen
ab2a3e35b2 feat: Phase 0-2 complete — auth, machines, equipment parts with full CRUD
Multi-tenant factory inspection system (SpiFox, Enkid, Alpet):
- FastAPI backend with JWT auth, PostgreSQL (asyncpg)
- Next.js 16 frontend with App Router, SWR data fetching
- Machines CRUD with equipment parts management
- Part lifecycle tracking (hours/count/date) with counters
- Partial unique index for soft-delete support
- 24 pytest tests passing, E2E verified

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 12:05:22 +09:00