Household
Rules
You can write your own limits as Rules, for example "money out on food above a set amount a month" or "one Holding above 25% of net worth". Kosh checks each Rule against a month and states the fact. It never says what to do about it.
Write a Rule
The iPhone app has no Rule editor yet. Write a Rule with the REST API (POST /api/v1/rules), signed in as a Member. Each Rule has five parts:
| Part | Values |
|---|---|
| Name | 1 to 60 characters. |
| Measure | monthly_outflow, monthly_inflow, balance, share_of_net_worth. |
| Scope | all, or one category, account, member or holding (with its id). Leave out the id to check every one of that kind. |
| Op | above or below. |
| Threshold | A percent in basis points (2500 = 25%), or an amount in minor units with its currency. |
A Rule is on when you write it. Turn it off with enabled: false (PATCH /api/v1/rules/{id}), or delete it.
What each measure checks
| Measure | Value Kosh computes | Scopes that have a value | Threshold |
|---|---|---|---|
monthly_outflow | Debits of the month in the Base currency, without Transfers | all, category, account, member | Amount |
monthly_inflow | Credits of the month in the Base currency, without Transfers | all, category, account, member | Amount |
balance | Today's balance of an Account in the Base currency | account (or all: each Account) | Amount |
share_of_net_worth | One Holding's value as a share of net worth | holding (or all: each Holding) | Percent |
Write an amount threshold in the Base currency: Kosh compares it with values in the Base currency. The share of net worth has a value only while net worth is above zero.
Check the Rules
- Ask "Did we break a Rule this month?" on the Ask tab.
- Or call
GET /api/v1/rules/status?period=YYYY-MM. It checks every enabled Rule against that month.
Each result names the subject and states the fact only, in this form:
"Food outflow in October: (amount), above your (limit) rule."
When the value is inside the limit, the text says "within" in place of "above" or "below".
What Kosh does not do
Kosh does not stop a write that breaks a Rule. It does not say how to get back inside a limit. Every Rule comes from the Household itself.