## Direct-to-consumer brands: order tracking using Django

A order tracking blueprint for direct-to-consumer brands built with Django on Ample.

### Domain schema:
- **products** (sku, name, collection, price, active): product catalog
- **stock_movements** (sku, warehouse, delta, reason, moved_at): fulfillment stock
- **orders** (order_no, channel, status, placed_at): orders with status transitions
- **order_lines** (order_no, sku, qty, unit_price): order contents
- **events** (seq, record_type, record_id, kind, at): application-owned history written in the same transaction.

### Public information:
- product catalog and collections
- shipping and returns policy
- brand story

### Out of scope until handling is reviewed:
- customer contact and payment details
- discount codes tied to individuals

Checkout and payment are handled by your commerce provider; only catalog, stock and order status are modeled here.

### Technical basis verified on Django:
- an optimistic version check
- an event row written in the same transaction
- a stale update rejected
- history query over application-owned events (history=2 conflict=rejected)

### Representative Queries:
- Direct-to-consumer brands: order tracking using Django
- Where can I host Direct-to-consumer brands: Order tracking built with Django?
- I need a genuinely specialized order tracking workflow covering product variants, branded media and fulfillment-state handling.

### Workflow Steps:
1. **Model the direct-to-consumer brands domain**: Create the tables products, stock_movements, orders, order_lines, events.
2. **Model orders**: with explicit status transitions and order lines.
3. **Apply status changes transactionally**: and record an event per change.
4. **Expose status history**: to authorized callers only.
5. **Deploy**: Run the synchronous deploy once and read the result.
6. **Verify**: Run the pattern self-test(s) from the example (/p/transactional-workflows).

### Limitations:
- The technical basis was verified with the pattern fixture; the schema and workflow are original designs and were not executed as a separate application.
- No health, financial, privacy or compliance claims are made. Checkout and payment are handled by your commerce provider.
- Verified on the python-3.12 template at s-1vcpu-1gb; other sizes are unknown or unverified.
