---
tags: [products, model]
module: Products
---

# [Model]WarehouseProduct

## Connections
[[_Products]] · [[[Model]Product]] · [[[Observer]Observers]] · [[[Repo]Repositories]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/Products/Models/WarehouseProduct.php`

## Responsibilities
- Junction: Product × Warehouse × CostCenter
- Per-warehouse stock: quantity, minimum_quantity, selling_price, buying_price, total_cost, average_cost
- Low-stock notification trigger via WarehouseProductObserver
- Used by ProductRecipe as ingredient source
- AuditableTrait, SoftDeletes, UsesTenantConnection

## Key Relationships
| Relation | Type | Target |
|---|---|---|
| product | belongsTo | [[[Model]Product]] |
| warehouse | belongsTo | [[[Model]Warehouse]] (Inventory) |
| costCenter | belongsTo | [[[Model]CostCenter]] |
| inventoryAccount | belongsTo | [[[Model]Account]] (Accounting) |

## Key Methods
- `canBeDeleted()` — checks WarehouseProductLog for transaction history
- Attribute setters use `trimNumber()` for decimal precision
- Custom increment/decrement triggers observer for notification checks
