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
backorders.json · 4.2 KB · 38 lines
| 1 | { |
| 2 | "name": "backorders", |
| 3 | "title": "Backorders", |
| 4 | "version": 1, |
| 5 | "description": "Somebody wanted something that was not on the shelf. Two facts share this collection because they are the same fact seen from either side of a refusal, and splitting them would mean two queues nobody watches instead of one somebody does. kind=backorder is a line the shop ACCEPTED under products.backorder_policy=allow -- the sale happened, the customer was told, and the goods owe them. kind=notify is a line the shop REFUSED under policy=notify, keeping the customer's interest so they can be told when it is back; refusing while remembering beats refusing and forgetting, which is the current behaviour and loses the customer twice. The quantity here is what was SHORT, not what was ordered: the rest of the line is ordinary stock that can go out today, and partial fulfilment is app-shipping's ordinary business. status is the only mutable thing on the row and it is deliberately small -- open, filled, cancelled -- because this is a waiting list and not a workflow. A row is never deleted: a customer who waited and was let down is a fact the shop should be able to find, and cancelled says it out loud where a missing row would say nothing at all. The attention count is the OPEN rows, severity warning, because nobody chose to be in this queue and somebody is waiting at the other end of it.", |
| 6 | "fields": [ |
| 7 | {"name": "id"}, |
| 8 | {"name": "product_id", "required": true, "label": "Product", |
| 9 | "relation": {"collection": "products", "display_field": "name"}}, |
| 10 | {"name": "kind", "type": "enum", "required": true, "default": "backorder", |
| 11 | "label": "Kind", "enum": ["backorder", "notify"], |
| 12 | "help": "backorder: the order was taken and these goods are owed. notify: the order was refused and this is somebody's interest, kept so they can be told. The difference is whether money changed hands, which is why they are told apart rather than merged into 'waiting'."}, |
| 13 | {"name": "order_id", "label": "Order", |
| 14 | "relation": {"collection": "orders", "display_field": "number"}, |
| 15 | "help": "The sale this is owed against. Blank for a notify row: nothing was ordered, which is the whole distinction."}, |
| 16 | {"name": "order_line_id", "type": "text", "label": "Order Line", |
| 17 | "help": "Which line of that order is short. This is the join that lets fulfilment leave a backordered line in the warehouse while the rest of the order goes out today -- and it is a plain text id rather than a relation because app-catalog does not depend on app-orders, and a shop that sells no backorders should not have to install one to describe its shelves."}, |
| 18 | {"name": "quantity", "type": "number", "default": "0", "label": "Short By", |
| 19 | "help": "How many were missing, not how many were ordered. The rest of the line is ordinary stock and ships today."}, |
| 20 | {"name": "customer_email", "type": "text", "label": "Customer", |
| 21 | "help": "Who to tell. On a notify row it is the only thing here worth anything -- a record of interest with no way to reach the interested party is a record of nothing."}, |
| 22 | {"name": "status", "type": "enum", "default": "open", "label": "Status", |
| 23 | "enum": ["open", "filled", "cancelled"], |
| 24 | "help": "open is waiting. filled is the goods went out. cancelled is the customer gave up or the shop stopped selling it -- said out loud, because a deleted row says nothing and this collection is also the evidence of who was let down."}, |
| 25 | {"name": "requested_on", "type": "date", "label": "Requested", |
| 26 | "help": "The day somebody wanted it, which is the clock this queue should be sorted by: the person who has waited longest is the person to ring first."}, |
| 27 | {"name": "notes", "type": "textarea", "label": "Notes"}, |
| 28 | {"name": "owner_id", "type": "text", "label": "Owner"}, |
| 29 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Recorded"} |
| 30 | ], |
| 31 | "forms": {"default": {"fields": ["product_id", "kind", "order_id", "quantity", |
| 32 | "customer_email", "status", "requested_on", |
| 33 | "notes"]}}, |
| 34 | "views": {"list_mode": "table", |
| 35 | "list_fields": ["requested_on", "product_id", "kind", "quantity", |
| 36 | "customer_email", "status"], |
| 37 | "filter_fields": ["kind", "status"]} |
| 38 | } |