# Restaurant Fulfillment, Packaging & Delivery Foundation v49

## Packaging
Packaging is modeled as real catalog stock variants, not descriptive text.
A packaging profile can be branch-specific or tenant-wide and can apply to an order or an item.

Applying a profile:
1. resolves the selected warehouse,
2. posts immutable stock movement for packaging variants,
3. snapshots WAC cost into `restaurant.order_packaging`,
4. preserves the source profile reference in metadata.

This makes packaging visible in stock and channel profitability.

## Delivery
Delivery job is separate from the restaurant order and supports:
- pending
- assigned
- picked_up
- delivered
- cancelled

A driver may optionally link to an application user but can also exist as operational master data.

## COD
COD fields:
- expected
- collected
- settled

Settlement can be partial and is cumulative.
v49 intentionally does not create cashbox/payment movements yet. It creates operational COD truth that a later integration can settle into Cash/Payments with explicit accounting rules.

## Fees
Delivery fee and platform fee are captured separately from the restaurant order total so later channel profitability can report:
Sales - food COGS - packaging - delivery cost - platform fees.

## Audit
Delivery lifecycle and COD settlement create immutable delivery events.

## Deferred
- cash/payments posting for COD settlement
- driver cash drawer/account
- delivery zones/routing/maps
- packaging auto-selection rules
- channel profitability read model
- third-party delivery platform webhooks
