Commit 038ccde
feat(audit): sys_activity source pointer — the ActivityPointer model (ADR-0052 §5) (#1957)
Add `source_object` / `source_id` to `sys_activity`. `object_name`/`record_id`
say WHICH record an activity is about (the "regarding" record); the new pair
points to the RICH ENTITY it was derived from — the email row in `sys_email`,
the call/meeting task, the `sys_comment` — so the timeline drills from a one-line
summary to the full record, and apps can query "all activities sourced from X".
This completes `sys_activity` as a proper ActivityPointer base (cf. Dataverse
ActivityPointer → Email/PhoneCall/Appointment; Salesforce ActivityTimeline →
EmailMessage/Task/Event): one materialized, indexed timeline that references —
never duplicates — the rich, separately-tabled communication entities. The
structured, queryable replacement for an id buried in `metadata`.
Deliberately NOT done (per the design review): extending the `type` enum with
domain verbs (email/call/meeting) — that couples a shared platform primitive to
one vertical's vocabulary. `type` stays neutral; domain kind rides in
`metadata.kind`; the rich entity lives in its own table.
- sys-activity.object.ts: + source_object, source_id (text, searchable, optional)
- ADR-0052 §5 updated to the ActivityPointer model
- Verified in the showcase: a source-pointed activity round-trips and is
queryable by source_object; plugin-audit 18/18 tests pass.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2daa8e2 commit 038ccde
2 files changed
Lines changed: 55 additions & 6 deletions
File tree
- docs/adr
- packages/plugins/plugin-audit/src/objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
187 | 206 | | |
188 | 207 | | |
189 | 208 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
131 | 161 | | |
132 | 162 | | |
133 | 163 | | |
| |||
0 commit comments