# 06 — Contract Role & Act-As

**Domain:** Contract Role & Act-As · **BE Owner:** Munna (B) · **FE:** Bablu  
**Depends on:** Contract exists (Ashraful) + permanent teams (Munna)

## Non-negotiable
- Permanent membership unchanged by Act-As
- Contract role via `designation_id` (+ `is_act_as`)
- PM = Member of Project

## Features
Contract Team Assignment · Contract Members · Act-As · Validation · History

### PMS-API-3.3 — Contract Assignment & Act-As API Contract Lock

**Task ID:** PMS-API-3.3
**Domain:** 06/11
**Feature:** Contract Assignment
**Workstream:** API Contract
**Task Title:** Contract Assignment & Act-As API Contract Lock
**Description:** NEW STRUCTURAL. Freeze contract_team_assignments + contract_members including is_act_as.
**Owner:** Munna
**Lane:** B
**Priority:** P0
**Estimate:** 2.00h
**Dependency:** API-2.3; API-3.1
**Dependency Type:** HARD
**Specification Reference:** SRS §15, §24–§25
**Business Rule Reference:** BR-06, BR-07, BR-08
**API Contract Reference:** Self
**Acceptance Criteria**
- Act-As does not imply permanent team change in contract docs
**Definition of Done:** In 11-api.md
**Git Ownership / File Ownership:** `contract_team_assignments`, `contract_members` → Munna
**Git Conflict Risk:** LOW
**Parallelization Notes:** Unlocks 3.3-FE early

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

---

### PMS-3.3-BE — Contract Team Assignment & Act-As — Backend

**Task ID:** PMS-3.3-BE
**Domain:** 06. Act-As
**Feature:** Contract Member + Act-As
**Workstream:** Backend
**Task Title:** Contract Team Assignment & Act-As — Backend
**Description:** Selected BD/PD members with roles; Act-As across services; multi-contract OK.
**Owner:** Munna
**Lane:** B
**Priority:** P0
**Estimate:** 10.00h
**Dependency:** 2.3-BE HARD; 3.2-BE HARD; API-3.3 SOFT
**Dependency Type:** HARD
**Specification Reference:** SRS §15, §27 Rahim scenario
**Business Rule Reference:** BR-06/07/08
**API Contract Reference:** PMS-API-3.3
**Acceptance Criteria**
- Given Rahim SEO permanent When Act As DM Sales Then permanent membership unchanged
- Given same employee When on multiple contracts Then allowed with independent roles
**Definition of Done:** Global BE DoD + Act-As feature test
**Git Ownership / File Ownership:** `contract_team_assignments`, `contract_members`
**Git Conflict Risk:** MEDIUM — do not let Ashraful edit these tables
**Parallelization Notes:** Hard gate after Contract CRUD

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

---

### PMS-3.3-FE — Contract Assignment — Frontend

**Task ID:** PMS-3.3-FE
**Domain:** 06. Act-As
**Feature:** Contract Assignment UI
**Workstream:** Frontend
**Task Title:** Contract Assignment — Frontend
**Description:** Assignment tab; Act-As indicator; role selects.
**Owner:** Bablu
**Lane:** D
**Priority:** P0
**Estimate:** 8.00h
**Dependency:** API-3.3 SOFT; 3.3-BE SOFT; 2.3-FE host preferred
**Dependency Type:** SOFT
**Specification Reference:** Card 3.3-FE
**Business Rule Reference:** Permanent vs contract visual distinction
**API Contract Reference:** PMS-API-3.3
**Acceptance Criteria**
- Act As visible when home service ≠ contract service
- PM helper = Member of Project
**Definition of Done:** Global FE DoD
**Git Ownership / File Ownership:** FE assignment tab
**Git Conflict Risk:** LOW
**Parallelization Notes:** Mock from API-3.3

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

---

### PMS-3.4-BE — Assignment Validation Matrix — Backend

**Task ID:** PMS-3.4-BE
**Domain:** 06. Act-As
**Feature:** Assignment Validation
**Workstream:** Validation
**Task Title:** Assignment Validation Matrix — Backend
**Description:** Centralize assign guards.
**Owner:** Munna
**Lane:** B
**Priority:** P1
**Estimate:** 5.00h
**Dependency:** 3.3-BE HARD
**Dependency Type:** HARD
**Specification Reference:** Card 3.4-BE
**Business Rule Reference:** No assign to cancelled/terminated by default
**API Contract Reference:** PMS-API-3.3
**Acceptance Criteria**
- Clear 422 per failure mode
- Unit tests for matrix
**Definition of Done:** Validation service + unit tests
**Git Ownership / File Ownership:** Munna assignment validation classes
**Git Conflict Risk:** LOW
**Parallelization Notes:** After 3.3

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

---

### PMS-3.5-BE — Assignment History / Unassign — Backend

**Task ID:** PMS-3.5-BE
**Domain:** 06. Act-As
**Feature:** Assignment History
**Workstream:** Backend
**Task Title:** Assignment History / Unassign — Backend
**Description:** Unassign preserves history; no hard-delete of past rows.
**Owner:** Munna
**Lane:** B
**Priority:** P1
**Estimate:** 5.00h
**Dependency:** 3.3-BE HARD
**Dependency Type:** HARD
**Specification Reference:** SRS BR-15 spirit; card 3.5-BE
**Business Rule Reference:** Append-only history
**API Contract Reference:** PMS-API-3.3
**Acceptance Criteria**
- Unassign sets unassigned_at
- Re-assign creates new row
**Definition of Done:** Global BE DoD
**Git Ownership / File Ownership:** `contract_members` timeline; optional histories
**Git Conflict Risk:** LOW
**Parallelization Notes:** Parallel with 3.4 after 3.3

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

---
