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
This commit is contained in:
Ryan Moon
2026-03-28 09:49:34 -05:00
parent c7b460c0bf
commit f4e5a57846
3 changed files with 124 additions and 16 deletions

View File

@@ -224,9 +224,26 @@ timestamptz
Individual physical units for serialized items and rental fleet instruments.
id, product_id, company_id, location_id, serial_number,condition (new|excellent|good|fair|poor),status (available|sold|rented|on_trial|in_repair|layaway|lost|retired),purchase_date, purchase_cost, notes,legacy_id, created_at
id, product_id, company_id, location_id, serial_number, condition (varchar — references item_condition lookup), status (varchar — references inventory_unit_status lookup), purchase_date, purchase_cost, notes, legacy_id, created_at
### Status Values
**Note:** `condition` and `status` are stored as varchar columns referencing slug values in lookup tables (not pgEnums). This allows stores to add custom statuses and conditions. Code references system slugs for business logic; custom values are informational.
### Lookup Tables
Both `inventory_unit_status` and `item_condition` are company-scoped lookup tables with the pattern:
Column | Type | Notes
id | uuid PK |
company_id | uuid FK | Tenant scoping
name | varchar | Display name
slug | varchar | Code-level reference (unique per company)
description | text |
is_system | boolean | True = seeded by system, cannot be deleted or deactivated
sort_order | integer | Display ordering
is_active | boolean |
created_at | timestamptz |
### System Status Values (seeded per company)
Status | Description | Set By
available | In stock, ready for sale or rental | Default, return, restock
@@ -238,6 +255,15 @@ layaway | Reserved for layaway customer, not available | Layaway creation (08_Do
lost | Unrecovered — trial, rental, or inventory discrepancy | Overdue escalation or cycle count
retired | Permanently removed from inventory | Manual retirement
### System Condition Values (seeded per company)
Condition | Description
new | Brand new, unopened or unused
excellent | Like new, minimal signs of use
good | Normal wear, fully functional
fair | Noticeable wear, functional with minor issues
poor | Heavy wear, may need repair
# 4. Repair Parts Inventory