# Mutual Fund — Dividend History

**Controller:** `App\Http\Controllers\MfDividendHistoryController`  
**Model:** `App\Models\MfDividendHistory`  
**Table:** `mf_dividend_history`  
**Middleware:** `jwt.auth`, `check.token`, `dynamic.permission`

A dividend row is mapped to one fund (`fund_id`). Unique per fund: (`fund_id`, `financial_year`).

Assign these route names to the back-office role in route-API permissions before calling them.

---

## Mapping

| Field | References |
|-------|------------|
| `fund_id` | `mf_funds.id` — use `mf-fund-dropdown` |

Index/show also return a nested `fund` object.

## Fields

| Column | Type | Notes |
|--------|------|--------|
| `id` | bigint | PK |
| `fund_id` | bigint | Required |
| `financial_year` | varchar(16) | Unique with fund (e.g. `2024-2025`) |
| `dividend_percentage` | decimal(5,2) | 0–999.99 |
| `declaration_date` | date | Required |
| `create_by` / `update_by` | int | From JWT / `users_id` |

## Endpoints

| Action | Method | Path | Route name |
|--------|--------|------|------------|
| List | GET | `/api/mf-dividend-history/mf-dividend-history-index` | `mf-dividend-history-index` |
| Show | GET | `/api/mf-dividend-history/mf-dividend-history-show/{id}` | `mf-dividend-history-show/{id}` |
| Dropdown | GET | `/api/mf-dividend-history/mf-dividend-history-dropdown` | `mf-dividend-history-dropdown` |
| Create | POST | `/api/mf-dividend-history/mf-dividend-history-store` | `mf-dividend-history-store` |
| Update | POST | `/api/mf-dividend-history/mf-dividend-history-update/{id}` | `mf-dividend-history-update/{id}` |
| Delete | DELETE | `/api/mf-dividend-history/mf-dividend-history-delete/{id}` | `mf-dividend-history-delete/{id}` |

Update is **POST**, not PUT.

## Query params

**Index:** `per_page`, `fund_id`, `financial_year`, `from`, `to` (declaration date), `q` (financial year).

**Dropdown:** optional `fund_id`. Returns `id`, `fund_id`, `financial_year`, `dividend_percentage`, `declaration_date`.

## Related docs

- cURL: `mf_dividend_history_api_curl.md`
- Postman: `mf_dividend_history.postman_collection.json`
