Commit Graph

210 Commits

Author SHA1 Message Date
ryan
a0be16d848 fix: resolve all frontend lint errors and warnings
All checks were successful
CI / ci (pull_request) Successful in 21s
CI / e2e (pull_request) Successful in 59s
Replace all `any` types with proper types across 36 files:
- TanStack Router search params: `{} as Record<string, unknown>`
- API response pagination: proper typed interface
- DataTable column casts: remove unnecessary `as any`
- Function params and event handlers: use specific types
- Remove unused imports and variables in POS components

Frontend lint now passes with 0 errors and 0 warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 20:12:17 +00:00
ryan
1673e18fe8 fix: require open drawer to complete transactions, fix product price field
Some checks failed
CI / ci (pull_request) Failing after 20s
CI / e2e (pull_request) Has been skipped
- Backend enforces open drawer at location before completing any transaction
- Frontend disables payment buttons when drawer is closed with warning message
- Fix product price field name (price, not sellingPrice) in POS API types
- Fix seed UUIDs to use valid UUID v4 format (version nibble must be 1-8)
- Fix Vite allowedHosts for dev.lunarfront.tech access
- Add e2e test for drawer enforcement (39 POS tests now pass)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 19:54:07 +00:00
ryan
bd3a25aa1c feat: add POS register screen with full-screen touch-optimized layout
Standalone register at /pos bypassing the admin sidebar layout:
- Two-panel layout: product search/grid (60%) + cart/payment (40%)
- Product search with barcode scan support (UPC lookup on Enter)
- Custom item entry dialog for ad-hoc items
- Cart with line items, tax, totals, and remove-item support
- Payment dialogs: cash (quick amounts + change calc), card, check
- Drawer open/close with balance reconciliation and over/short
- Auto-creates pending transaction on first item added
- POS link added to admin sidebar nav (module-gated)
- Zustand store for POS session state, React Query for server data

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 19:29:37 +00:00
bd5f0ca511 Merge pull request 'feat: add app_config table with runtime log level control and POS structured logging' (#5) from feature/structured-logging into main
All checks were successful
Build & Release / build (push) Successful in 58s
Reviewed-on: #5
2026-04-04 19:08:48 +00:00
ryan
aa5b53920d feat: add app configuration UI to settings page
All checks were successful
CI / ci (pull_request) Successful in 17s
CI / e2e (pull_request) Successful in 47s
Log level dropdown on the settings page lets admins change the application
log verbosity at runtime without restarting. Uses the new /v1/config API
with the existing settings.view/settings.edit permissions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 19:04:31 +00:00
ryan
772d5578ad feat: add app_config table with runtime log level control and POS structured logging
All checks were successful
CI / ci (pull_request) Successful in 20s
CI / e2e (pull_request) Successful in 56s
- New app_config key-value table for system settings, with in-memory cache (mirrors ModuleService pattern)
- GET/PATCH /v1/config endpoints for reading and updating config (settings.view/settings.edit permissions)
- Runtime log level: PATCH /v1/config/log_level applies immediately, persists across restarts
- Startup loads log level from DB in onReady hook (env var is default, DB overrides)
- Add structured request.log.info() to POS routes: transaction create/complete/void, drawer open/close, discount create/update/delete

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 18:56:21 +00:00
51e7902ee2 Merge pull request 'feature/pos-core' (#4) from feature/pos-core into main
All checks were successful
Build & Release / build (push) Successful in 57s
Reviewed-on: #4
2026-04-04 18:30:16 +00:00
ryan
8256380cd1 feat: add cash rounding, POS test suite, and fix test harness port cleanup
All checks were successful
CI / ci (pull_request) Successful in 20s
CI / e2e (pull_request) Successful in 50s
- Add Swedish rounding (nearest nickel) for cash payments at locations with cash_rounding enabled
- Add rounding_adjustment column to transactions, cash_rounding to locations
- Add POS schema to database plugin for relational query support
- Complete/void routes now return full transaction with line items via getById
- Test harness killPort falls back to fuser when lsof unavailable (fixes stale process bug)
- Add 35-test POS API suite covering discounts, drawer, transactions, tax, rounding, e2e flow
- Add unit tests for tax service and POS Zod schemas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 18:23:05 +00:00
Ryan Moon
199b9ab3b3 fix: install bun then move binary to /usr/local/bin
All checks were successful
Build Devpod / build (push) Successful in 2m10s
Build & Release / build (push) Successful in 17s
2026-04-04 11:38:06 -05:00
Ryan Moon
2b141d45f3 fix: bootstrap Claude Code on first boot since it installs to /root (PVC)
Some checks failed
Build Devpod / build (push) Failing after 6s
Build & Release / build (push) Successful in 16s
2026-04-04 11:31:51 -05:00
Ryan Moon
1c56023491 fix: install bun to /usr/local/bin so it persists when /root is PVC-mounted
Some checks failed
Build Devpod / build (push) Failing after 50s
Build & Release / build (push) Has been cancelled
2026-04-04 11:30:54 -05:00
ryan
7b15f18e59 feat: add core POS module — transactions, discounts, drawer, tax
Phase 3a backend API for point-of-sale. Includes:

Schema (packages/backend/src/db/schema/pos.ts):
- pgEnums: transaction_type, transaction_status, payment_method,
  discount_type, discount_applies_to, drawer_status
- Tables: transaction, transaction_line_item, discount,
  discount_audit, drawer_session
- Transaction links to accounts, repair_tickets, repair_batches
- Line items link to products and inventory_units

Tax system:
- tax_rate + service_tax_rate columns on location
- tax_category enum (goods/service/exempt) on product
- Tax resolves per line item: goods→tax_rate, service→service_tax_rate,
  exempt→0. Repair line items map: part→goods, labor→service
- GET /tax/lookup/:zip stubbed for future API integration (TAX_API_KEY)

Services (export const pattern, matching existing codebase):
- TransactionService: create, addLineItem, removeLineItem, applyDiscount,
  recalculateTotals, complete (decrements inventory), void, getReceipt
- DiscountService: CRUD + listAll for dropdowns
- DrawerService: open/close with expected balance + over/short calc
- TaxService: getRateForLocation (by tax category), calculateTax

Routes:
- POST/GET /transactions, GET /transactions/:id, GET /transactions/:id/receipt
- POST /transactions/:id/line-items, DELETE /transactions/:id/line-items/:id
- POST /transactions/:id/discounts, /complete, /void
- POST /drawer/open, POST /drawer/:id/close, GET /drawer/current, GET /drawer
- CRUD /discounts + GET /discounts/all
- GET /products/lookup/upc/:upc (barcode scanner support)

All routes gated by pos.view/pos.edit/pos.admin + withModule('pos').
POS module already seeded in migration 0026.

Still needed: bun install, drizzle-kit generate + migrate, tests, lint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 16:26:38 +00:00
Ryan Moon
93450a1eb7 feat: add nano, vim, htop, zip, netcat, dnsutils, ping to devpod
All checks were successful
Build Devpod / build (push) Successful in 3m9s
Build & Release / build (push) Successful in 16s
2026-04-04 10:47:20 -05:00
Ryan Moon
7aa81c4e7c docs: add infrastructure, build pipeline, and dev box sections to CLAUDE.md
All checks were successful
Build & Release / build (push) Successful in 15s
2026-04-04 10:30:40 -05:00
Ryan Moon
b318345fdf fix: use haproxy to strip PROXY protocol before sshd — nginx sends PROXY headers on all TCP
All checks were successful
Build Devpod / build (push) Successful in 3m0s
Build & Release / build (push) Successful in 17s
2026-04-04 10:04:42 -05:00
Ryan Moon
cc5ab41da4 fix: enable PermitRootLogin for SSH key access
All checks were successful
Build Devpod / build (push) Successful in 8s
Build & Release / build (push) Successful in 16s
2026-04-04 09:49:29 -05:00
Ryan Moon
c54069ad99 fix: switch code-server to no-auth, Cloudflare Access handles authentication
All checks were successful
Build Devpod / build (push) Successful in 9s
Build & Release / build (push) Successful in 16s
2026-04-04 09:10:48 -05:00
Ryan Moon
04420dbd12 fix: push versioned devpod tag per build to avoid DOCR tag caching
All checks were successful
Build & Release / build (push) Successful in 18s
2026-04-04 09:04:55 -05:00
Ryan Moon
f538c60f3d fix: bootstrap .profile and .gitconfig on fresh PVC
All checks were successful
Build Devpod / build (push) Successful in 8s
Build & Release / build (push) Successful in 16s
2026-04-04 08:56:20 -05:00
Ryan Moon
1524153cfb fix: bootstrap .bashrc and PATH on fresh PVC mount
All checks were successful
Build Devpod / build (push) Successful in 7s
Build & Release / build (push) Successful in 15s
2026-04-04 08:55:26 -05:00
Ryan Moon
4c31357428 fix: create .ssh dir before writing authorized_keys
All checks were successful
Build Devpod / build (push) Successful in 9s
Build & Release / build (push) Successful in 16s
2026-04-04 08:54:52 -05:00
Ryan Moon
b3e67d1483 fix: set workdir and code-server root to /root for persistent home
All checks were successful
Build Devpod / build (push) Successful in 19s
Build & Release / build (push) Successful in 16s
2026-04-04 08:43:36 -05:00
Ryan Moon
3d081ee01f fix: push devpod image to manager repo as devpod-latest tag
All checks were successful
Build & Release / build (push) Successful in 18s
2026-04-04 08:36:08 -05:00
Ryan Moon
9942a5638f feat: add psql, redis-cli, helm, k9s to devpod image
Some checks failed
Build & Release / build (push) Failing after 8s
Build Devpod / build (push) Failing after 6s
2026-04-04 07:14:12 -05:00
Ryan Moon
b40bab0391 feat: add devpod image — code-server, Claude Code, bun, kubectl
Some checks failed
Build & Release / build (push) Successful in 22s
Build Devpod / build (push) Failing after 5s
2026-04-04 06:56:56 -05:00
Ryan Moon
de70fb47f9 fix: switch from compiled bun binary to bun run to fix Fastify plugin name crash
All checks were successful
Build & Release / build (push) Successful in 1m11s
2026-04-03 21:52:50 -05:00
Ryan Moon
c5d618698b fix: remove untagged manifest cleanup, deletes tagged chart by shared digest
All checks were successful
Build & Release / build (push) Successful in 26s
2026-04-03 21:46:41 -05:00
Ryan Moon
54943ea1b7 fix: clean up untagged helm OCI manifests after chart push
All checks were successful
Build & Release / build (push) Successful in 30s
2026-04-03 21:40:21 -05:00
Ryan Moon
ba1c385937 fix: simplify CI to use run number for versioning, remove commit-back step
All checks were successful
Build & Release / build (push) Successful in 28s
2026-04-03 21:36:23 -05:00
lunarfront-bot
2231f06234 chore: bump version to v0.1.1
All checks were successful
Build & Release / build (push) Has been skipped
2026-04-04 02:31:04 +00:00
Ryan Moon
fe29e548fb revert: remove incorrect /api ingress rule, frontend nginx handles /v1 proxy
Some checks failed
Build & Release / build (push) Has been cancelled
2026-04-03 21:29:19 -05:00
Ryan Moon
3d72f04b14 fix: add /api ingress path routing to backend 2026-04-03 21:29:19 -05:00
lunarfront-bot
36eb377583 chore: bump version to v0.1.0
All checks were successful
Build & Release / build (push) Has been skipped
2026-04-04 01:08:32 +00:00
Ryan Moon
b8f0c7ecba feat: add Spaces env vars to backend deployment
All checks were successful
Build & Release / build (push) Successful in 18s
2026-04-03 20:07:32 -05:00
lunarfront-bot
0034e0b8b3 chore: bump version to v0.0.29
All checks were successful
Build & Release / build (push) Has been skipped
2026-04-04 00:49:46 +00:00
Ryan Moon
d9a7409f9c chore: remove valkey chart templates
Some checks failed
Build & Release / build (push) Has been cancelled
2026-04-03 19:48:48 -05:00
Ryan Moon
358e07b1d5 feat: remove per-customer valkey, use managed Valkey with REDIS_KEY_PREFIX 2026-04-03 19:48:48 -05:00
lunarfront-bot
5df914a40f chore: bump version to v0.0.28
All checks were successful
Build & Release / build (push) Has been skipped
2026-04-04 00:47:43 +00:00
Ryan Moon
1f8002629f fix: add libstdc++ to runtime image for bun compiled binary
All checks were successful
Build & Release / build (push) Successful in 1m52s
2026-04-03 19:45:48 -05:00
lunarfront-bot
ff2e4586f3 chore: bump version to v0.0.27
All checks were successful
Build & Release / build (push) Has been skipped
2026-04-04 00:36:04 +00:00
Ryan Moon
019867f1fa fix: update GIT_REMOTE to git.lunarfront.tech
Some checks failed
Build & Release / build (push) Has been cancelled
2026-04-03 19:35:45 -05:00
Ryan Moon
48d49a068a fix: include chart files in version bump commit to prevent rebase conflict
Some checks failed
Build & Release / build (push) Failing after 16s
2026-04-03 19:34:31 -05:00
11f81cfd8e Merge pull request 'feat: add Helm chart and switch image builds to DOCR' (#3) from fix/ci-only-on-pr into main
Some checks failed
Build & Release / build (push) Failing after 16s
Reviewed-on: #3
2026-04-03 23:56:55 +00:00
Ryan Moon
1601e0f849 feat: add Helm chart and switch image builds to DOCR
All checks were successful
CI / ci (pull_request) Successful in 18s
CI / e2e (pull_request) Successful in 1m1s
- Add chart/ with backend, frontend, valkey deployments, services, and ingress
- Update nginx.conf to use BACKEND_URL env var via envsubst
- Update Dockerfile.frontend to use nginx template mechanism
- Build.yml: switch Docker registry from Gitea to DOCR, add helm package+push step
2026-04-03 18:53:47 -05:00
lunarfront-bot
0e3a8d7504 chore: bump version to v0.0.26
All checks were successful
Build & Release / build (push) Has been skipped
2026-04-03 01:36:38 +00:00
Ryan Moon
87456e3aac fix: add DOCKER_HOST to build job env
Some checks failed
Build & Release / build (push) Has been cancelled
2026-04-02 20:28:27 -05:00
d7249088e9 Merge pull request 'fix: use REGISTRY and GIT_REMOTE vars, point to git2.lunarfront.tech' (#2) from fix/ci-only-on-pr into main
Some checks failed
Build & Release / build (push) Failing after 8s
Reviewed-on: https://git2.lunarfront.tech/ryan/lunarfront-app/pulls/2
2026-04-03 01:27:02 +00:00
Ryan Moon
59ea9557d1 fix: use REGISTRY and GIT_REMOTE vars, point to git2.lunarfront.tech
All checks were successful
CI / ci (pull_request) Successful in 1m27s
CI / e2e (pull_request) Successful in 1m18s
2026-04-02 19:50:53 -05:00
628c090dfd Merge pull request 'fix/ci-only-on-pr' (#1) from fix/ci-only-on-pr into main
Some checks failed
Build & Release / build (push) Failing after 7s
Reviewed-on: https://git2.lunarfront.tech/ryan/lunarfront-app/pulls/1
2026-04-03 00:47:43 +00:00
Ryan Moon
9fc42b7881 fix: set DOCKER_HOST for e2e job to use dind TCP endpoint
All checks were successful
CI / ci (pull_request) Successful in 29s
CI / e2e (pull_request) Successful in 58s
2026-04-02 19:09:30 -05:00