Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

9 downloads

Install on DigitalOcean 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.

Daniel Quellhorst Changelog for this batch. 65ef78d 3 hours, 42 minutes ago History
shipment_lines.json · 3.7 KB · 80 lines
1{
2 "name": "shipment_lines",
3 "title": "Shipment Lines",
4 "version": 4,
5 "hooks": {"before_write": "hook_shipment_lines"},
6 "description": "What was actually in the box. This is the collection partial fulfillment is derived FROM: cumulative shipped quantity per order line is a fold over these rows, and orders.status (partial/shipped/delivered) is a read of that fold, never a hand-maintained flag. The gate that makes the fold trustworthy lives in hook_shipment_lines: cumulative quantity across every shipment of one order line may never exceed the quantity ordered, refused with all three numbers rather than a shrug. description is STAMPED from the order line at creation so a packing slip printed next year still says what the packer put in the box, even if the product has since been renamed (docs/logic-decisions.md #1). v4: relation.requires update on the shipment, the order line shipped and the product.",
7 "fields": [
8 {
9 "name": "id"
10 },
11 {
12 "name": "shipment_id",
13 "subject": "relation",
14 "type": "relation",
15 "required": true,
16 "relation": {
17 "collection": "shipments",
18 "display_field": "id",
19 "requires": "update"},
20 "label": "Shipment",
21 "help": "Set once at creation and not intended to change after -- not schema read_only for the same reason order_lines.order_id is not: a required, client-submitted-at-creation field cannot also be read_only on this platform."
22 },
23 {
24 "name": "order_line_id",
25 "type": "text",
26 "required": true,
27 "relation": {
28 "collection": "order_lines",
29 "display_field": "description",
30 "requires": "update"},
31 "label": "Order Line",
32 "help": "Which order line this quantity satisfies. Required, and not merely a cross-reference: without it the over-shipping gate has nothing to count against, and 'we shipped three of something' is not an answer to 'did the customer get what they ordered?'. Plain text rather than a declared relation, so this package can be installed alongside an app-orders that is not there yet -- the hook does the real check and says so in words."
33 },
34 {
35 "name": "product_id",
36 "label": "Product",
37 "relation": {
38 "collection": "products",
39 "display_field": "name",
40 "requires": "update"},
41 "help": "Optional cross-reference to app-catalog's products, mirroring order_lines.product_id. It is what the sale stock move is composed against; a line with no product moves no stock, which is correct for a service or a free-text line that never sat on a shelf."
42 },
43 {
44 "name": "description",
45 "type": "text",
46 "label": "Description",
47 "validation": {"max_length": 300},
48 "help": "Stamped from the order line at creation. The packing slip prints THIS, not a live product lookup: a parcel's paperwork must keep saying what was in it."
49 },
50 {
51 "name": "quantity",
52 "type": "number",
53 "default": "1",
54 "required": true,
55 "validation": {"exclusive_min": 0},
56 "label": "Quantity",
57 "help": "A count/measure, not money -- may be fractional, same deliberate exception order_lines.quantity documents. Read with Decimal everywhere (hook_shipment_lines, action_create_shipment, system_order_fulfillment), never a bare float."
58 },
59 {
60 "name": "owner_id",
61 "type": "text",
62 "label": "Owner"
63 },
64 {
65 "name": "created_at",
66 "type": "datetime",
67 "label": "Created",
68 "read_only": true
69 }
70 ],
71 "forms": {
72 "default": {
73 "fields": ["shipment_id", "order_line_id", "product_id", "description", "quantity"]
74 }
75 },
76 "views": {
77 "list_mode": "table",
78 "list_fields": ["description", "quantity", "shipment_id"]
79 }
80}