18 Commits

Author SHA1 Message Date
Ryan Moon
ec09e319ed Update accounting planning doc v2 — fix AP/safe accounts, add periods, tax rates, gift cards, consignment, posting service 2026-03-30 19:41:23 -05:00
Ryan Moon
89b412374a Expand POS planning — discounts, returns, cash management, training mode, customer display, quick keys 2026-03-30 19:15:13 -05:00
Ryan Moon
07f199b69d Add PIN unlock flow to POS frontend planning 2026-03-30 19:12:17 -05:00
Ryan Moon
ae3c85fee0 Add frontend strategy planning doc — admin, POS, floor app 2026-03-30 19:08:16 -05:00
Ryan Moon
9400828f62 Rename Forte to LunarFront, generalize for any small business
Rebrand from Forte (music-store-specific) to LunarFront (any small business):
- Package namespace @forte/* → @lunarfront/*
- Database forte/forte_test → lunarfront/lunarfront_test
- Docker containers, volumes, connection strings
- UI branding, localStorage keys, test emails
- All documentation and planning docs

Generalize music-specific terminology:
- instrumentDescription → itemDescription
- instrumentCount → itemCount
- instrumentType → itemCategory (on service templates)
- New migration 0027_generalize_terminology for column renames
- Seed data updated with generic examples
- RBAC descriptions updated
2026-03-30 08:51:54 -05:00
Ryan Moon
591be589f0 Add vault password manager planning doc (on-prem only) 2026-03-29 12:17:25 -05:00
Ryan Moon
dd03fb79ef Add audit trail planning doc for database change history
Application-level audit logging with 30-day default retention. Captures
insert/update/delete on all domain tables with field-level diffs, user
attribution, and request ID correlation. Sensitive fields masked.
Configurable retention, BullMQ cleanup job, admin UI for querying.
2026-03-28 16:26:31 -05:00
Ryan Moon
693121ec14 Add permissions and RBAC planning doc
Granular permission system: domain.action pattern (accounts.view, pos.edit,
repairs.admin). Custom roles composed of permissions. Default system roles
(Admin, Manager, Sales Associate, Technician, Instructor, Viewer). Migration
plan from current role enum. API and frontend guard patterns.
2026-03-28 16:06:23 -05:00
Ryan Moon
5aadd68128 Add email system planning doc for transactional and mass email
Provider abstraction (SMTP, SendGrid, SES, Postmark), email templates with
merge fields, BullMQ queue for async sending, mass email campaigns with
recipient filtering, CAN-SPAM unsubscribe management, email logging.
2026-03-28 15:38:54 -05:00
Ryan Moon
6adce51e6c Add member profile photo to planning docs
profile_image_file_id on member table, entity_type=member category=profile
in file storage. UI shows silhouette placeholder when empty.
2026-03-28 15:34:57 -05:00
Ryan Moon
de4d2e0a32 Add file storage architecture planning doc
Defines storage provider abstraction (local filesystem + S3), file table
schema, path conventions per entity, upload/download API, image processing,
backup/restore CLI, and domain integration plan. Covers member IDs, product
photos, rental agreements, repair tickets, and all future file needs.
2026-03-28 13:50:58 -05:00
Ryan Moon
f4e5a57846 Update planning docs to reflect current implementation state
- Doc 02: Add member_identifier table, member_number, primary_member_id,
  account_number auto-generation, isMinor override, tax_exemption as
  separate table, member move, updated business rules
- Doc 03: Document lookup table pattern replacing pgEnums for status and
  condition, add system/custom value distinction
- Doc 22: Mark all Phase 2 items as complete, add new tables to additions
  section, update audit findings, note admin frontend exists
2026-03-28 09:49:34 -05:00
Ryan Moon
e7853f59f2 Add planning docs for trade-ins, returns, tax exemptions, cycle counts, POs, bundles, backorders, barcode labels, instrument sizing, warranties, maintenance schedules, gift cards, layaway, rental agreements, and in-home trials 2026-03-27 20:53:01 -05:00
Ryan Moon
c34ad27b86 Fix auth security issues, add rate limiting, write Phase 2 audit
Security fixes:
- Register route validates company exists before creating user
- Rate limiting on auth routes (10 per 15min per IP)
- Dev auth plugin guards against production use
- Main.ts throws if JWT_SECRET missing in production

Added Phase 2 audit doc (22) covering:
- Built vs planning doc comparison
- Security review with fixes applied
- Duplicate code patterns identified
- Standard POS feature gap analysis
- Music-specific feature gaps

33 tests passing.
2026-03-27 19:21:33 -05:00
Ryan Moon
dcc3dd1eed Add sales commission planning doc
Commission is default for most products. Simple model: employee
rate × sale price. Override table for exceptions (consignment at 0%,
category-level adjustments). Commission snapshotted at time of sale.
2026-03-27 18:38:12 -05:00
Ryan Moon
5c775f0c60 Add consignment domain planning doc
Covers consignment lifecycle, settlement workflow, POS integration,
accounting journal entries (commission income vs consignment payable),
reporting, and business rules. Consignment items use account entity
for consignors (not suppliers).
2026-03-27 18:32:22 -05:00
Ryan Moon
81894a5d23 Update planning docs for processor-agnostic payment linking
Replace stripe_customer_id on account with account_processor_link
table. Update account_payment_method to use processor enum +
processor_payment_method_id instead of Stripe-specific fields.
Supports multiple simultaneous processors for migration scenarios.
2026-03-27 17:45:00 -05:00
Ryan Moon
5f8726ee4e Add planning documents for Forte music store platform
17 domain design docs covering architecture, accounts, inventory,
rentals, lessons, repairs, POS, payments, batch repairs, delivery,
billing, accounting, deployment, licensing, installer, and backend
tech architecture. Plus implementation roadmap (doc 18) and
personnel management (doc 19).

Key design decisions documented:
- company/location model (multi-tenant + multi-location)
- member entity (renamed from student to support multiple adults)
- Stripe vs Global Payments billing ownership differences
- User/location/terminal licensing model
- Valkey 8 instead of Redis
2026-03-27 14:51:23 -05:00