ryan 7d9aeaf188 feat: named registers, X/Z reports, daily rollup, fix drawerSessionId
Registers:
- New register table with location association
- CRUD service + API routes (POST/GET/PATCH/DELETE /registers)
- Drawer sessions now link to a register via registerId
- Register ID persisted in localStorage per device

X/Z Reports:
- ReportService with getDrawerReport() (X or Z depending on session state)
- Z report auto-displayed on drawer close in the drawer dialog
- X report (Current Shift Report) button on open drawer view
- Report shows: sales summary, payment breakdown, discounts, cash accountability, adjustments

Daily Rollup:
- ReportService.getDailyReport() aggregates all sessions at a location for a date
- New /reports/daily endpoint with locationId + date params
- Frontend daily report page with date picker, location selector, session breakdown

Critical Fix:
- drawerSessionId is now populated on transactions when completing (was never set before)
- This enables accurate per-drawer reporting and cash accountability

Migration 0044: register table, drawer_session.register_id column

Tests: 14 new (register CRUD, drawer report X/Z, drawerSessionId population, daily rollup, register-drawer link)
Full suite: 367 passed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 16:05:19 +00:00

LunarFront

Small business management platform — POS, inventory, rentals, scheduling, repairs, and accounting.

Built by Lunarfront Tech LLC.

Tech Stack

  • Runtime: Bun
  • Language: TypeScript (end-to-end)
  • API: Fastify + Drizzle ORM + PostgreSQL 16
  • Frontend: React + TanStack Router + TanStack Query
  • Validation: Zod (shared schemas)
  • Queue/Cache: BullMQ + Valkey 8
  • Monorepo: Turborepo + Bun workspaces

Quick Start

bun install
cp .env.example .env       # configure DATABASE_URL, REDIS_URL, JWT_SECRET
cd packages/backend && bunx drizzle-kit migrate
bun run dev                # starts backend (:8000) + admin UI (:5173)

Packages

Package Description
packages/backend Fastify API server
packages/admin Admin UI (React + Vite)
packages/shared Zod schemas, types, shared utils

Documentation

Doc Description
Setup Prerequisites, environment, installation, running
Architecture Monorepo structure, backend/frontend design, state management
API Reference All endpoints, pagination, auth, permissions
Database Schema overview, migrations, multi-tenancy
Testing Test runner, suites, writing tests, assertions

Commands

bun run dev       # start all packages in dev mode
bun run test      # run all tests
bun run lint      # lint all packages
bun run format    # format with Prettier

License

Proprietary. All rights reserved.

Description
No description provided
Readme 23 MiB
Languages
TypeScript 99.2%
Shell 0.5%
CSS 0.2%