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
billing_plans.json · 2.7 KB · 33 lines
| 1 | { |
| 2 | "name": "billing_plans", |
| 3 | "title": "Plans", |
| 4 | "version": 1, |
| 5 | "description": "The price book, and it is DATA that versions forward rather than a table anyone edits in place. An invoice must forever show the price it was billed under (docs/logic-decisions.md #1), so changing a price means adding a row with a later valid_from and deactivating the old one -- never rewriting history that customers already paid against. A plan spans all three billing modes without special cases: base_minor alone is a flat subscription, prices alone is pure pay-as-you-go metering, and both together is the hybrid (a base fee with usage overage) that most real SaaS actually sells. An internal or staff account is not special-case code either -- it is a plan whose numbers are zero.", |
| 6 | "fields": [ |
| 7 | {"name": "id"}, |
| 8 | {"name": "name", "type": "text", "required": true, "label": "Name"}, |
| 9 | {"name": "code", "type": "text", "label": "Code", |
| 10 | "help": "Stable identifier across price versions (pro, team). Two rows may share a code; the active one with the latest valid_from wins."}, |
| 11 | {"name": "period", "type": "enum", "default": "month", "label": "Billing Period", |
| 12 | "enum": ["month", "year"]}, |
| 13 | {"name": "base_minor", "type": "integer", "default": "0", "label": "Base Price", |
| 14 | "help": "Charged every period regardless of usage. Integer minor units of the plan's denomination."}, |
| 15 | {"name": "denomination_id", "label": "Denomination", |
| 16 | "relation": {"collection": "denominations", "display_field": "code"}}, |
| 17 | {"name": "prices", "type": "textarea", "label": "Usage Prices (JSON)", |
| 18 | "help": "{\"ai.tokens\": {\"included\": 100000, \"unit_minor\": 2}} -- per metric, what the plan includes before overage and what each further unit costs. Empty means no metered component."}, |
| 19 | {"name": "trial_days", "type": "integer", "default": "0", "label": "Trial Days"}, |
| 20 | {"name": "is_active", "type": "boolean", "default": "true", "label": "Active", |
| 21 | "help": "Inactive plans keep billing their existing subscribers -- a retired price is not a cancelled contract -- but cannot be newly subscribed to."}, |
| 22 | {"name": "valid_from", "type": "date", "label": "Valid From"}, |
| 23 | {"name": "notes", "type": "textarea", "label": "Notes"}, |
| 24 | {"name": "owner_id", "type": "text", "label": "Owner"}, |
| 25 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"} |
| 26 | ], |
| 27 | "search": {"fields": ["name", "code"]}, |
| 28 | "forms": {"default": {"fields": ["name", "code", "period", "base_minor", |
| 29 | "denomination_id", "prices", "trial_days", |
| 30 | "is_active", "valid_from", "notes"]}}, |
| 31 | "views": {"list_mode": "table", |
| 32 | "list_fields": ["name", "code", "period", "base_minor", "is_active"]} |
| 33 | } |