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.4 KB · 93 lines
1{
2 "id": "app-pickup",
3 "name": "Pickup",
4 "version": "0.1.0",
5 "description": "The missing noun is TIME. Everything about the money was already built here -- browse, basket, guest checkout, order, invoice, pay link, payment, books, stock, tax, the receipt trail -- and a cafe still could not open on it, because a food business is a scheduling business that happens to sell food and this server had no way to say 'ready at 6:15'. plan/pickup-and-counter-service-spec.md is the argument; app-orders v7 is the half that lives on the order (fulfillment_method, requested_at/promised_at, ready_at/collected_at, and the preparing/ready/collected ladder), and this package is the half that decides whether a promised time is a promise or a guess. pickup_slots is a window and a number: starts_at, ends_at, and a CAPACITY COUNTED IN ORDERS RATHER THAN ITEMS, because a kitchen's real constraint is hands and handovers -- a fifteen-minute window that can look after four customers can look after them whether each ordered one coffee or three -- and because no owner alive knows how many 'items' their Friday holds while every owner knows how many people they can serve at once. system_slot_generator builds the next N days from five settings (open_time, close_time, slot_minutes, capacity_per_slot, days_ahead) on a nightly schedule, idempotent by the row's own natural key (starts_at, location_id) so re-running creates nothing twice and an operator's hand-typed 6pm slot is adopted rather than duplicated. It is a SCHEDULED PASS and not a page for one reason: a shop that has to create tomorrow's slots by hand will one day forget and take no orders at all, and that failure is silent -- an empty picker is indistinguishable from a fully-booked shop, and nothing logs an error. It only ever adds; a slot somebody edited is a decision, and a nightly pass that restated it would overwrite the operator every night. action_pickup_slots is what a storefront asks before it draws a time picker, and its answer is deliberately narrow -- open, in the future, past the lead time (pickup.lead_minutes), not at capacity -- because 'can I have a pizza at 3am' must be answered by not offering 3am, never by a refusal after the customer has typed their card in. hook_pickup_slots refuses a negative capacity and an orders_taken above capacity WITH BOTH NUMBERS, and is careful about what it does not claim: the real oversell race (two shoppers, one last place) lands through action_checkout's trusted server-side write, which bypasses hooks by design, and that is the point -- the oversell becomes a visible number on the row it happened to instead of being swallowed by a reservation ledger nobody has needed yet. What this hook refuses is a number somebody TYPED, because a typo is not a fact. The checkout gate itself lives in app-shop's action_checkout, alongside the price and stock checks and reported in the same response as them, never returned early on its own, with the next free slot named in the refusal so the shopper who lost the race is told before they pay rather than after. The attention count is orders past their promised time and not yet ready, severity warning because nobody chose to put them there and the clock is running in front of a customer; it keys on promised_at rather than on fulfillment_method, which is why a shipping order can never appear in it by construction rather than by a filter somebody has to remember. Two doors: the slot board an operator manages, and the pickup order list the count opens. Deliberately NOT here, named so each reads as a decision rather than an omission: per-line modifiers and the kitchen queue (the next slice -- the queue is the pick list with a different sort), the ready notification (an event on the transition into ready, not a button somebody forgets on a busy Friday), tax classes for prepared food, tips as a liability line, the counter sales page and its cash drawer, and any form of reservation or hold on a slot.",
6 "compatibility": {
7 "dbbasic_object_server": ">=0.1.0"
8 },
9 "dependencies": ["app-orders", "app-views"],
10 "objects": [
11 {
12 "id": "system_slot_generator",
13 "path": "objects/system/slot_generator.py"
14 },
15 {
16 "id": "action_pickup_slots",
17 "path": "objects/action/pickup_slots.py"
18 },
19 {
20 "id": "hook_pickup_slots",
21 "path": "objects/hook/pickup_slots.py"
22 },
23 {
24 "id": "system_pickup_attention",
25 "path": "objects/system/pickup_attention.py"
26 }
27 ],
28 "schemas": [
29 {
30 "collection": "pickup_slots",
31 "path": "schemas/pickup_slots.json"
32 }
33 ],
34 "permissions": [
35 {
36 "path": "permissions/rules.json"
37 }
38 ],
39 "seed": [
40 {
41 "collection": "pickup_slots",
42 "path": "seed/pickup_slots.tsv"
43 },
44 {
45 "collection": "views",
46 "path": "seed/views.tsv"
47 },
48 {
49 "collection": "site_routes",
50 "path": "seed/site_routes.tsv"
51 }
52 ],
53 "migrations": [],
54 "schedules": [
55 {
56 "id": "pickup_slot_generator_daily",
57 "object_id": "system_slot_generator",
58 "schedule": "50 3 * * *",
59 "description": "Build the next N days of collection windows from the shop's opening hours. Before dawn on purpose: the board must be complete before the first customer opens the storefront, and a pass that ran at nine would leave the morning's slots to whoever remembered. Costs almost nothing when it has nothing to do -- the (starts_at, location) key makes every window it has already built a skip. This is the pass that exists because a shop which has to type tomorrow's slots by hand will one day forget and take no orders at all, and nothing about that failure looks like a failure: the picker is simply empty."
60 }
61 ],
62 "nav": [
63 {
64 "id": "pickup_orders",
65 "label": "Pickup Orders",
66 "path": "/pickup",
67 "blurb": "Orders being collected, and when each one was promised",
68 "surface": "member",
69 "group": "Commerce",
70 "order": 425
71 },
72 {
73 "id": "pickup_slots",
74 "label": "Pickup Slots",
75 "path": "/pickup-slots",
76 "blurb": "The collection windows the shop offers and how many orders each holds",
77 "surface": "member",
78 "group": "Commerce",
79 "order": 430
80 }
81 ],
82 "attention": [
83 {
84 "id": "pickup_orders_overdue",
85 "object_id": "system_pickup_attention",
86 "label": "Orders past their promised time",
87 "path": "/pickup",
88 "nav_id": "pickup_orders",
89 "group": "Commerce",
90 "severity": "warning"
91 }
92 ]
93}