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

0 downloads

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.

danq9 signup: the person chooses the password and name on the confirm page 83c7aa6 2 weeks, 5 days ago History
dbbasic-package.json · 6.3 KB · 110 lines
1{
2 "id": "app-invoices",
3 "name": "Invoices",
4 "version": "0.11.0",
5 "description": "Line-item invoices, quotes, and credit notes (doc_type on one shared schema): owner-scoped CRUD, guarded status lifecycle (draft/sent/paid/partial/overdue/void), and a HANDLES totals handler (system_invoice_totals) that stamps subtotal/tax/total/balance from invoice_lines in integer cents on every line change. Deferred to a later slice: auto-numbered sequences per doc_type (invoice_counters + a closed invoices create route), the tokenized public/printable /i/{token} view, order-to-invoice conversion, and partial-payment recording (amount_paid_cents exists but nothing writes it yet). See plan/vocabulary/20-invoice-spec.md. subtotal_cents/tax_cents/total_cents/balance_due_cents/line_total_cents/line_tax_cents are deliberately NOT schema read_only -- see objects/system/invoice_totals.py's module docstring for why (update_collection_record has no read_only write exception, so a truly read_only field could never be re-stamped). The invoice permalink /invoices/{invoice_id:uuid} is now a seeded 59 detail view (site_view_render): a composed page of three generic block renderers -- an editable+deletable `detail` block (the invoice; the status field's own 10-flow transition guards enforce legal moves through the owner edit form, so no one-click Send/Void buttons are built, the same make-it-basic trade app-forum's pin/lock retrofit made), a `related` block (invoice_lines by invoice_id -- lines stay their own relational collection, never embedded, because they are the thing receipts/notes attach to later), and a `form` block with fixed:{invoice_id:$record_id} (Add Line, FK locked to the page's invoice). No bespoke per-invoice page or hand-written money-totals table -- the detail block's own /form cents formatting renders subtotal/tax/total/paid/balance correctly with no custom JS. No public/anonymous path in this slice; plan/vocabulary/20-invoice-spec.md's tokenized /i/{public_token} view is still a later slice. 0.5.0 adds the customer payment portal: /pay/{token}, an unguessable capability URL that lets the person who owes money see the invoice and how to pay it WITHOUT an account. The customer is not a user of this system, and a signup wall between a willing payer and their money is why invoices age. The token is schema read_only so no client can choose its own -- a predictable capability URL is not a capability -- and system_invoice_portal_link mints one the moment an invoice leaves draft, because a link that only appears once an invoice goes overdue exists only for the customers who already failed to pay. Dunning emails now carry the link, which is what finally makes them actionable. There is no card processing yet, so the page shows the business's own payment instructions rather than a Pay button that does nothing: a link that lies is worse than no link. 0.6.0 deletes the bespoke /invoices list page object: it was ~90 lines of chrome around two generator calls with no business logic of its own, and is now a seeded VIEW record over the same `list` block the invoice detail's own retrofit already established the precedent for. Ships an attention provider for invoices past their due date, at severity `warning` because this is not work that arrived, it is work that is already late. Overdue is a queue that appears out of the calendar with no write happening, which is exactly the kind nothing draws attention to. Drafts and non-invoice doc_types are excluded: an invoice nobody sent cannot be late. Line discounts arrive with the same shape app-orders uses and the same shared arithmetic (object_lines): discount_bps is a per-line negotiated rate, tax is charged on the discounted amount, and line_discount_cents is STORED beside the total it produced so an invoice can print \"10% off -2.00\" next to the line -- a reader holding only the net total cannot say what was taken off, or whether anything was. Invoices declare capabilities.comments + attachments: the customer's paperwork (a signed PO, their remittance) belongs ON the invoice, and the chase history is a thread rather than a field somebody overwrites.",
6 "compatibility": {
7 "dbbasic_object_server": ">=0.1.0"
8 },
9 "dependencies": [
10 "app-views"
11 ],
12 "objects": [
13 {
14 "id": "system_invoice_totals",
15 "path": "objects/system/invoice_totals.py"
16 },
17 {
18 "id": "system_invoice_aging",
19 "path": "objects/system/invoice_aging.py"
20 },
21 {
22 "id": "site_invoice_portal",
23 "path": "objects/site/invoice_portal.py"
24 },
25 {
26 "id": "action_regenerate_portal_link",
27 "path": "objects/action/regenerate_portal_link.py"
28 },
29 {
30 "id": "system_invoice_portal_link",
31 "path": "objects/system/invoice_portal_link.py"
32 },
33 {
34 "id": "action_generate_tm_invoice",
35 "path": "objects/action/generate_tm_invoice.py"
36 },
37 {
38 "id": "system_invoice_attention",
39 "path": "objects/system/invoice_attention.py"
40 }
41 ],
42 "schemas": [
43 {
44 "collection": "invoices",
45 "path": "schemas/invoices.json"
46 },
47 {
48 "collection": "invoice_lines",
49 "path": "schemas/invoice_lines.json"
50 }
51 ],
52 "permissions": [
53 {
54 "path": "permissions/rules.json"
55 }
56 ],
57 "seed": [
58 {
59 "collection": "invoices",
60 "path": "seed/invoices.tsv"
61 },
62 {
63 "collection": "invoice_lines",
64 "path": "seed/invoice_lines.tsv"
65 },
66 {
67 "collection": "views",
68 "path": "seed/views.tsv"
69 },
70 {
71 "collection": "site_routes",
72 "path": "seed/site_routes.tsv"
73 },
74 {
75 "collection": "notify_rules",
76 "path": "seed/notify_rules.tsv"
77 }
78 ],
79 "migrations": [],
80 "schedules": [
81 {
82 "id": "invoice_aging_daily",
83 "object_id": "system_invoice_aging",
84 "schedule": "10 6 * * *",
85 "description": "Flip sent invoices to overdue once past due, and escalate dunning."
86 }
87 ],
88 "nav": [
89 {
90 "id": "invoices",
91 "label": "Invoices",
92 "path": "/invoices",
93 "blurb": "Bill customers and track what has been paid, in integer cents",
94 "surface": "member",
95 "group": "Money",
96 "order": 300
97 }
98 ],
99 "attention": [
100 {
101 "id": "invoices_overdue",
102 "object_id": "system_invoice_attention",
103 "label": "Invoices past due",
104 "path": "/invoices",
105 "nav_id": "invoices",
106 "group": "Money",
107 "severity": "warning"
108 }
109 ]
110}