# Inventory Firebase Adapter

Infrastructure adapter for the Supply Inventory domain using Cloud Firestore.

## Philosophy

- **DUMB Adapter**: Translates Domain Entities to DTOs. No business logic.
- **Event-Driven**: Updates state based on `StockReorderRequired` and logs `StockDepleted`.

## Features

- **Repository**: `InventoryFirebaseRepository` with `saveItem`, `updateStock`, `getItemByProductId`, `logEvent`.
- **Listener**: `InventoryEventListener` listens to `StockDepleted` and `StockReorderRequired`.
- **DTO**: `InventoryItemFirestoreDTO`.

## Usage

```dart
final repo = InventoryFirebaseRepository();

// Save item
await repo.saveItem(stockItem, at: DateTime.now());

// Update stock manually (internal use)
await repo.updateStock(productId, quantity, at: DateTime.now());

// Listen to events
final listener = InventoryEventListener(repo);
// Hook up to event bus...
```
