Commit Graph

10 Commits

Author SHA1 Message Date
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