# Distributor Partner Program — Phase 1

Live Prawn Magento staging/production foundation document.

**Status:** Phase 1 foundation only — not publicly live.

**Operating model:** Admin / manual only — not for public self-signup.

---

## Operating decision (admin / manual only)

The Distributor Partner Program is **admin-managed**. Customers are reviewed and enrolled manually. There is no public self-service activation flow unless Kenny explicitly changes direction later.

### Rules

1. This program is **not for public self-signup**.
2. Activation products must **remain disabled**.
3. CMS page must **remain inactive** unless Kenny later approves public-facing marketing only.
4. Customers should be **manually reviewed** before joining.
5. Admin manually assigns customer group:
   - **Starter Distributor** — group ID **11**
   - **Master Distributor** — group ID **12**
6. Welcome credit is **not automatically redeemable** yet.
7. Growth rewards are **not automatic** yet.
8. **No public checkout activation flow** should be built unless Kenny explicitly changes direction.
9. **Do not add** this page to the menu.
10. **Do not expose** the activation products on the storefront.

### Manual enrollment (current process)

1. Review applicant (business fit, tier, terms).
2. In Magento Admin → Customers → edit customer → assign group **11** (Starter) or **12** (Master).
3. Record welcome credit, MOQ, and growth rewards **offline** until Phase 2 systems exist (if approved).
4. Keep activation products disabled and CMS page inactive unless Kenny approves otherwise.

---

## Program structure

Two-tier simplified distributor program (old Starter / Growth / Master three-package model is cancelled).

| | Starter Distributor | Master Distributor |
|---|---------------------|---------------------|
| **Joining fee** | RM500 | RM1,500 |
| **Welcome credit** | RM500 | RM1,650 |
| **Credit usage cap** | Up to **3%** of order value per order | Up to **5%** of order value per order |
| **Minimum order** | 50kg | 200kg |
| **Allowed to sell to** | End users only | Restaurants and end users |

### Credit cap interpretation (not a catalog discount)

Welcome credit reduces payable amount on future orders, capped per order:

- **Starter:** RM1,000 order → maximum RM30 credit usable
- **Master:** RM1,000 order → maximum RM50 credit usable

This is **not** a standing product price discount in Phase 1.

### Growth target rewards (documented only — not automated in Phase 1)

| Monthly volume | Starter reward | Master reward |
|----------------|----------------|---------------|
| 300kg | Free 3kg prawn | Free 4kg prawn |
| 550kg | Free 6kg prawn | Free 7kg prawn |
| 1,000kg | Free 10kg prawn | Free 12kg prawn |

---

## Phase 1 artifacts

### Customer groups (create if missing)

| Code | Purpose |
|------|---------|
| `Starter Distributor` | Package 1 tier |
| `Master Distributor` | Package 2 tier |

**Do not reuse** Distribution (ID 4), Wholesale, or Retailer groups.

### Activation products (disabled, not visible)

| SKU | Name | Price | Status |
|-----|------|-------|--------|
| `distributor-starter-activation` | Starter Distributor Activation | RM500 | Disabled |
| `distributor-master-activation` | Master Distributor Activation | RM1,500 | Disabled |

Both are virtual products with tax class None (0), not visible individually. **Must remain disabled** — not exposed on storefront; not used for public checkout activation.

### CMS page (inactive draft)

| Field | Value |
|-------|-------|
| Title | Distributor Partner Program |
| URL key | `distributor-partner-program` |
| Layout | `cms-full-width` |
| Active | **No** |
| Menu | **Not linked** |

Content includes hero, two package cards, growth rewards table, non-cash credit note, and placeholder CTAs only.

### Deploy script

```
scripts/deploy-distributor-partner-phase1.php
```

Idempotent. Writes JSON report to:

```
var/log/liveprawn-distributor-phase1.json
```

---

## What Phase 1 intentionally does **not** enable

- No checkout activation or order-complete observer
- No welcome credit ledger or redemption
- No MOQ enforcement (50kg / 200kg)
- No growth reward tracking or automation
- No admin grids or reports
- No public menu link
- No product enablement
- No CMS page publish
- No new Magento module
- No DB schema changes
- No changes to Distribution group (ID 4)
- No changes to Restaurant Credit Terms products (106–108)
- No changes to prawn catalog prices (SKUs 75–94)
- No changes to LivePrawn_CustomerRewards premium flow
- No restaurant commission changes

---

## Phase 2 backlog (separate approval — only if Kenny changes direction)

**Default path:** Continue admin/manual enrollment. The items below are **not approved** unless Kenny explicitly requests them.

1. ~~**Public checkout activation**~~ — **Not planned** unless direction changes (order-complete handler + enabled products)
2. **Welcome credit ledger** — balance tracking separate from retail rewards (manual until built)
3. **Credit redemption cap** — checkout integration for 3% / 5% per-order cap
4. **MOQ enforcement** — quote/checkout validation (50kg / 200kg)
5. **Growth reward tracking** — monthly kg aggregation + free prawn issuance
6. ~~**Public menu link**~~ — **Not planned** unless CMS page is approved for marketing only
7. **Admin report** — enrollments, credit balance, volume tiers (supports manual operations)

---

## Deploy instructions

From project root:

```bash
cd /var/www/html/airbenih_stg
php scripts/deploy-distributor-partner-phase1.php
```

**`setup:upgrade` is not required** for Phase 1 (no module or schema changes).

Optional after deploy (only if needed for admin CMS preview):

```bash
php bin/magento cache:clean config layout block_html full_page
```

---

## Out of scope / do not touch

- `LivePrawn_CondoGroupBuy`
- `LivePrawn_CustomerRewards` premium activation flow
- Restaurant commission tracking
- Products 106, 107, 108 (Restaurant Credit Terms)
- Customer group ID 4 (Distribution)
- Prawn product tier/base prices

---

## Deployment record

<!-- DEPLOYMENT_RECORD_START -->
## Deployment record

Last run: 2026-07-07 12:57:45 UTC

### Created resources

| Item | Result |
|------|--------|
| Starter Distributor group | **Created** — ID **11** |
| Master Distributor group | **Created** — ID **12** |
| `distributor-starter-activation` | **Created** — product ID **109**, **disabled**, not visible individually |
| `distributor-master-activation` | **Created** — product ID **110**, **disabled**, not visible individually |
| CMS page `distributor-partner-program` | **Created** — page ID **60**, **inactive** |

### Log and site status (post-deploy)

| Item | Value |
|------|-------|
| JSON report | `var/log/liveprawn-distributor-phase1.json` |
| liveprawn.com (homepage) | **200** |
| liveprawn.com/admin | **200** |
| `/distributor-partner-program` (storefront) | **404** (expected — page inactive) |

### Post-deploy cache (2026-07-07)

`php bin/magento cache:clean config layout block_html full_page` — completed successfully.
<!-- DEPLOYMENT_RECORD_END -->
