# Feature: Savings, Deposits & Shares

> **Status:** Specified, not built · **Phase:** 2 · **Depends on:** posting engine (2.1), members (2.2)
> **Regulatory basis:** SACCOS Regulations 2019; Cooperative Societies Act; GN 679 Reg 23 (cash collateral and compulsory savings)

---

## Purpose

Savings and share capital are the institution's funding base and, for a SACCOS,
the basis of membership itself. They are also the member's money — which makes
the accuracy bar different from anywhere else in the system. A loan schedule
that is a shilling out is an irritation. A savings balance that is a shilling
out is a dispute, and eventually a complaint to the regulator.

---

## Share capital

Membership in a SACCOS is constituted by shares, not by a signup form. This has
consequences the software must respect.

### Share classes

| Class | Withdrawable | Purpose |
|---|---|---|
| **Membership (compulsory)** | **No** — only on cessation of membership | Constitutes membership; the minimum holding is set by the bylaws |
| **Voluntary** | Yes, per bylaws | Additional investment; usable as loan collateral |
| **Preferred** | Per terms | Fixed return, no voting rights |
| **Institutional** | Per agreement | Corporate or partner holdings |

**Membership shares are not a savings account.** They cannot be withdrawn on
demand, they are at risk if the institution makes a loss, and they carry voting
rights. Modelling them as a withdrawable balance would be wrong both
accountingly and legally.

### The 24-month rule

Members typically may not be able to pay their full share capital at once, so
the bylaws allow accumulation over a configurable period — commonly 24 months.
The system tracks progress toward the required holding and reports members who
have fallen behind, because incomplete share capital affects both their
membership standing and the institution's capital adequacy.

### Share register

Digital certificates, transfer tracking (member-to-member, inheritance,
redemption on exit), and periodic revaluation. On exit, shares are redeemed at
the current value **after** deducting any outstanding loan, fees and penalties —
never before.

---

## Savings products

| Product | Character | Notes |
|---|---|---|
| **Compulsory savings** | Locked while linked to a loan | Under GN 679 Reg 23, where savings are taken as cash collateral they cannot be withdrawn against the secured loan |
| **Voluntary / regular** | On demand | The everyday account |
| **Target savings** | Goal-based | School fees, business expansion; early withdrawal may forfeit bonus interest |
| **Youth / children** | Restricted | Guardian-operated |
| **Fixed / term deposits** | 30, 60, 90, 180, 365 days | Tiered rates, auto-renewal optional, early-withdrawal penalty |

### Collateral locking

When savings are pledged against a loan, the pledged amount becomes
non-withdrawable — and the same balance **cannot be pledged twice**. This is
enforced by a lock record, not by a warning at the point of withdrawal. A
warning is advice; a lock is a control, and only the control survives a busy
Friday afternoon at the counter.

The available balance a teller sees is therefore always
`balance − locked − uncleared`, never the raw balance.

---

## Interest

**Daily balance method**, accrued daily, posted monthly or quarterly per
product configuration. Day count Actual/365, the Tanzanian convention.

```
daily accrual = closing_balance × (annual_rate / 365)
```

Accrual is computed in integer cents and the fractional remainder is carried,
not discarded. Discarding sub-cent accruals looks harmless on one account for
one day; across 3,000 members for a year it is a visible and indefensible
shortfall in what the institution owes.

Tiered rates apply on a **banded** basis — the portion of balance within each
band earns that band's rate, rather than the whole balance earning the top rate
it qualifies for. The distinction is worth stating because the alternative
reading creates a cliff at each threshold that members will find and exploit.

---

## Transactions

Deposits, withdrawals, and transfers (member-to-member, savings-to-loan,
savings-to-shares). Channels: cash at the counter, mobile money, bank transfer,
cheque, internal transfer.

Each posts to the ledger through the posting engine — no savings transaction
exists without its journal entry.

### Withdrawal checks, in order

1. Account is active and not frozen
2. Product allows withdrawal (compulsory savings against a live loan: no)
3. Amount ≤ available balance (net of locks and uncleared funds)
4. Minimum balance maintained
5. Withdrawal limits — per transaction, per day, per product
6. AML threshold check — over TZS 50M single or TZS 100M daily aggregate triggers a report
7. Authorisation level — large withdrawals need a second approver

### Cheques and uncleared funds

A deposited cheque is not cash. It credits the balance but is held as uncleared
until the clearing period elapses, and uncleared funds are not withdrawable.
Treating a cheque deposit as immediately available is a well-known route to
fraud loss.

---

## Dividends

Declared annually by the AGM, from surplus, subject to capital adequacy being
maintained afterwards — an institution cannot distribute itself below its
regulatory minimum.

```
member dividend = price_per_share × shares_held × eligibility_fraction
```

`eligibility_fraction` handles members who held shares for part of the year;
paying a full dividend on shares bought in December is a common and expensive
error.

Before payment, deduct outstanding loans, fees and penalties. Then apply
**withholding tax** and remit it to the TRA — the institution is the withholding
agent, so an under-deduction is the institution's liability, not the member's.

Payment options: cash, mobile money, or capitalisation as bonus shares.

---

## Statements

Monthly, quarterly, or on demand. PDF, email, SMS summary, and physical passbook
printing — passbooks still matter, because a significant share of members have
no smartphone and the passbook is their record.

Statements show opening balance, every transaction with running balance,
interest earned, closing balance. In Swahili or English, per member preference.

---

## Edge cases

- **Withdrawal that would breach the loan-collateral lock** → refused, with the
  reason and the unlock condition shown.
- **Interest posting on a closed account** → accrue to the closure date, post,
  then close.
- **Fixed deposit matures on a public holiday** → roll to the next working day
  using the tenant's holiday calendar.
- **Early fixed-deposit withdrawal** → recompute interest at the penalty rate
  from inception, not from the withdrawal date.
- **Dormant account reactivation** → requires KYC refresh before transacting.
- **Deceased member** → freeze, then settle to next of kin per the bylaws.
- **Member exits mid-year** → dividend is pro-rated; shares redeemed net of
  obligations.
- **Negative balance** → must be impossible. Enforced by a database constraint
  as well as by application logic, because the application is not the only thing
  that will ever write to that table.

---

## Test checklist

- [ ] Balance never goes negative, under concurrent withdrawals
- [ ] Available balance excludes locks and uncleared funds
- [ ] Compulsory savings cannot be withdrawn against a live loan
- [ ] The same balance cannot be pledged to two loans
- [ ] Daily accrual carries the sub-cent remainder rather than discarding it
- [ ] Tiered interest bands apply per portion, not to the whole balance
- [ ] Every transaction posts a balanced journal entry
- [ ] Fixed deposit maturity respects the holiday calendar
- [ ] Early withdrawal recomputes interest from inception
- [ ] Dividend eligibility pro-rates part-year holdings
- [ ] Withholding tax computed and recorded for remittance
- [ ] Membership shares are not withdrawable while membership subsists
- [ ] AML thresholds trigger at TZS 50M single / 100M daily
- [ ] Tenant isolation on every savings and share endpoint

---

## Build order

1. Products — savings and share classes
2. Accounts and opening balances
3. Deposit and withdrawal, posting through the engine
4. Balance computation including locks and uncleared funds
5. Collateral locking
6. Transfers
7. Interest accrual and posting
8. Fixed deposits: maturity, rollover, early withdrawal
9. Share register, certificates, transfers
10. Statements and passbook
11. Dividend declaration, deduction, withholding tax, payment
