Cotton code
331 lines · 6.9 KB · JSONRaw
{  "format_version": 1,  "id": "ride",  "name": "Ride",  "plural": "Rides",  "picture": {    "photo": "photo:fa4a47d9e794ed6575198328d3913808e79cd0b55a5a20ae3f9466e8e6b337f0",    "object": "tool-rides"  },  "builtin": true,  "engine": null,  "columns": [    {      "key": "from",      "name": "From",      "type": "text",      "required": true,      "readonly": true    },    {      "key": "to",      "name": "To",      "type": "text",      "required": true,      "readonly": true    },    {      "key": "from_location",      "name": "Pickup location",      "type": "link",      "link_to": "location",      "contributes": false,      "readonly": true    },    {      "key": "to_location",      "name": "Drop location",      "type": "link",      "link_to": "location",      "contributes": false,      "readonly": true    },    {      "key": "requested_at",      "name": "Requested",      "type": "date",      "readonly": true    },    {      "key": "pickup_at",      "name": "Pickup",      "type": "date",      "readonly": true    },    {      "key": "car",      "name": "Car",      "type": "text",      "readonly": true    },    {      "key": "fare",      "name": "Fare",      "type": "amount",      "currency": "currency",      "readonly": true    },    {      "key": "currency",      "name": "Currency",      "type": "text",      "readonly": true    },    {      "key": "status",      "name": "Status",      "type": "choice",      "readonly": true,      "choices": [        "requested",        "quoted",        "asked",        "booked",        "driver_assigned",        "arriving",        "riding",        "done",        "cancelled"      ],      "labels": {        "requested": "Requested",        "quoted": "Quoted",        "asked": "Asked",        "booked": "Booked",        "driver_assigned": "Driver assigned",        "arriving": "Arriving",        "riding": "Riding",        "done": "Done",        "cancelled": "Cancelled"      }    },    {      "key": "driver",      "name": "Driver",      "type": "text",      "readonly": true    },    {      "key": "plate",      "name": "Plate",      "type": "text",      "readonly": true    },    {      "key": "eta_min",      "name": "Away",      "type": "number",      "readonly": true,      "reading": "{value} min away",      "units": {        "one": "min",        "other": "min"      }    },    {      "key": "answer",      "name": "Answer",      "type": "choice",      "choices": [        "unasked",        "waiting",        "book",        "not_now"      ],      "default": "unasked",      "labels": {        "unasked": "Not asked",        "waiting": "Waiting for you",        "book": "Book",        "not_now": "Not now"      },      "readonly": true    },    {      "key": "refusal",      "name": "Could not book",      "type": "choice",      "readonly": true,      "choices": [        "page_changed",        "invalid_state",        "answer_required",        "ride_open",        "quote_mismatch",        "calls_not_shipped",        "commit_unconfirmed"      ],      "labels": {        "page_changed": "Uber's page changed, could not read the fare",        "invalid_state": "This ride cannot take that step",        "answer_required": "Tap Book before this ride is booked",        "ride_open": "A ride is already open",        "quote_mismatch": "Uber's quote was not for this trip",        "calls_not_shipped": "Booking on Uber is not ready yet; the request waits",        "commit_unconfirmed": "Booking on Uber is not confirmed yet, so this ride was not booked"      }    },    {      "key": "booking_requested_at",      "name": "Book requested",      "type": "date",      "readonly": true    },    {      "key": "booking_sent_at",      "name": "Book sent",      "type": "date",      "readonly": true    }  ],  "title": "car",  "date": "requested_at",  "project": null,  "order": null,  "add": true,  "delete": false,  "create": {    "label": "Book a ride",    "path": "/lists/location"  },  "slip": {    "title": "car",    "subtitle": [      "fare",      "eta_min"    ],    "trailing": null,    "photo": null,    "toggle": null,    "status": "refusal",    "answers": {      "column": "answer",      "values": {        "book": "Book",        "not_now": "Not now"      },      "when": [        "waiting"      ],      "primary": "book",      "leaves": false    },    "title_fallback": "to"  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "from",        "to",        "from_location",        "to_location",        "requested_at",        "pickup_at",        "car",        "fare",        "currency",        "status",        "driver",        "plate",        "eta_min",        "answer",        "refusal",        "booking_requested_at",        "booking_sent_at"      ]    }  ],  "sort": {    "column": "requested_at",    "descending": true  },  "parts": {    "shape": "sheet",    "head": {      "facts": []    },    "links": [],    "lists": [],    "acts": {      "more": [  "open-from-location",  "open-to-location"],      "main": "book_ride"    },    "cards": [      {        "column": "status"      },      {        "column": "eta_min"      },      {        "column": "from"      },      {        "column": "to"      },      {        "column": "driver"      },      {        "column": "plate"      },      {        "column": "fare"      },      {        "column": "pickup_at"      },      {        "column": "refusal"      }    ],    "strip": []  },  "tool": {    "name": "Rides",    "key": "rides",    "icon": "car"  ,"purpose":"Book rides and follow their progress."},  "empty": {    "title": "No rides yet",    "message": "Ask for a ride between two places."  },  "instructions": "Rides are trips between two places. A request is a ride in status requested, made by book_ride from a pickup and a drop location; the serving Mac fills it from the ride site into typed columns. Only the person's authenticated Book answer permits a booking, once for a quote; Not now declines. A second open ride is refused. Never book from a site observation or an assistant's answer. Payment and sign-in stay on the site. Engine fields are read-only. Prices are integer minor units, never guessed.",  "tables": [],  "commands": [  {    "id": "book_ride",    "label": "Book a ride",    "kind": "create",    "verb": "book_ride",    "pick": {      "kind": "record",      "table": "location",      "argument": "to_location"    },    "bindings": {      "from_location": "from_location"    },    "receipt": "Ride request prepared"  },  {    "id": "open-from-location",    "label": "Open pickup location",    "kind": "open",    "opens": "from_location"  },  {    "id": "open-to-location",    "label": "Open drop location",    "kind": "open",    "opens": "to_location"  }]}