Ledger.Domain
Financial workspace workflows and project contracts
Responsibility
Domain/Domain.fs owns immutable financial fixtures, organization/environment/ledger context, balance calculations and deletion eligibility.
Dependencies
- System and FSharp.Core only.
Financial types
type Account = { id:int; name:string; accountType:AccountType; currency:string; openingBalance:decimal }
type Transaction = { id:int; date:DateOnly; description:string; accountId:int; amount:decimal; status:TransactionStatus }
type Workspace = { organization:Organization; environment:Environment; ledger:Ledger }
// balance : Account -> decimal
// canDeleteAccount : int -> boolRules
- Account balances SHALL equal opening balance plus the account's signed transactions.
- Deletion eligibility SHALL require an existing account, zero balance and no transactions.
- Every ledger SHALL belong to its selected organization. Unknown context values SHALL resolve to available fixtures.