# Real tenant lots validation - 2026-05-05

Scope:
- Read-only validation over local real-data tenant databases matching `farmacia_*`.
- No controlled purchase/sale/transfer writes were executed against real-data tenants.

Command note:
- `php artisan lots:health-check --tenant=farmacia_demo` returned `No se encontraron tenants.`
- Reason: local `enterfarmaplus.websites` only has `tenancy_demo` and `tenancy_jena`; the `farmacia_*` databases exist in MySQL but are not registered as tenancy website UUIDs in this local system DB.

Blocking finding:
- All 12 `farmacia_*` databases are missing table `item_lots_group_warehouse`.
- All 12 have `pivot_migration_rows = 0` for the warehouse-lot pivot migration.
- Because of this, the required legacy-vs-pivot query cannot be executed on these real-data tenants.
- Reports and flows that depend on per-warehouse lot pivot cannot be validated there yet.

Critical data finding:
- `farmacia_noriega` has 5 legacy negative lots:
  - id `131`, code `24505001`, item_id `150`, quantity `-16`
  - id `279`, code `2012445`, item_id `444`, quantity `-7`
  - id `339`, code `2120874`, item_id `504`, quantity `-6`
  - id `282`, code `50264`, item_id `447`, quantity `-4`
  - id `346`, code `10115985`, item_id `511`, quantity `-2`

Conclusion:
- Point 14 is not validated as OK on real-data tenants.
- Current state is blocked before flow validation.
- Required next steps are to apply the lot-pivot migration/backfill on a selected real tenant or staging copy, resolve negative lots, then re-run `lots:health-check`, the legacy-vs-pivot SQL, and controlled flows.
