askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
refunds.json · 1.3 KB · 22 lines
| 1 | { |
| 2 | "name": "refunds", |
| 3 | "title": "Refunds", |
| 4 | "version": 1, |
| 5 | "storage": "append", |
| 6 | "description": "A refund is a new compensating record pointing at its payment -- never an edit (docs/logic-decisions.md #3). invoice_id is STAMPED by the hook from the payment (stamp doctrine #1) so invoices can roll refunds up directly; the hook also enforces refund <= payment minus prior refunds.", |
| 7 | "fields": [ |
| 8 | {"name": "id"}, |
| 9 | {"name": "payment_id", "required": true, "label": "Payment", |
| 10 | "relation": {"collection": "payments", "display_field": "reference"}}, |
| 11 | {"name": "invoice_id", "label": "Invoice", |
| 12 | "relation": {"collection": "invoices", "display_field": "number"}}, |
| 13 | {"name": "amount_cents", "type": "integer", "required": true, "label": "Amount (cents)"}, |
| 14 | {"name": "reason", "type": "textarea", "label": "Reason"}, |
| 15 | {"name": "refunded_on", "type": "date", "required": true, "label": "Refunded"}, |
| 16 | {"name": "owner_id", "type": "text"}, |
| 17 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"} |
| 18 | ], |
| 19 | "forms": {"default": {"fields": ["payment_id", "amount_cents", "reason", "refunded_on"]}}, |
| 20 | "views": {"list_mode": "table", "list_fields": ["payment_id", "invoice_id", "amount_cents", "refunded_on"]}, |
| 21 | "hooks": {"before_write": "hook_refunds"} |
| 22 | } |