# P2 product, warehouse and pricing import rules

Recorded 2026-10-20. Source: explicit owner instructions and read-only inspection of Catalog source workbooks. Status: confirmed source boundaries; implementation pending.

## Confirmed owner decisions
- Owner creates ERP warehouses, including new locations absent in Catalog. Reuse workflows, never seed legacy warehouse names automatically.
- Support both manual product creation and large batch imports.
- Warehouse reports supply quantity, SKU, barcode, product name and description.
- SOH supplies van, retail, wholesale and other available price types. Do not collapse them into one product price.
- Adapt reused Catalog code to ERP company context, permissions, audit and UI. Catalog is source-only; no shared writes or shared operational database.

## Inspected source evidence
A private byte-identical copy is stored in storage/app/private/reference-imports/2026-10-20/SOH-reference-2026-09-16.xlsx (33,709,321 bytes). Original: Catalog/storage/app/private/soh/WIWU_SOH_16-Sep-2026_With_824_Boxes_Ready_For_Import.xlsx.
SHA256: 415c732b134f908f21775ff420ee33232f00af12fb9b8ae2cba49ac5d6dd9c9a.
Workbook contains Active SKUs and Stop-Production SKUs. Source date is 16 September, not current stock. More recently uploaded 17 October regular/clearance files are price-list subsets, not proof of a newer complete SOH.

## Observed mapping (reference only; detect headers in implementation)
| Meaning | Active SKUs | Stop-Production SKUs |
| --- | --- | --- |
| SKU / PART NUMBER | D | D |
| BARCODE | E | E |
| DESCRIPTION / name | F | F |
| CATEGORY | G | G |
| SPECIFICATION | H | H |
| SELLING POINT | I | I |
| NEW RRP / retail price | J | J |
| WHOLESALE price | K | K |
| VAN SALES PRICE | L | L |
| DISCOUNTED PRICING | absent | M |
| Source location quantities | M:T | N:U |
| OVERALL TOTAL | U | V |
| Incoming shipments | V | W |
| Pending China orders | W | X |
| Combined current/incoming/pending total | X | Y |
| TDRA authorization / expiry / issue | Y / Z / AA | Z / AA / AB |

Headers span rows 2-4; products start at row 5 in inspected samples. Row 3 includes quantity totals, not product records. Active SKUs includes a sampled row whose explicit status is Stop Production: sheet name alone must not silently override status. Detect discrepancy for review.

## Location labels observed, not ERP warehouses to create
DIP NEW WH; WIWU-DIP WH; Power Retail Grand Stores; Power Retail Sharaf DG; GCC Power Retail; Showroom; Showroom Promotions; Outdoors van-sales team aggregate.
Some labels denote customer/consignment holdings or aggregates. Classification is an owner decision. Never add overall totals, van aggregates or future shipments to physical warehouse quantities. SOH location labels are mapping hints only; warehouse reports remain the confirmed quantity source.

## Proposed implementation slices and acceptance gates
1. Preserve existing ERP product IDs and manual entry; add reusable import profiles and typed multi-price model after schema review. SKU currently unique per company; barcode indexed, not unique. Do not change that silently.
2. Large-file analysis runs in bounded background jobs, chunked/read-only parsing without embedded image loading; preview and error export before confirm. Preserve leading zeros in identifiers, reject ambiguous SKU/barcode matches and duplicate/conflicting rows, distinguish blank and zero prices.
3. Warehouse-profile preview requires explicit current company and owner-created warehouse mapping. It may create/update reviewed product identities but must not overwrite prices. Stage quantities only until the stock ledger and opening/snapshot posting rules exist. No direct balance replacement.
4. SOH-profile preview maps prices by headers across both worksheets. It must not overwrite warehouse quantities or canonical product identity. Unknown products require explicit review, not fuzzy/AI matching. TDRA metadata is not a certificate document or proof of validity.
5. Multi-price records retain price type, currency, tax-inclusion flag, effective date, source batch and audit. Confirm VAT inclusion, currency and discount semantics with owner; do not assume all source prices include VAT or that discount is a percentage.
6. Confirmation rechecks company permission, mapping, conflicts, batch state and source checksum. Transactional and replay-safe; append immutable stock movements only when P3 foundation exists. Test cross-company denial, duplicates, replay, rollback, leading-zero barcode, layout shifts and blank versus zero.
7. Port gallery, thumbnails and PDF generation separately to ERP layout, replacing singleton CompanySetting, hard-coded locations and legacy role guards. Port relevant tests, not source migrations or production customer/stock data.

No application code, database schema, quantities or prices were changed by this inspection. No Catalog commands or test suites were executed against its production environment. Private source copy is outside public web storage and must not be committed to Git.
