# Project Fix Summary (2026-03-29)

## Root cause found
The live database schema is older than the current Laravel code.

Main mismatch:
- master forms save `status` as `Active` / `Inactive`
- legacy tables (`categories`, `brands`, `colors`, `sizes`, `units`, `suppliers`) were created with boolean/integer `status`
- result: insert/update crashes like `Incorrect integer value: 'Active'`

## Updated in this patch
Added migration:
- `database/migrations/2026_03_29_190000_normalize_legacy_pos_schema_for_forms.php`

This migration:
- converts legacy `status` values to `Active` / `Inactive`
- changes `status` columns to `VARCHAR(20)` for MySQL
- adds missing `code` columns to master tables
- adds missing supplier fields
- adds missing customer fields
- adds missing product relation/unit-conversion fields if absent

## Deploy steps
1. Upload updated project
2. Run:
   - `php artisan migrate --force`
   - `php artisan optimize:clear`
3. Test these pages:
   - `/admin/units`
   - `/admin/categories`
   - `/admin/brands`
   - `/admin/colors`
   - `/admin/sizes`
   - `/admin/suppliers`
   - `/admin/customers`
   - `/admin/products/create`

## Important
This patch is written to preserve existing data and normalize the live schema instead of dropping tables.
