# 08 — Commission Integration (Shell Only)

**Domain:** Commission Integration · **Phase 1 = shell/hooks only**  
**Owners:** Sharif (rule shell) · Ashraful (earning shell + payment hook) · Bablu (rule FE)  
**Full engine:** `PMS-COMM-EPIC` → Commissioning module (see Commissioning SRS)  
**Implementation plan (stub-first):** [COMMISSIONING_IMPLEMENTATION_PLAN.md](../commission/COMMISSIONING_IMPLEMENTATION_PLAN.md)

## PMS Phase 1 owns
Commission Rule **shell** · Earning Record **shell** · Payment Cleared **integration hook**

## Commissioning owns (NOT Phase 1)
Calculation, eligibility, duration engine, redistribution, salary/fund allocation, vesting, settlement, ledger

### PMS-API-1.4 — Commission Rules Shell API Contract Lock

**Task ID:** PMS-API-1.4
**Domain:** 08/11
**Feature:** Commission Rule Shell
**Workstream:** API Contract
**Task Title:** Commission Rules Shell API Contract Lock
**Description:** NEW STRUCTURAL. CRUD only — no calculate endpoint.
**Owner:** Sharif
**Lane:** C
**Priority:** P1
**Estimate:** 1.00h
**Dependency:** API-0; 1.3 for designation refs
**Dependency Type:** HARD/SOFT
**Specification Reference:** SRS §22–§23; card 1.4-BE
**Business Rule Reference:** Rule ≠ earning
**API Contract Reference:** Self
**Acceptance Criteria**
- No Generate Commission endpoint in contract
**Definition of Done:** In 11-api.md
**Git Ownership / File Ownership:** `commission_rules` → Sharif
**Git Conflict Risk:** LOW
**Parallelization Notes:** Unlocks 1.4-FE

_Detail card:_ `docs/projects/PMS_PHASE1_TASK_CARDS.md` → `PMS-API-1.4`

---

### PMS-1.4-BE — Commission Rules Shell — Backend

**Task ID:** PMS-1.4-BE
**Domain:** 08. Commission Integration
**Feature:** Commission Rule Shell
**Workstream:** Backend
**Task Title:** Commission Rules Shell — Backend
**Description:** Store configurable rules; no earning generation.
**Owner:** Sharif
**Lane:** C
**Priority:** P1
**Estimate:** 6.00h
**Dependency:** 1.3-BE SOFT; API-1.4 SOFT; 0.1 HARD
**Dependency Type:** SOFT/HARD
**Specification Reference:** SRS §22–§23
**Business Rule Reference:** percentage XOR fixed; effective dating
**API Contract Reference:** PMS-API-1.4
**Acceptance Criteria**
- CRUD works
- No service calculates payouts
**Definition of Done:** Global BE DoD
**Git Ownership / File Ownership:** `commission_rules`
**Git Conflict Risk:** LOW
**Parallelization Notes:** Off critical path of Contract spine

_Detail card:_ `docs/projects/PMS_PHASE1_TASK_CARDS.md` → `PMS-1.4-BE`

---

### PMS-1.4-FE — Commission Rules Shell — Frontend

**Task ID:** PMS-1.4-FE
**Domain:** 08. Commission Integration
**Feature:** Commission Rule Shell UI
**Workstream:** Frontend
**Task Title:** Commission Rules Shell — Frontend
**Description:** Config UI labeled rules-only.
**Owner:** Bablu
**Lane:** D
**Priority:** P2
**Estimate:** 5.00h
**Dependency:** API-1.4 SOFT; 1.4-BE SOFT
**Dependency Type:** SOFT
**Specification Reference:** Card 1.4-FE
**Business Rule Reference:** No Calculate button
**API Contract Reference:** PMS-API-1.4
**Acceptance Criteria**
- No calculate/generate primary action
**Definition of Done:** Global FE DoD
**Git Ownership / File Ownership:** FE commission rules
**Git Conflict Risk:** LOW
**Parallelization Notes:** Defer if FE overloaded

_Detail card:_ `docs/projects/PMS_PHASE1_TASK_CARDS.md` → `PMS-1.4-FE`

---

### PMS-5.1-BE — Commission Earning Records Shell — Backend

**Task ID:** PMS-5.1-BE
**Domain:** 08. Commission Integration
**Feature:** Earning Record Shell
**Workstream:** Backend
**Task Title:** Commission Earning Records Shell — Backend
**Description:** Separate earning rows; finalized immutable vs rule edits; no full engine.
**Owner:** Ashraful
**Lane:** A
**Priority:** P1
**Estimate:** 6.00h
**Dependency:** 1.4-BE SOFT; 2.5-BE HARD preferred; 
**Dependency Type:** SOFT/HARD
**Specification Reference:** SRS §30 BR-15; card 5.1-BE
**Business Rule Reference:** BR-15
**API Contract Reference:** Document in 11-api.md (earning shell)
**Acceptance Criteria**
- Rule update does not change finalized earning_amount
**Definition of Done:** Global BE DoD
**Git Ownership / File Ownership:** `commission_earning_records` → Ashraful
**Git Conflict Risk:** LOW
**Parallelization Notes:** After share exists

_Detail card:_ `docs/projects/PMS_PHASE1_TASK_CARDS.md` → `PMS-5.1-BE`

---

### PMS-5.2-BE — Payment Cleared Integration Hook

**Task ID:** PMS-5.2-BE
**Domain:** 08. Commission Integration
**Feature:** Payment Cleared Hook
**Workstream:** API / Integration
**Task Title:** Payment Cleared Integration Hook
**Description:** Event/interface only; no-op listener OK; no fake distribution.
**Owner:** Ashraful
**Lane:** A
**Priority:** P2
**Estimate:** 3.00h
**Dependency:** 5.1-BE SOFT
**Dependency Type:** SOFT
**Specification Reference:** Commission plan Phase 9; card 5.2-BE
**Business Rule Reference:** Calc starts only on cleared payment (future)
**API Contract Reference:** Event payload in 11-api.md
**Acceptance Criteria**
- No duplicate payment module
- Listener does not fake full commission
**Definition of Done:** Interface/event documented + stub
**Git Ownership / File Ownership:** Events/listeners under Project module (Ashraful)
**Git Conflict Risk:** LOW
**Parallelization Notes:** Thin; end of spine

_Detail card:_ `docs/projects/PMS_PHASE1_TASK_CARDS.md` → `PMS-5.2-BE`

---

### PMS-COMM-EPIC — Phase 2 — Commission Engine Epic

**Task ID:** PMS-COMM-EPIC
**Domain:** 08. Commission Integration
**Feature:** Full Commission Engine
**Workstream:** Epic (Phase 2)
**Task Title:** Phase 2 — Commission Engine Epic
**Description:** Parent only. Commissioning module. Do not implement in Phase 1.
**Owner:** —
**Lane:** —
**Priority:** Phase 2
**Estimate:** 0.00h
**Dependency:** PMS-QA-1
**Dependency Type:** HARD (phase gate)
**Specification Reference:** Commissioning SRS
**Business Rule Reference:** Full engine boundary
**API Contract Reference:** N/A Phase 1
**Acceptance Criteria**
- Not started until Phase 1 QA passes and formulas signed off
**Definition of Done:** N/A
**Git Ownership / File Ownership:** N/A
**Git Conflict Risk:** N/A
**Parallelization Notes:** Out of Phase 1

_Detail card:_ `docs/projects/PMS_PHASE1_TASK_CARDS.md` → `PMS-COMM-EPIC`

---
