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
message_threads.json · 4.1 KB · 98 lines
| 1 | { |
| 2 | "name": "message_threads", |
| 3 | "title": "Message Threads", |
| 4 | "version": 1, |
| 5 | "description": "One conversation: a subject, a denormalized participant snapshot, and the flags an inbox needs (star/archive/trash, an unread rollup, a running message count) -- a faithful port of a private predecessor-system audit's unified-inbox thread model, not part of this repo. That source handled BOTH internal user-to-user DMs and real external email through the same thread shape (thread_type); this package carries that same split even though the external half has no transport wired up yet (see dbbasic-package.json's deferred list). participant_summary is a plain display snapshot, not a participants relation/M2M -- this codebase has no user-directory join built for that, and a snapshot is the same trade-off app-invoices' invoices.customer_name makes for its customer relation. labels is free text (comma-separated), not a labels/taxonomy collection -- same call app-worker's profiles.skills makes for free-text skills, not a relation.", |
| 6 | "fields": [ |
| 7 | { |
| 8 | "name": "id" |
| 9 | }, |
| 10 | { |
| 11 | "name": "thread_type", |
| 12 | "type": "enum", |
| 13 | "default": "email", |
| 14 | "enum": ["internal", "email"], |
| 15 | "label": "Thread Type", |
| 16 | "help": "internal = a DM between this codebase's own users; email = external mail. Carried from the source model's own split. No IMAP/SMTP sync exists yet (deferred -- see dbbasic-package.json), so an email-type thread's messages are only ever created here by hand, by a seed, or by a future sync job." |
| 17 | }, |
| 18 | { |
| 19 | "name": "subject", |
| 20 | "type": "text", |
| 21 | "label": "Subject", |
| 22 | "validation": {"max_length": 300} |
| 23 | }, |
| 24 | { |
| 25 | "name": "participant_summary", |
| 26 | "type": "text", |
| 27 | "label": "Participants", |
| 28 | "validation": {"max_length": 300}, |
| 29 | "help": "Denormalized display string (e.g. names or addresses, comma-separated) -- not a relation. See this schema's own description for why." |
| 30 | }, |
| 31 | { |
| 32 | "name": "last_message_at", |
| 33 | "type": "datetime", |
| 34 | "label": "Last Message" |
| 35 | }, |
| 36 | { |
| 37 | "name": "message_count", |
| 38 | "type": "number", |
| 39 | "default": "0", |
| 40 | "label": "Message Count", |
| 41 | "help": "Running total, carried like forum_topics.views: this package does not stamp or increment it -- see dbbasic-package.json's deferred list." |
| 42 | }, |
| 43 | { |
| 44 | "name": "is_read", |
| 45 | "type": "boolean", |
| 46 | "default": "true", |
| 47 | "label": "Read", |
| 48 | "help": "Unread rollup for the thread as a whole. Defaults true because this package ships no inbound-transport insertion path (IMAP sync is deferred) -- a record created here by hand, seed, or draft save is never something the owner needs to \"catch up on\". A future sync job is what should set this false on a newly-synced inbound thread. Toggled by the thread page's mark-read action, and independently by each message's own is_read (see schemas/messages.json)." |
| 49 | }, |
| 50 | { |
| 51 | "name": "is_starred", |
| 52 | "type": "boolean", |
| 53 | "default": "false", |
| 54 | "label": "Starred" |
| 55 | }, |
| 56 | { |
| 57 | "name": "is_archived", |
| 58 | "type": "boolean", |
| 59 | "default": "false", |
| 60 | "label": "Archived" |
| 61 | }, |
| 62 | { |
| 63 | "name": "is_trashed", |
| 64 | "type": "boolean", |
| 65 | "default": "false", |
| 66 | "label": "Trashed", |
| 67 | "help": "v1 posture: a flag the owner sets and unsets, same as is_archived. There is no separate trash-empty/purge behavior built here -- see dbbasic-package.json's deferred list." |
| 68 | }, |
| 69 | { |
| 70 | "name": "labels", |
| 71 | "type": "text", |
| 72 | "label": "Labels", |
| 73 | "validation": {"max_length": 300}, |
| 74 | "help": "Free text, comma-separated. No labels/taxonomy collection exists -- see this schema's own description." |
| 75 | }, |
| 76 | { |
| 77 | "name": "owner_id", |
| 78 | "type": "text", |
| 79 | "label": "Owner" |
| 80 | }, |
| 81 | { |
| 82 | "name": "created_at", |
| 83 | "type": "datetime", |
| 84 | "label": "Created", |
| 85 | "read_only": true |
| 86 | } |
| 87 | ], |
| 88 | "forms": { |
| 89 | "default": {"fields": ["thread_type", "subject", "labels"]} |
| 90 | }, |
| 91 | "views": { |
| 92 | "list_mode": "feed", |
| 93 | "list_fields": ["subject", "participant_summary", "last_message_at", "is_read"] |
| 94 | }, |
| 95 | "search": { |
| 96 | "fields": ["subject", "participant_summary", "labels"] |
| 97 | } |
| 98 | } |