Skip to main content

Bank8:Branch - Business Requirements & Functionality

Audience: branch operations managers, head tellers, finance operations, and anyone evaluating what Bank8:Branch does for the business. For architecture read README.md; for wire-level detail read DESIGN.md.

1. Business Purpose​

  • Cash is a position, not a memo. Every note in a drawer, the vault, and in transit is an accountable position with a server-side record - not a running total a teller keeps on a terminal.
  • The branch has a shape. Offices form a hierarchy with staff attached to them, so authority, reporting, and cash limits follow the organisation the bank actually runs - not a flat list of users.
  • Shift balancing is evidence, not arithmetic on the client. A teller's expected cash is computed from the movements the bank recorded; a variance is a discrepancy someone must explain, and the summary is generated server-side so it cannot be edited.
  • Counter work reconciles to the book. Cash deposits, withdrawals, and vault movements post to the ledger against the seeded cash, clearing, and suspense accounts, so the branch's physical cash and the bank's book must agree.

2. Business Scope (What the Service Provides)​

#Capability areaWhat the business gets
1Office hierarchyA governed tree of branches, sub-branches, and back-office units with subtree querying
2StaffStaff records bound to offices, as the basis for teller rights and reporting scope
3TellersNamed cash-handling positions within an office, with limits
4Cashier sessionsOpen and close a shift with an expected-versus-counted reconciliation
5Cash allocationFloat from vault to teller, teller to teller, and teller to vault - each a ledger posting
6Denomination countsCash counted by note/coin, so a shift close totals to a physical count, not an estimate
7Shift summaryA server-generated, immutable record of a teller's shift: movements, expected cash, counted cash, variance
8Vault positionThe branch's own cash position, by denomination
9Cash in transitFunds handed between branches or to a cash logistics provider
10Domain eventsbank8:branch:* family (cashier, cash, vault)
11Health & opsHealth endpoint, metrics, audit journal

What the service does NOT own (business boundary):

Out of scopeOwned by
Money movement, balances, posting atomicityBank8:Ledger
The book of account (GL, statements, close)Bank8:Accounting
Customer records and accountsBank8:Ledger
Teller UI and customer interactionapps/eteller
Staff identity and sign-inSentin8:Auth (Branch holds the business record, not credentials)
Delegation and approval journeysSentin8:BFF / Sentin8:Auth
Payment schemesBank8:Payments

3. Business Capabilities​

CapabilityBusiness rule
Office hierarchyAn office has a parent except the head office; its hierarchy path supports subtree queries. An office with open cashier sessions or assigned staff cannot be deactivated - it can only be closed after the work is settled.
StaffA staff record belongs to exactly one office at a time; a transfer is an audited change. Staff are not credentials - identity stays with the platform.
TellersA teller belongs to an office and carries cash limits (per-transaction and per-shift). Limits are enforced when cash leaves the drawer, not on a report afterwards.
Cashier sessionA teller must open a session before handling cash and close it before leaving. A session close records counted cash per denomination; the variance (counted minus expected) is stored, never adjusted away.
Cash allocationEvery allocation is a ledger posting between the drawer, vault, and clearing accounts. An allocation cannot exceed the source's available cash.
Shift summaryGenerated server-side from recorded movements. Once a session closes the summary is immutable; a correction is a new, audited adjustment - not an edit.
Vault positionThe vault's position is derived from allocation and settlement movements; it is never typed in.
Cash in transitFunds leave a source drawer or vault as an in-transit position and land at the destination only when received - an unreceived transfer is visible, not lost.
Tenant isolationEvery row is environment-scoped and row-level-security enforced.

3.1 Why cash control is server-side​

A teller terminal that keeps a local session log can be refreshed, closed, or reloaded into an inconsistent state - and a variance then has no evidence. Bank8:Branch computes expected cash from the movements the bank actually recorded, requires a physical count, and stores the variance.

ConsequenceBusiness benefit
Shift summary is reproducible at any timeAn audit reproduces the shift, rather than trusting a cached screen
Variance is a first-class numberDiscrepancies are quantified and owned, not rounded into a total
Drawer cash is a ledger positionBranch cash and the book of account must agree
Limits are enforced at the drawerA teller cannot exceed authority even if the UI is bypassed

4. Business Events (Outbound)​

EventFires when
bank8:branch:office:created / :updatedOffice structure changes
bank8:branch:staff:created / :updatedStaff assigned or transferred
bank8:branch:teller:created / :updatedA teller is created or its limits change
bank8:branch:cashier:opened / :closedA shift opens or closes
bank8:branch:cash:allocatedFloat moves between vault, drawer, or teller
bank8:branch:cash:settledCash is settled back to the vault
bank8:branch:cash:varianceA shift closes with a non-zero variance
bank8:branch:vault:transferredA vault transfer or cash-in-transit movement

5. Business Rules & Invariants​

  1. Cash cannot move without an open cashier session at the source, and cannot move to a teller without one at the destination.
  2. Every cash movement is a ledger posting - Branch never holds a cash balance of its own.
  3. An allocation cannot exceed the source's available cash or the teller's limit.
  4. A closed session's summary is immutable; corrections are audited adjustments.
  5. Variance is recorded, never suppressed - a zero variance is a positive assertion, not a default.
  6. Cash in transit lands only on receipt.
  7. An office or staff record with open work cannot be deactivated.
  8. Branch never writes another service's tables.

6. Target-User Roles & Use Cases​

RoleUse case
Head tellerOpens the branch day, allocates floats, settles drawers, reviews variances
TellerOpens a shift, handles counter cash, counts out at close
Branch managerDefines office structure, assigns staff, sets teller limits
Finance operationsReconciles branch cash to the book via the ledger
AuditorReproduces any shift summary and traces every movement to a posting

7. KPIs / Success Criteria​

  • Every closed shift has a counted figure and a recorded variance.
  • Zero cash movements without a posting.
  • Branch cash reconciles to the ledger cash accounts at close of day.
  • Cash-in-transit age visible; no unreceived transfer older than policy.
  • Variance trend per teller and per branch available to management.

8. Dependencies & Reliance on Other Services​

  • Bank8:Ledger - the posting API for every cash movement; the seeded cash, clearing, and suspense internal accounts.
  • Sentin8:Bus - events out.
  • Sentin8:Auth - staff identity and sign-in (Branch holds the business record only).
  • Sentin8:BFF - delegated counter operations.
  • apps/eteller - the terminal that drives sessions and counts.
  • Bank8:Accounting - consumes cash postings.

9. Acceptance Criteria​

  1. A teller cannot record a cash movement without an open session.
  2. Opening a shift, depositing, and closing produces a server-generated summary whose expected cash equals the sum of recorded movements.
  3. A counted figure different from expected records a variance and emits cash:variance.
  4. An allocation beyond available cash or beyond the teller limit is refused.
  5. A closed summary cannot be edited; an adjustment creates a new audited record.
  6. Cash in transit appears at the destination only after receipt.

10. Open Business Questions​

  • Whether the vault is a teller position or a distinct object (current design: distinct, so vault and drawer reconcile separately).
  • Multi-currency drawers: one drawer per denomination, or a counted breakdown across denominations in a single drawer?
  • Whether cash-in-transit is internal (branch to branch) only, or also to external logistics providers.

Architecture & Design: bank8:branch and its underlying concepts were designed by Hamid Jahanzad.