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
carts.json · 4.3 KB · 39 lines
1{
2 "name": "carts",
3 "title": "Carts",
4 "version": 2,
5 "description": "What somebody intends to buy, before they commit to it. Deliberately NOT a draft order: an order is a commitment with a number, a customer and a books consequence, and it sits in a sequence people count, while a basket is a browsing artefact that usually gets abandoned. Modelling the basket as a draft order fills that sequence with junk and makes 'how many orders did we take?' unanswerable -- so carts are their own collection with their own short lifetime. A cart is keyed by a session token rather than an account, because requiring somebody to sign in before they can put something in a basket is the single biggest conversion loss in small-business retail; owner_id is stamped only if and when they sign in. checked_out_order_id is what makes checkout idempotent: a cart that already became an order never becomes a second one, however many times a browser retries the request. v2 adds customer_note and gift_message: two fields, entered at checkout, not a subsystem. They are collected here because here is where the shopper is typing, and action_checkout stamps them onto the ORDER as well the moment orders declares the same two columns -- the picker and the packer are the people who need them, and they read the order, not somebody's abandoned basket.",
6 "fields": [
7 {"name": "id"},
8 {"name": "session_token", "type": "text", "required": true, "label": "Session",
9 "help": "Opaque, client-held, meaningless outside this shop. Not an identity and never a cross-site key: it says which basket, not who."},
10 {"name": "status", "type": "enum", "default": "open", "label": "Status",
11 "enum": ["open", "checked_out", "abandoned"],
12 "transitions": {
13 "open": ["checked_out", "abandoned"],
14 "abandoned": ["open"],
15 "checked_out": []
16 },
17 "help": "abandoned returns to open because somebody coming back a week later to the same basket is a sale, not a mistake. checked_out is terminal -- the order is the thing to change now."},
18 {"name": "customer_email", "type": "text", "label": "Email",
19 "help": "Collected at checkout, not before. It is what an order needs to send a receipt to; an account is offered afterwards, if at all."},
20 {"name": "customer_name", "type": "text", "label": "Name"},
21 {"name": "currency", "type": "text", "default": "USD", "label": "Currency"},
22 {"name": "checked_out_order_id", "label": "Became Order",
23 "relation": {"collection": "orders", "display_field": "number"},
24 "help": "Stamped when the cart becomes an order. Present means done: one cart, one order, however many times a retry arrives."},
25 {"name": "customer_note", "type": "textarea", "label": "Special Instructions",
26 "help": "What the shopper needs the PACKER to know -- leave it with the neighbour, do not ring the bell, this one is fragile. Collected at checkout, optional, and printed on the packing slip and the pick list, because the picker and the packer are the only people it is any use to. Distinct from `notes`, which is the shop's own scratch field about the basket: one is the customer talking to the warehouse, the other is the warehouse talking to itself, and merging them would mean an internal remark printed into a stranger's parcel."},
27 {"name": "gift_message", "type": "textarea", "label": "Gift Message",
28 "help": "Printed on the packing slip when present. There is no gift FLAG and there does not need to be one: the slip carries no prices by construction, so every parcel this shop sends is already gift-safe, and a flag somebody forgets to tick is exactly how a present arrives with the amount paid stapled to it. This field is about warmth, not secrecy."},
29 {"name": "notes", "type": "textarea", "label": "Notes"},
30 {"name": "owner_id", "type": "text", "label": "Owner",
31 "help": "The shop's owner while the basket is anonymous; the shopper once they sign in. A cart always belongs to somebody, so permissions have something to filter on."},
32 {"name": "entity_id", "type": "text", "label": "Entity",
33 "relation": {"collection": "entities", "display_field": "name"}},
34 {"name": "created_at", "type": "datetime", "read_only": true, "label": "Started"}
35 ],
36 "views": {"list_mode": "table",
37 "list_fields": ["created_at", "session_token", "status", "customer_email"],
38 "filter_fields": ["status"]}
39}