Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

9 downloads

Install on DigitalOcean Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Daniel Quellhorst Changelog for this batch. 65ef78d 3 hours, 42 minutes ago History
value_account_counts.json · 6.2 KB · 46 lines
1{
2 "name": "value_account_counts",
3 "title": "Counts",
4 "version": 5,
5 "storage": "append",
6 "description": "Someone counted what was actually there. This is the reconciliation evidence for accounts nobody sends a statement for -- a till, a petty-cash box, a safe -- and it is append-only for the same reason imported bank lines are: a count is an observation made at a moment by a named person, not a figure to revise later (docs/logic-decisions.md #8). The book balance is STAMPED onto the count at the time it was taken, so the variance stays meaningful forever even as later entries move the balance (#1). What makes this different from every other reconciliation in the system is honesty about its own weakness: a count is SELF-CERTIFICATION -- the person counting the till is usually the person who could take from it, which is the oldest fraud pattern there is and precisely what an independent statement protects against. So the count records who counted AND who witnessed, the account can require a witness before a count is accepted (value_accounts.requires_second_attestor), and the assurance a witnessed count carries is rated above an unwitnessed one but still below an independent statement (object_money.assurance_for). A variance composes a real journal -- cash over/short is an expense a business genuinely incurs, and pretending the drawer always balances is how a slow leak stays invisible for years. v3: relation.requires update on the account counted, the journal it posted and the entity: a count against somebody else's account was a registered user's own row. v4: a named witness is only a claim until that person confirms it. witnessed_by is the user id of another active user, resolved by action_record_count and read_only; witness_status starts at named, and only the named user, signed in as themselves, moves it to confirmed (by stating the same figure) or disputed (a different figure, kept in witness_stated_minor) through action_confirm_count, once. Until then the count rates as self-certified and an account that requires a second attestor reports that requirement unmet. The variance journal is booked when the count is recorded and confirming never changes it. v5: counted_by is read_only like witnessed_by, so the record API cannot set or rewrite who counted; action_record_count sets it from the signed-in caller.",
7 "fields": [
8 {"name": "id"},
9 {"name": "value_account_id", "required": true, "label": "Account",
10 "relation": {"collection": "value_accounts", "display_field": "name", "requires": "update"}},
11 {"name": "counted_on", "type": "date", "required": true, "label": "Counted"},
12 {"name": "counted_minor", "type": "integer", "required": true, "label": "Counted Amount",
13 "help": "What was actually there, in the account denomination's smallest unit (object_money.py)."},
14 {"name": "book_balance_minor", "type": "integer", "label": "Book Balance At Count",
15 "help": "What the ledger said at the moment of the count, stamped so the variance stays meaningful after later entries move the balance."},
16 {"name": "variance_minor", "type": "integer", "label": "Variance",
17 "help": "counted minus book. Negative is a shortage (less there than the books say), positive an overage."},
18 {"name": "counted_by", "type": "text", "read_only": true, "label": "Counted By", "help": "The user id of the signed-in user who recorded the count, set by action_record_count and never by the record API: a count is evidence, and who counted is part of it."},
19 {"name": "witnessed_by", "type": "text", "read_only": true, "label": "Witnessed By",
20 "help": "The user id of the second person the counter NAMED as witness: another active user, checked when the count is recorded. Empty means the count is self-certified, which the reconciliation view rates lower -- and which an account may refuse outright. Naming a witness is a claim, not an attestation: see witness_status."},
21 {"name": "witness_status", "type": "enum", "read_only": true, "label": "Witness",
22 "enum": ["named", "confirmed", "disputed"],
23 "help": "named: the counter named a witness who has not answered yet, so the count is still self-certified. confirmed: the named witness, signed in as themselves, stated the same figure. disputed: the named witness stated a different figure (witness_stated_minor) and refused to confirm. The witness answers once (v4)."},
24 {"name": "witness_stated_minor", "type": "integer", "read_only": true, "label": "Witness's Figure",
25 "help": "The figure the named witness stated when they answered, kept whether it matched or not."},
26 {"name": "witness_answered_at", "type": "datetime", "read_only": true, "label": "Witness Answered"},
27 {"name": "journal_id", "label": "Variance Journal",
28 "relation": {"collection": "fin_journals", "display_field": "description", "requires": "update"},
29 "help": "The over/short entry this count composed, when there was a variance to book."},
30 {"name": "book_basis", "type": "text", "read_only": true, "label": "Book Basis",
31 "help": "A fingerprint of the posted ledger lines the variance was computed against, stamped only when the count booked a variance. Unique per account, so two counts taken against the SAME books -- a double click, two people at one drawer -- cannot both book the same shortage (v2, 2026-11-28). The second is refused and asked to count again; once the first count's journal lands the books have moved and the fingerprint with them."},
32 {"name": "notes", "type": "textarea", "label": "Notes"},
33 {"name": "owner_id", "type": "text", "label": "Owner"},
34 {"name": "entity_id", "type": "text", "label": "Entity",
35 "relation": {"collection": "entities", "display_field": "name", "requires": "update"}},
36 {"name": "created_at", "type": "datetime", "read_only": true, "label": "Recorded"}
37 ],
38 "unique": [
39 {"fields": ["book_basis"], "scope": ["value_account_id"],
40 "message": "Another count of this account was just booked against the same books. Count again."}
41 ],
42 "views": {"list_mode": "table",
43 "list_fields": ["value_account_id", "counted_on", "counted_minor",
44 "variance_minor", "counted_by", "witnessed_by", "witness_status"],
45 "filter_fields": ["value_account_id"]}
46}