# Commissioning Management System
## Software Requirements Specification (SRS)

**Module Type:** Standalone Business Module / Rule Engine  
**Primary Purpose:** Employee, Project Member, Team এবং Contract-এর বিপরীতে company-defined commission calculation, eligibility, allocation, vesting, redistribution এবং settlement পরিচালনা করা।

**Implementation plan:** [COMMISSIONING_IMPLEMENTATION_PLAN.md](../project-management/commission/COMMISSIONING_IMPLEMENTATION_PLAN.md) — stub-first build, Project connect later (`PMS-COMM-EPIC`).

---

# 1. Purpose

Commissioning Management System-এর উদ্দেশ্য হলো কোম্পানির বিভিন্ন Project/Service/Contract থেকে employee বা project member-এর জন্য প্রযোজ্য commission একটি **dynamic এবং configurable rule engine** ব্যবহার করে নির্ধারণ ও manage করা।

System কোনো নির্দিষ্ট commission percentage বা fixed business rule-এর উপর নির্ভর করবে না।

Company administrator বিভিন্ন সময় প্রয়োজন অনুযায়ী:

- Commission percentage
- Fixed amount
- Commission duration
- Eligibility
- Employee probation restriction
- BD/PD allocation
- Commission redistribution
- Salary/Fund allocation
- Vesting
- Employee exit/termination settlement

ইত্যাদি configure করতে পারবে।

---

# 2. Business Objective

System-এর মূল objective:

1. Commission calculation automate করা
2. Manual calculation কমানো
3. Company policy configurable করা
4. Contract-based earning track করা
5. Employee-specific commission track করা
6. Historical commission preserve করা
7. Commission এবং Fund-এর complete ledger রাখা
8. Employee exit-এর সময় settlement automate করা
9. Future business rules পরিবর্তন হলেও core software code পরিবর্তনের প্রয়োজন কমানো

---

# 3. Scope

## In Scope

### Commission Management

- Commission Policy
- Commission Rule
- Commission Eligibility
- Commission Calculation
- Commission Duration
- Commission Allocation
- Commission Redistribution
- Commission Approval
- Commission Posting
- Commission Ledger

### Employee Fund

- Commission Fund
- Fund Allocation
- Vesting
- Vested Amount
- Unvested Amount
- Fund Withdrawal/Settlement

### Employee Lifecycle

- Probation restriction
- Confirmation-based eligibility
- Employment tenure
- Employee transfer
- Employee termination
- Final settlement

### Integration

Commissioning module external module থেকে business data গ্রহণ করবে।

যেমন:

- Project Management
- Contract Management
- Team Management
- Employee/HR
- Payroll
- Finance

---

# 4. Out of Scope

বর্তমান version-এ Commissioning Module নিজে:

- Salary calculation করবে না
- Full Payroll process করবে না
- Statutory PF calculation করবে না
- Invoice generate করবে না
- Client payment collection করবে না
- Accounting-এর complete General Ledger replace করবে না

তবে প্রয়োজন অনুযায়ী Payroll/Finance system-এর সঙ্গে commission data share করবে।

---

# 5. Core Business Concept

Commission calculation-এর high-level flow:

```text
Contract
   ↓
Contract Value
   ↓
Team Share
   ↓
BD / PD Allocation
   ↓
Member Assignment
   ↓
Commission Rules
   ↓
Eligibility Check
   ↓
Commission Calculation
   ↓
Duration Check
   ↓
Redistribution
   ↓
Salary / Fund Allocation
   ↓
Vesting
   ↓
Ledger
   ↓
Settlement
```

---

# 6. Integration with Project Management

Project Management module commission-এর business source হিসেবে কাজ করবে।

Project Management থেকে Commissioning module-এ আসবে:

```text
Project
Service
Contract
Contract Value
Contract Duration
Team
Team Division
Assigned Members
Contract Roles
Member Assignment
```

Commissioning module এই information-এর উপর rules apply করবে।

---

# 7. Important Principle

Commissioning Module কোনো employee-এর permanent team membership-এর উপর সরাসরি commission নির্ধারণ করবে না।

Commission-এর ক্ষেত্রে Contract Assignment এবং Contract Role গুরুত্বপূর্ণ।

উদাহরণ:

```text
Employee:
Rahim

Permanent Team:
SEO Team

Contract:
Digital Marketing Contract

Contract Role:
Sales Person / Act As
```

এই contract-এর commission rule অনুযায়ী Rahim commission পেতে পারে।

---

# 8. Commission Pool Model

একটি Contract-এর জন্য company একটি Team Share নির্ধারণ করতে পারে।

Example:

```text
Contract Value = $100

Team Share = 30%
```

তাহলে:

```text
Team Pool = $30
```

এই Team Pool আবার BD এবং PD-এর মধ্যে ভাগ হতে পারে।

Example:

```text
BD = 40%
PD = 60%
```

Result:

```text
BD Pool = $12
PD Pool = $18
```

**উপরের percentage শুধুমাত্র example।**

Actual percentage system-এর configurable rule থেকে আসবে।

---

# 9. Dynamic Rule Engine

System-এর সবচেয়ে গুরুত্বপূর্ণ component হবে:

## Commission Rule Engine

Rules hardcode করা যাবে না।

Company বিভিন্ন ধরনের rule configure করতে পারবে।

---

# 10. Rule Dimensions

একটি commission rule-এর ক্ষেত্রে নিচের dimensions configurable হতে পারে:

| Dimension | Example |
|---|---|
| Rule Scope | Company / Service / Team / Contract / Employee |
| Commission Type | Percentage / Fixed |
| Calculation Base | Contract / Team Pool / BD Pool / PD Pool |
| Role | Sales / Closer / PM / Manager |
| Division | BD / PD |
| Start Condition | Contract Start / Confirmation |
| Duration | 3 Months / 6 Months / Contract Duration |
| Frequency | One Time / Monthly |
| Eligibility | Confirmed Employee |
| Allocation | Salary / Fund |
| Redistribution | Company / PD / Other |
| Vesting | 30/60/100 |
| Termination | Vested / Custom |
| Effective Date | Configurable |
| Priority | Configurable |

---

# 11. Rule Scope

একটি rule বিভিন্ন level-এ apply হতে পারে।

### Company Level

সব employee/contract-এর default rule।

### Service Level

শুধু SEO বা Digital Marketing-এর জন্য।

### Team Level

নির্দিষ্ট team-এর জন্য।

### Contract Level

একটি specific contract-এর জন্য।

### Employee Level

একজন নির্দিষ্ট employee-এর জন্য।

---

# 12. Rule Priority

একাধিক rule applicable হলে priority প্রয়োজন।

Recommended priority:

```text
Employee
   ↓
Contract
   ↓
Team
   ↓
Service
   ↓
Company Default
```

অর্থাৎ specific rule generic rule-কে override করতে পারবে।

---

# 13. Rule Effective Date

প্রতিটি rule-এর:

- Effective From
- Effective To
- Status

থাকবে।

Example:

```text
Rule A
Effective:
01 Jan 2026 → 30 Jun 2026

Rule B
Effective:
01 Jul 2026 → onwards
```

পুরনো commission নতুন rule দিয়ে recalculate হবে না।

---

# 14. Rule Snapshot

Commission generate হওয়ার সময় applicable rule-এর snapshot সংরক্ষণ করতে হবে।

Example:

```text
Commission Generated:
March 2026

Applied Rule:
BD Commission 10%

Calculation Base:
BD Pool

Duration:
3 Months
```

পরবর্তীতে rule পরিবর্তন হলেও March-এর historical commission পরিবর্তন হবে না।

---

# 15. Commission Eligibility Matrix

| Condition | Possible Rule |
|---|---|
| Employee Status | Active only |
| Probation | Not eligible |
| Confirmation | Eligible after confirmation |
| Employment Duration | Minimum 1 year |
| Contract Status | Active |
| Contract Assignment | Required |
| Role | Sales Person |
| Team Division | BD |
| Service | Digital Marketing |
| Custom Condition | Company defined |

সব condition configurable হওয়া উচিত।

---

# 16. Example — Probation Rule

Company rule:

> Probation period-এ employee commission পাবে না।

Employee:

```text
Joining Date:
01 Jan 2026

Probation:
3 Months
```

Contract শুরু:

```text
01 Jan 2026
```

Result:

```text
Jan → Not Eligible
Feb → Not Eligible
Mar → Not Eligible
Apr → Eligible
```

Commission rule applicable থাকলেও Eligibility Engine প্রথমে employee-এর eligibility check করবে।

---

# 17. Commission Duration Matrix

| Duration Type | Example |
|---|---|
| One Time | Once |
| Fixed Months | 3 Months |
| Fixed Months | 6 Months |
| Fixed Months | 12 Months |
| Contract Duration | Contract active থাকা পর্যন্ত |
| Lifetime | No expiry |
| Custom Date | Start-End |
| Event Based | Until specific event |

---

# 18. BD Commission Example

ধরা যাক:

```text
Contract Value = $100

Team Share = $30

BD Allocation = 40%

BD Pool = $12
```

Rule:

```text
BD Commission Duration = 3 Months
```

তাহলে:

```text
Month 1 → Eligible
Month 2 → Eligible
Month 3 → Eligible
Month 4 → BD Commission STOP
```

Contract কিন্তু এখনও active থাকতে পারে।

---

# 19. PD Commission Example

একই contract:

```text
Contract Duration = 12 Months
```

Rule:

```text
PD Commission = Contract Active Duration
```

তাহলে:

```text
Month 1 → Eligible
...
Month 12 → Eligible

Contract Ends
    ↓
PD Commission Ends
```

---

# 20. BD Pool Release

BD commission শেষ হওয়ার পর BD-এর unused allocation release হতে পারে।

Example:

```text
Team Pool = $30

BD = $12
PD = $18
```

BD-এর commission duration শেষ হয়ে গেল।

Remaining/released BD pool:

```text
$12
```

Company policy অনুযায়ী এই amount:

### Option 1

```text
$12 → Company
```

### Option 2

```text
$12 → PD Pool
```

### Option 3

```text
$12
 ├── $8 → PD
 └── $4 → Company
```

এই policy dynamic হবে।

---

# 21. Redistribution Matrix

| Released Pool | Destination |
|---|---|
| BD → Company | Company retains |
| BD → PD | Full PD redistribution |
| BD → Company + PD | Percentage based |
| BD → Other Pool | Configurable |
| No Redistribution | Pool remains unused |

---

# 22. Dynamic PD Recalculation

যদি released BD pool PD-কে দেওয়া হয়:

```text
Original PD Pool = $18
Released BD = $12

Effective PD Pool = $30
```

অথবা company rule অনুযায়ী:

```text
Released BD = $12

PD gets 50%
Company gets 50%

PD Additional = $6
Company = $6
```

Engine এই calculation automatically করবে।

---

# 23. Commission Payment Method

Commission employee-কে দুইভাবে দেওয়া যেতে পারে:

```text
Commission
    │
    ├── Salary
    │
    └── Commission Fund
```

---

# 24. Salary Allocation

Example:

```text
Commission = $1,000

Salary Allocation = 100%
Fund Allocation = 0%
```

Employee salary cycle-এ:

```text
$1,000
```

commission হিসেবে যাবে।

---

# 25. Fund Allocation

Example:

```text
Commission = $1,000

Salary = 0%
Fund = 100%
```

Employee Commission Fund:

```text
+$1,000
```

---

# 26. Partial Allocation

Company চাইলে:

```text
Commission = $1,000

Salary = 60%
Fund = 40%
```

Result:

```text
Salary = $600
Fund = $400
```

Validation:

```text
Salary Allocation %
+
Fund Allocation %
=
100%
```

---

# 27. Commission Fund

Commission Fund normal statutory PF-এর equivalent হিসেবে ধরে নেওয়া হবে না।

এটি একটি **company-defined deferred commission/fund balance**।

Fund-এর মধ্যে থাকবে:

- Opening Balance
- Commission Credit
- Adjustment
- Vesting
- Withdrawal
- Settlement
- Forfeiture
- Closing Balance

---

# 28. Vesting Engine

Fund-এর টাকা employee সঙ্গে সঙ্গে পাবে—এমনটা বাধ্যতামূলক নয়।

Company vesting policy configure করতে পারবে।

### Example

```text
1 Year → 30%
2 Years → 60%
3 Years → 100%
```

যদি employee-এর fund balance:

```text
$10,000
```

তাহলে:

### After 1 Year

```text
Vested = $3,000
Unvested = $7,000
```

### After 2 Years

```text
Vested = $6,000
Unvested = $4,000
```

### After 3 Years

```text
Vested = $10,000
Unvested = $0
```

---

# 29. Alternative Vesting Rule

Company চাইলে:

```text
Minimum Service = 3 Years

Before 3 Years:
Vested = 0%

After 3 Years:
Vested = 100%
```

অথবা:

```text
Minimum Service = 5 Years
```

এগুলো configuration-এর মাধ্যমে সম্ভব হবে।

---

# 30. Vesting Rule Matrix

| Vesting Type | Example |
|---|---|
| Immediate | 100% immediately |
| Time Based | 30/60/100 |
| Minimum Service | 100% after 3 years |
| Contract Based | Contract duration |
| Custom | Company defined |
| No Vesting | Always payable |

---

# 31. Employee Termination

Employee company ছাড়লে Commissioning Engine final settlement calculate করবে।

Input:

```text
Accrued Commission
Fund Balance
Vested Amount
Unvested Amount
Employment Duration
Termination Type
Termination Date
Applicable Rule
```

---

# 32. Termination Example

Employee:

```text
Fund Balance = $10,000
Vested = $6,000
Unvested = $4,000
```

Company rule:

> Employee termination হলে vested amount-এর 100% payable।

Result:

```text
Employee Payable = $6,000
Company Retained = $4,000
```

---

# 33. Termination Rule Matrix

| Termination Type | Possible Policy |
|---|---|
| Resignation | Vested amount |
| Company Termination | Custom |
| Layoff | Full vested |
| Contract End | Full/partial |
| Misconduct | Forfeit |
| Retirement | Full vested |
| Death | Nominee/estate rule |
| Custom | Company defined |

উপরের policy-গুলো example মাত্র; final company rules configurable হবে।

---

# 34. Commission Calculation Formula

Generic formula:

```text
Commission Base
        ×
Commission Rate
        =
Gross Commission
```

Example:

```text
Commission Base = $12
Rate = 10%

Commission = $1.20
```

কিন্তু Calculation Base dynamic হবে।

Possible base:

```text
Contract Value
Team Pool
BD Pool
PD Pool
Collected Amount
Profit
Fixed Amount
Custom Base
```

---

# 35. Calculation Base Matrix

| Base | Example |
|---|---|
| Contract Value | 10% of $100 |
| Team Pool | 10% of $30 |
| BD Pool | 10% of BD pool |
| PD Pool | 10% of PD pool |
| Fixed Amount | $500 |
| Monthly Value | % of monthly contract |
| Collected Revenue | % of received amount |
| Custom | Company-defined |

---

# 36. Frequency

Commission frequency:

```text
One Time
Monthly
Quarterly
Yearly
Contract Cycle
Milestone
Custom
```

---

# 37. Commission Lifecycle

```text
Draft Rule
    ↓
Rule Activated
    ↓
Contract/Employee Eligible
    ↓
Commission Period Opens
    ↓
Eligibility Evaluation
    ↓
Calculation
    ↓
Commission Generated
    ↓
Allocation
    ↓
Approval
    ↓
Posting
    ↓
Salary / Fund
    ↓
Ledger
```

---

# 38. Commission Run

Recurring commission-এর জন্য system-এ **Commission Run** থাকবে।

Example:

```text
Commission Run:
September 2026
```

Run-এর মধ্যে থাকবে:

```text
Contracts Processed
Employees Processed
Gross Commission
Salary Allocation
Fund Allocation
Company Retained
Redistributed Amount
```

---

# 39. Commission Run Status

```text
Draft
Calculated
Under Review
Approved
Posted
Cancelled
```

Posted হওয়ার পর calculation data immutable হওয়া উচিত।

---

# 40. Commission Ledger

প্রত্যেক financial movement ledger-এ record হবে।

Example:

| Date | Type | Credit | Debit | Balance |
|---|---|---:|---:|---:|
| Jan | Commission | $500 | - | $500 |
| Feb | Commission | $500 | - | $1,000 |
| Feb | Salary Allocation | - | $300 | $700 |
| Feb | Fund Allocation | $200 | - | $900 |

Ledger-এর মাধ্যমে complete audit trail পাওয়া যাবে।

---

# 41. Transaction Principle

Commission calculation এবং balance update একই transaction boundary-এর মধ্যে হবে।

যেমন:

```text
BEGIN TRANSACTION

Generate Commission
Create Commission Ledger
Allocate Salary
Allocate Fund
Update Balance

COMMIT
```

কোনো step fail করলে পুরো operation rollback হবে।

---

# 42. Idempotency

একই period-এর commission দুইবার generate করা যাবে না।

Example:

```text
Employee:
Rahim

Contract:
DM-001

Period:
September 2026
```

একবার commission posted হয়ে গেলে একই employee + contract + period-এর জন্য duplicate commission run prevent করতে হবে।

---

# 43. Rule Change Handling

ধরা যাক:

January:

```text
BD = 40%
PD = 60%
```

July:

```text
BD = 30%
PD = 70%
```

January-এর historical commission:

**40/60 rule অনুযায়ী থাকবে।**

July-এর commission:

**30/70 rule অনুযায়ী হবে।**

পুরনো calculation overwrite করা যাবে না।

---

# 44. Example — Complete Scenario

ধরা যাক:

```text
Contract Value = $100

Team Share = 30%

BD = 40%
PD = 60%
```

Initial:

```text
Team Pool = $30
BD Pool = $12
PD Pool = $18
```

BD rule:

```text
Duration = 3 Months
```

PD rule:

```text
Duration = Contract Duration
```

Contract:

```text
Duration = 12 Months
```

Result:

```text
Month 1-3:
BD → Active
PD → Active

Month 4-12:
BD → Inactive
PD → Active
```

Company chooses:

```text
Released BD Pool → PD
```

তাহলে Month 4 থেকে:

```text
PD Original Pool
+
Released BD Pool
```

অনুযায়ী PD calculation হবে।

অন্যদিকে company চাইলে:

```text
Released BD Pool → Company
```

তাহলে PD-এর calculation পরিবর্তন হবে না।

---

# 45. Employee Eligibility Example

Contract January-তে শুরু হয়েছে।

Employee probation:

```text
3 Months
```

Rule:

```text
Confirmed Employee Only
```

তাহলে:

```text
Jan → No Commission
Feb → No Commission
Mar → No Commission
Apr → Commission Eligible
```

তবে contract-এর commission period January থেকে শুরু হবে কিনা, নাকি employee eligible হওয়ার পর থেকে শুরু হবে—এটিও dynamic rule হিসেবে configurable হতে হবে।

Possible policy:

### Policy A

Commission period contract start থেকে count হবে।

### Policy B

Commission period employee eligibility থেকে count হবে।

---

# 46. Commission Duration vs Eligibility Duration

দুটিকে আলাদা concept হিসেবে রাখতে হবে।

উদাহরণ:

```text
Commission Duration = 6 Months

Employee Eligibility:
Starts after probation
```

Contract January-তে শুরু হলেও employee April-এ eligible হতে পারে।

System তখন বুঝবে:

```text
Commission Window
≠
Employee Eligibility Window
```

এই distinction future calculation-এর জন্য খুব গুরুত্বপূর্ণ।

---

# 47. Rule Matrix — Master

| Rule Area | Configurable |
|---|---|
| Commission Rate | Yes |
| Fixed Commission | Yes |
| Calculation Base | Yes |
| Team Share | Yes |
| BD Share | Yes |
| PD Share | Yes |
| Commission Duration | Yes |
| Commission Frequency | Yes |
| Eligibility | Yes |
| Probation Restriction | Yes |
| Employee Tenure | Yes |
| Start Condition | Yes |
| End Condition | Yes |
| Redistribution | Yes |
| Salary Allocation | Yes |
| Fund Allocation | Yes |
| Vesting | Yes |
| Termination | Yes |
| Effective Date | Yes |
| Rule Priority | Yes |
| Contract-specific Override | Yes |
| Employee-specific Override | Yes |

---

# 48. Commission Rule Configuration — Conceptual

একটি Rule-এ conceptually থাকতে পারে:

```text
Rule
├── Name
├── Scope
├── Service
├── Team
├── Division
├── Role
├── Contract
├── Employee
│
├── Calculation
│   ├── Type
│   ├── Base
│   ├── Rate
│   └── Fixed Amount
│
├── Eligibility
│   ├── Employee Status
│   ├── Confirmation
│   ├── Tenure
│   └── Custom Conditions
│
├── Duration
│   ├── Type
│   ├── Value
│   └── Start/End Condition
│
├── Allocation
│   ├── Salary %
│   └── Fund %
│
├── Redistribution
│   ├── Trigger
│   ├── Destination
│   └── Percentage
│
└── Vesting
    ├── Type
    └── Schedule
```

---

# 49. Non-Functional Requirements

## Auditability

প্রতিটি commission calculation-এর জন্য জানতে হবে:

- কোন contract
- কোন employee
- কোন role
- কোন rule
- কোন rule version
- কোন calculation base
- কোন period
- কত amount
- কত salary
- কত fund
- কত redistribution

---

## Traceability

একটি employee-এর commission trace করা যাবে:

```text
Employee
 ↓
Contract
 ↓
Team
 ↓
Role
 ↓
Rule
 ↓
Calculation
 ↓
Commission
 ↓
Allocation
 ↓
Ledger
```

---

# 50. Immutability

Approved/Posted commission records সরাসরি edit করা যাবে না।

Correction-এর জন্য:

```text
Adjustment
Reversal
Correction Transaction
```

ব্যবহার করা উচিত।

---

# 51. Permission Requirements

সম্ভাব্য permission:

```text
commission.view
commission.rule.view
commission.rule.create
commission.rule.update
commission.rule.activate
commission.calculate
commission.approve
commission.post
commission.adjust
commission.settlement.view
commission.settlement.approve
commission.report.view
```

---

# 52. Reporting

System থেকে:

### Contract-wise

- Contract Value
- Team Pool
- BD Pool
- PD Pool
- Commission

### Employee-wise

- Total Commission
- Salary Commission
- Fund Commission
- Vested
- Unvested
- Paid
- Pending

### Team-wise

- Total Team Pool
- BD Allocation
- PD Allocation
- Released Pool
- Redistributed Pool

### Period-wise

- Monthly Commission
- Approved Commission
- Posted Commission
- Pending Commission

---

# 53. Commission Engine — Recommended Internal Flow

```text
Commission Request
       ↓
Load Context
       ↓
Resolve Rules
       ↓
Create Rule Snapshot
       ↓
Check Eligibility
       ↓
Determine Commission Period
       ↓
Determine Calculation Base
       ↓
Calculate Gross Commission
       ↓
Apply Duration
       ↓
Apply Redistribution
       ↓
Apply Allocation
       ↓
Generate Commission Transaction
       ↓
Create Ledger
       ↓
Approval
       ↓
Posting
```

---

# 54. Important Design Principle

Commission Engine-কে **CRUD module** হিসেবে design করা উচিত নয়।

এটা হবে:

> **Rule-driven transaction processing engine**

অর্থাৎ মূল কাজ হবে:

```text
Input
  ↓
Rules
  ↓
Evaluation
  ↓
Calculation
  ↓
Decision
  ↓
Transaction
```

---

# 55. Future Extensibility

বর্তমান rules না থাকলেও architecture future-এর জন্য প্রস্তুত থাকবে।

পরবর্তীতে company চাইলে:

- Sales commission
- Closer commission
- Upsell commission
- Cross-sell commission
- Renewal commission
- Performance bonus
- Referral commission
- Profit sharing
- Service-based incentive
- Target-based commission
- Milestone commission

একই engine-এর মাধ্যমে implement করা যাবে।

---

# 56. Final Business Model

Commissioning System-এর final conceptual model:

```text
                    ┌──────────────────────┐
                    │   PROJECT MANAGEMENT │
                    └──────────┬───────────┘
                               │
                    Contract / Assignment
                               │
                               ▼
                    ┌──────────────────────┐
                    │ COMMISSIONING ENGINE │
                    └──────────┬───────────┘
                               │
              ┌────────────────┼────────────────┐
              ▼                ▼                ▼
        Rule Engine     Eligibility Engine   Duration
              │                │                │
              └────────────────┼────────────────┘
                               ▼
                       Calculation Engine
                               │
                    ┌──────────┴──────────┐
                    ▼                     ▼
             Redistribution          Allocation
                    │                     │
                    │              ┌──────┴──────┐
                    │              ▼             ▼
                    │           Salary         Fund
                    │                            │
                    │                         Vesting
                    │                            │
                    └──────────────┬─────────────┘
                                   ▼
                              Ledger Engine
                                   │
                                   ▼
                           Settlement Engine
```

---

# 57. Core Requirement Summary

Commissioning Module-এর সবচেয়ে গুরুত্বপূর্ণ requirement হলো:

> **Company যেন future-এ commission-এর business rule পরিবর্তন করতে পারে, কিন্তু প্রতিবার developer-কে core calculation logic পরিবর্তন করতে না হয়।**

তাই system-এর architecture হবে:

**Configuration → Rule Resolution → Eligibility → Calculation → Allocation → Redistribution → Vesting → Ledger → Settlement**

এবং কোনো commission transaction generate হওয়ার পর তার **applied rule snapshot + calculation result + ledger transaction** historical audit-এর জন্য সংরক্ষিত থাকবে।

---

# 58. SRS Acceptance Criteria

Module সফলভাবে complete হয়েছে বলা হবে যদি:

1. Company dynamic commission rule create করতে পারে।
2. Rule company/service/team/contract/employee level-এ apply করা যায়।
3. BD এবং PD আলাদা allocation করা যায়।
4. Commission duration configure করা যায়।
5. Probation/confirmation eligibility configure করা যায়।
6. Contract active থাকা পর্যন্ত recurring commission চালানো যায়।
7. BD commission বন্ধ হয়ে গেলে released pool configurable destination-এ দেওয়া যায়।
8. Salary এবং Fund-এর মধ্যে commission ভাগ করা যায়।
9. Fund-এর vesting schedule configure করা যায়।
10. Employee termination-এর সময় configurable settlement করা যায়।
11. Historical commission old rule অনুযায়ী unchanged থাকে।
12. Commission duplicate generate করা যায় না।
13. প্রতিটি calculation audit করা যায়।
14. Approved/posted transaction সরাসরি পরিবর্তন করা যায় না।
15. নতুন commission policy যুক্ত করার জন্য core engine rewrite করা না লাগে।

---

# 59. Final Architecture Statement

এই module-এর মূল philosophy হবে:

> **"Don't hardcode the commission policy; build an engine that executes the policy."**

Project Management বলবে:

**“এই Contract-এ এই Team, এই Member এবং এই Role কাজ করছে।”**

Commissioning System বলবে:

**“Company-এর বর্তমান rules অনুযায়ী এই Member এই Contract থেকে এই amount-এর commission-এর জন্য eligible; এর এই অংশ salary-তে, এই অংশ fund-এ যাবে; এই সময় পর্যন্ত commission চলবে; এবং এই rule অনুযায়ী future-এ vest/settle হবে।”**

এই separation-টাই পুরো system-এর সবচেয়ে গুরুত্বপূর্ণ architectural boundary।