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.
dbbasic-package.json · 4.8 KB · 88 lines
| 1 | { |
| 2 | "id": "app-timers", |
| 3 | "name": "Timers", |
| 4 | "version": "0.7.2", |
| 5 | "description": "Time logs against tasks: server-enforced start/stop (62 \u2014 Timer) over an is_running/duration_seconds pair, at most one running timer per owner. No page object \u2014 generated UIs (Scroll) manage time logs from the schema; start/stop/running are server routes (objects/site/timer_actions.py), not a generator page. Declares an attention count (collection + where, counted per viewer) for the `submitted` gate: approval is by design somebody other than the person who logged the hours, which makes it the kind of queue that can only be cleared by a person who has no reason to know it exists. The count carries hours in its detail, because nine entries and sixty-two hours are different amounts of afternoon. 0.5.0 gives the approval queue somewhere to go. \"No page object\" was true and also meant no page: the attention count pointed at /time-logs?status=submitted and nothing answered that path, so the one surface that could tell an approver a queue exists linked nowhere. This version keeps the no-page-object rule and satisfies it the way the rest of the box does -- a seeded `views` record over the generic `list` block and a site_routes row to site_view_render, which is data, not a page object -- so `nav_optional` is retired and the app finally declares a door. The list omits the search box because time_logs declares no `search` fields (a box that searches nothing is a lie about the collection), keeps Add because retroactive logging is ordinary and the schema was always meant to be form-managed, and does not link rows because no /time-logs/{id} permalink is seeded. The attention path drops its query string: the generic filter bar comes from the schema's views.filter_fields and reads nothing from the URL, so ?status=submitted would have promised a filtered queue and delivered the whole collection. Worth naming as a live gap rather than hiding: every generic edit affordance is owner-gated, so an approver can SEE the submitted rows here but still approves through the API, because a manager is by definition not the owner of the hours they are approving. 0.7.1: a row a registered user writes could point at anybody's record, because the rules asked only that the new row be the writer's own. Every pointer a non-admin can write now declares relation.requires (time_logs.task_id read, time_logs.project_id read, time_logs.rate_card_id read, time_logs.invoice_id update), so over the API a row points only at a record its writer may see, or, where it moves money, stock or state of what it points at, may update; a record they may not see is answered like a missing one (docs/permissions-model.md, 'Pointing at a record you may not act on'). 0.7.2: POST /timers/start asks the record API's relation.requires question for task_id (read, through object_access) before it writes anything: it used to copy task_id from the request, so any signed-in user could start a timer on somebody else's private task, and a nonexistent id was a 500 with a traceback. A missing task and one the caller may not read get the record API's one 400; a project member and a person the task is shared with may still time it.", |
| 6 | "compatibility": { |
| 7 | "dbbasic_object_server": ">=0.1.0" |
| 8 | }, |
| 9 | "dependencies": [ |
| 10 | "app-tasks", |
| 11 | "app-views" |
| 12 | ], |
| 13 | "objects": [ |
| 14 | { |
| 15 | "id": "site_timer_actions", |
| 16 | "path": "objects/site/timer_actions.py" |
| 17 | }, |
| 18 | { |
| 19 | "id": "hook_time_logs", |
| 20 | "path": "objects/hook/time_logs.py" |
| 21 | } |
| 22 | ], |
| 23 | "schemas": [ |
| 24 | { |
| 25 | "collection": "time_logs", |
| 26 | "path": "schemas/time_logs.json" |
| 27 | }, |
| 28 | { |
| 29 | "collection": "rate_cards", |
| 30 | "path": "schemas/rate_cards.json" |
| 31 | } |
| 32 | ], |
| 33 | "permissions": [ |
| 34 | { |
| 35 | "path": "permissions/rules.json" |
| 36 | } |
| 37 | ], |
| 38 | "seed": [ |
| 39 | { |
| 40 | "collection": "time_logs", |
| 41 | "path": "seed/time_logs.tsv" |
| 42 | }, |
| 43 | { |
| 44 | "collection": "site_routes", |
| 45 | "path": "seed/site_routes.tsv" |
| 46 | }, |
| 47 | { |
| 48 | "collection": "rate_cards", |
| 49 | "path": "seed/rate_cards.tsv" |
| 50 | }, |
| 51 | { |
| 52 | "collection": "views", |
| 53 | "path": "seed/views.tsv" |
| 54 | } |
| 55 | ], |
| 56 | "migrations": [], |
| 57 | "nav": [ |
| 58 | { |
| 59 | "id": "time_logs", |
| 60 | "label": "Time", |
| 61 | "path": "/time-logs", |
| 62 | "blurb": "Hours logged against tasks, and the ones waiting for an approver", |
| 63 | "surface": "member", |
| 64 | "group": "Work", |
| 65 | "order": 45 |
| 66 | } |
| 67 | ], |
| 68 | "attention": [ |
| 69 | { |
| 70 | "id": "time_to_approve", |
| 71 | "collection": "time_logs", |
| 72 | "where": { |
| 73 | "status": "submitted" |
| 74 | }, |
| 75 | "detail": { |
| 76 | "op": "sum", |
| 77 | "field": "duration_seconds", |
| 78 | "format": "hours", |
| 79 | "text": "{value} hours awaiting approval" |
| 80 | }, |
| 81 | "label": "Time to approve", |
| 82 | "path": "/time-logs", |
| 83 | "group": "Money", |
| 84 | "severity": "normal", |
| 85 | "nav_id": "time_logs" |
| 86 | } |
| 87 | ] |
| 88 | } |