---
tags: [inventory, model]
module: Inventory
---

# [Model]WarehouseProductLog

## Connections
[[_Inventory]] · [[[Model]Warehouse]] · [[[Model]Requisition]] · [[[Service]RequisitionServices]] · [[[Enum]Enums]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/Inventory/Models/WarehouseProductLog.php`

## Responsibilities
- Immutable audit trail of every stock quantity change
- Polymorphic: entity_id + entity_type → Invoice / InvoiceReturn / Requisition / PurchaseBill / BillReturn / Manual
- Records quantity_before, quantity_after, quantity delta
- Indexed on [entity_id, entity_type]
- Auditable, SoftDeletes, UsesTenantConnection

## Key Relationships
| Relation | Type | Target |
|---|---|---|
| warehouse | belongsTo | [[[Model]Warehouse]] |
| costCenter | belongsTo | CostCenter (Products module) |
| product | belongsTo | Product (withTrashed, Products module) |
| createdBy | belongsTo | [[[Model]User]] (CompanyUser) |

## Enums
`WarehouseProductLogTypeEnum`: INBOUND, OUTBOUND

## DTO
Created via `WarehouseProductLogDTO` — validates all required fields before DB insert
