@@ -15,6 +15,34 @@ import { Contact } from '../objects/contact.object.js';
1515import { Inquiry } from '../objects/inquiry.object.js' ;
1616import { FieldZoo } from '../objects/field-zoo.object.js' ;
1717import { Announcement } from '../objects/announcement.object.js' ;
18+ import { ADMIN_EMAIL , PHONE_DEMO_USER , AUDITOR_DEMO_USER } from '../../security/demo-personas.js' ;
19+
20+ /**
21+ * ## Why assignees/owners are addressed to the PROVISIONED personas (#7746)
22+ *
23+ * `showcase_task.assignee` and `showcase_project.owner` are `Field.text`, but
24+ * they are not free text: the notify nodes in `automation/flows` read them as
25+ * RECIPIENTS (`recipients: ['{record.assignee}']`, `['{record.owner}']`). An
26+ * email-shaped recipient is resolved against `sys_user`, and on a MISS the
27+ * resolver keeps it VERBATIM as the recipient id — so a made-up address does
28+ * not fail loudly, it persists a `sys_inbox_message` whose `user_id` is a
29+ * string no authenticated user can ever match.
30+ *
31+ * The seed used to write `ada@` / `linus@` / `grace@` / `sam@example.com`
32+ * here, none of which is a `sys_user`. Reassigning a seeded task — the stock
33+ * demo of `showcase_task_assigned_notify` — therefore delivered into a void,
34+ * and the QA run that found this (#7690) had to sign up its own personas to
35+ * exercise the notify path at all.
36+ *
37+ * The three constants below are the identities this app actually provisions on
38+ * a dev boot. `demo-personas.ts` documents that set, its dev-only limits, and
39+ * why `invoice.owner` / `team.lead` deliberately KEEP their `ada@`-style
40+ * emails. Three distinct values still spread across every Kanban column,
41+ * gallery card and list, so the "feed every view" principle below is intact.
42+ */
43+ const ADMIN = ADMIN_EMAIL ;
44+ const MEI = PHONE_DEMO_USER . email ;
45+ const ADA = AUDITOR_DEMO_USER . email ;
1846
1947/**
2048 * Seed data sized to "feed every view": every Kanban column is populated,
@@ -143,11 +171,11 @@ const projects = defineSeed(Project, {
143171 mode : 'upsert' ,
144172 externalId : 'name' ,
145173 records : [
146- { name : 'Website Relaunch' , account : 'Northwind' , status : 'active' , health : 'green' , budget : 150_000 , spent : 60_000 , owner : 'ada@example.com' , start_date : cel `daysAgo(30)` , end_date : cel `daysFromNow(60)` } ,
147- { name : 'Data Platform' , account : 'Contoso' , status : 'active' , health : 'yellow' , budget : 600_000 , spent : 420_000 , owner : 'linus@example.com' , start_date : cel `daysAgo(90)` , end_date : cel `daysFromNow(120)` } ,
148- { name : 'Compliance Audit' , account : 'Fabrikam' , status : 'on_hold' , health : 'red' , budget : 90_000 , spent : 88_000 , owner : 'grace@example.com' , start_date : cel `daysAgo(15)` , end_date : cel `daysFromNow(30)` } ,
149- { name : 'Mobile App' , account : 'Contoso' , status : 'planned' , health : 'green' , budget : 200_000 , spent : 0 , owner : 'ada@example.com' , start_date : cel `daysFromNow(14)` , end_date : cel `daysFromNow(140)` } ,
150- { name : 'Legacy Sunset' , account : 'Northwind' , status : 'completed' , health : 'green' , budget : 50_000 , spent : 48_000 , owner : 'linus@example.com' , start_date : cel `daysAgo(180)` , end_date : cel `daysAgo(20)` } ,
174+ { name : 'Website Relaunch' , account : 'Northwind' , status : 'active' , health : 'green' , budget : 150_000 , spent : 60_000 , owner : ADA , start_date : cel `daysAgo(30)` , end_date : cel `daysFromNow(60)` } ,
175+ { name : 'Data Platform' , account : 'Contoso' , status : 'active' , health : 'yellow' , budget : 600_000 , spent : 420_000 , owner : ADMIN , start_date : cel `daysAgo(90)` , end_date : cel `daysFromNow(120)` } ,
176+ { name : 'Compliance Audit' , account : 'Fabrikam' , status : 'on_hold' , health : 'red' , budget : 90_000 , spent : 88_000 , owner : MEI , start_date : cel `daysAgo(15)` , end_date : cel `daysFromNow(30)` } ,
177+ { name : 'Mobile App' , account : 'Contoso' , status : 'planned' , health : 'green' , budget : 200_000 , spent : 0 , owner : ADA , start_date : cel `daysFromNow(14)` , end_date : cel `daysFromNow(140)` } ,
178+ { name : 'Legacy Sunset' , account : 'Northwind' , status : 'completed' , health : 'green' , budget : 50_000 , spent : 48_000 , owner : ADMIN , start_date : cel `daysAgo(180)` , end_date : cel `daysAgo(20)` } ,
151179 ] ,
152180} ) ;
153181
@@ -156,16 +184,16 @@ const tasks = defineSeed(Task, {
156184 mode : 'upsert' ,
157185 externalId : 'title' ,
158186 records : [
159- { title : 'Audit current IA' , project : 'Website Relaunch' , assignee : 'ada@example.com' , status : 'done' , priority : 'medium' , estimate_hours : 8 , progress : 100 , done : true , created_at : cel `daysAgo(20)` , start_date : cel `daysAgo(20)` , end_date : cel `daysAgo(18)` , due_date : cel `daysAgo(18)` , location : { lat : 47.6062 , lng : - 122.3321 } } ,
160- { title : 'Design system' , project : 'Website Relaunch' , assignee : 'ada@example.com' , status : 'in_review' , priority : 'high' , estimate_hours : 24 , progress : 80 , done : false , created_at : cel `daysAgo(14)` , start_date : cel `daysAgo(12)` , end_date : cel `daysFromNow(2)` , due_date : cel `daysFromNow(2)` , location : { lat : 37.7749 , lng : - 122.4194 } } ,
161- { title : 'Build homepage' , project : 'Website Relaunch' , assignee : 'sam@example.com' , status : 'in_progress' , priority : 'high' , estimate_hours : 40 , progress : 45 , done : false , created_at : cel `daysAgo(8)` , start_date : cel `daysAgo(6)` , end_date : cel `daysFromNow(10)` , due_date : cel `daysFromNow(10)` , location : { lat : 40.7128 , lng : - 74.0060 } } ,
162- { title : 'SEO migration plan' , project : 'Website Relaunch' , assignee : 'sam@example.com' , status : 'todo' , priority : 'medium' , estimate_hours : 16 , progress : 0 , done : false , created_at : cel `daysAgo(3)` , start_date : cel `daysFromNow(5)` , end_date : cel `daysFromNow(15)` , due_date : cel `daysFromNow(15)` , location : { lat : 30.2672 , lng : - 97.7431 } } ,
163- { title : 'Content backlog' , project : 'Website Relaunch' , assignee : 'grace@example.com' , status : 'backlog' , priority : 'low' , estimate_hours : 12 , progress : 0 , done : false , created_at : cel `daysAgo(2)` , due_date : cel `daysFromNow(30)` , location : { lat : 41.8781 , lng : - 87.6298 } } ,
164- { title : 'Ingest pipeline' , project : 'Data Platform' , assignee : 'linus@example.com' , status : 'in_progress' , priority : 'urgent' , estimate_hours : 60 , progress : 55 , done : false , created_at : cel `daysAgo(40)` , start_date : cel `daysAgo(35)` , end_date : cel `daysFromNow(20)` , due_date : cel `daysFromNow(20)` , location : { lat : 39.7392 , lng : - 104.9903 } } ,
165- { title : 'Warehouse schema' , project : 'Data Platform' , assignee : 'linus@example.com' , status : 'in_review' , priority : 'high' , estimate_hours : 30 , progress : 90 , done : false , created_at : cel `daysAgo(25)` , start_date : cel `daysAgo(22)` , end_date : cel `daysFromNow(3)` , due_date : cel `daysFromNow(3)` , location : { lat : 42.3601 , lng : - 71.0589 } } ,
166- { title : 'PII access review' , project : 'Compliance Audit' , assignee : 'grace@example.com' , status : 'todo' , priority : 'urgent' , estimate_hours : 20 , progress : 0 , done : false , created_at : cel `daysAgo(5)` , start_date : cel `daysFromNow(2)` , end_date : cel `daysFromNow(12)` , due_date : cel `daysFromNow(12)` , location : { lat : 38.9072 , lng : - 77.0369 } } ,
167- { title : 'Evidence collection' , project : 'Compliance Audit' , assignee : 'grace@example.com' , status : 'backlog' , priority : 'medium' , estimate_hours : 18 , progress : 0 , done : false , created_at : cel `daysAgo(1)` , due_date : cel `daysFromNow(25)` , location : { lat : 34.0522 , lng : - 118.2437 } } ,
168- { title : 'App wireframes' , project : 'Mobile App' , assignee : 'ada@example.com' , status : 'done' , priority : 'medium' , estimate_hours : 16 , progress : 100 , done : true , created_at : cel `daysAgo(10)` , start_date : cel `daysAgo(10)` , end_date : cel `daysAgo(6)` , due_date : cel `daysAgo(6)` , location : { lat : 45.5152 , lng : - 122.6784 } } ,
187+ { title : 'Audit current IA' , project : 'Website Relaunch' , assignee : ADA , status : 'done' , priority : 'medium' , estimate_hours : 8 , progress : 100 , done : true , created_at : cel `daysAgo(20)` , start_date : cel `daysAgo(20)` , end_date : cel `daysAgo(18)` , due_date : cel `daysAgo(18)` , location : { lat : 47.6062 , lng : - 122.3321 } } ,
188+ { title : 'Design system' , project : 'Website Relaunch' , assignee : ADA , status : 'in_review' , priority : 'high' , estimate_hours : 24 , progress : 80 , done : false , created_at : cel `daysAgo(14)` , start_date : cel `daysAgo(12)` , end_date : cel `daysFromNow(2)` , due_date : cel `daysFromNow(2)` , location : { lat : 37.7749 , lng : - 122.4194 } } ,
189+ { title : 'Build homepage' , project : 'Website Relaunch' , assignee : ADMIN , status : 'in_progress' , priority : 'high' , estimate_hours : 40 , progress : 45 , done : false , created_at : cel `daysAgo(8)` , start_date : cel `daysAgo(6)` , end_date : cel `daysFromNow(10)` , due_date : cel `daysFromNow(10)` , location : { lat : 40.7128 , lng : - 74.0060 } } ,
190+ { title : 'SEO migration plan' , project : 'Website Relaunch' , assignee : ADMIN , status : 'todo' , priority : 'medium' , estimate_hours : 16 , progress : 0 , done : false , created_at : cel `daysAgo(3)` , start_date : cel `daysFromNow(5)` , end_date : cel `daysFromNow(15)` , due_date : cel `daysFromNow(15)` , location : { lat : 30.2672 , lng : - 97.7431 } } ,
191+ { title : 'Content backlog' , project : 'Website Relaunch' , assignee : MEI , status : 'backlog' , priority : 'low' , estimate_hours : 12 , progress : 0 , done : false , created_at : cel `daysAgo(2)` , due_date : cel `daysFromNow(30)` , location : { lat : 41.8781 , lng : - 87.6298 } } ,
192+ { title : 'Ingest pipeline' , project : 'Data Platform' , assignee : ADMIN , status : 'in_progress' , priority : 'urgent' , estimate_hours : 60 , progress : 55 , done : false , created_at : cel `daysAgo(40)` , start_date : cel `daysAgo(35)` , end_date : cel `daysFromNow(20)` , due_date : cel `daysFromNow(20)` , location : { lat : 39.7392 , lng : - 104.9903 } } ,
193+ { title : 'Warehouse schema' , project : 'Data Platform' , assignee : ADMIN , status : 'in_review' , priority : 'high' , estimate_hours : 30 , progress : 90 , done : false , created_at : cel `daysAgo(25)` , start_date : cel `daysAgo(22)` , end_date : cel `daysFromNow(3)` , due_date : cel `daysFromNow(3)` , location : { lat : 42.3601 , lng : - 71.0589 } } ,
194+ { title : 'PII access review' , project : 'Compliance Audit' , assignee : MEI , status : 'todo' , priority : 'urgent' , estimate_hours : 20 , progress : 0 , done : false , created_at : cel `daysAgo(5)` , start_date : cel `daysFromNow(2)` , end_date : cel `daysFromNow(12)` , due_date : cel `daysFromNow(12)` , location : { lat : 38.9072 , lng : - 77.0369 } } ,
195+ { title : 'Evidence collection' , project : 'Compliance Audit' , assignee : MEI , status : 'backlog' , priority : 'medium' , estimate_hours : 18 , progress : 0 , done : false , created_at : cel `daysAgo(1)` , due_date : cel `daysFromNow(25)` , location : { lat : 34.0522 , lng : - 118.2437 } } ,
196+ { title : 'App wireframes' , project : 'Mobile App' , assignee : ADA , status : 'done' , priority : 'medium' , estimate_hours : 16 , progress : 100 , done : true , created_at : cel `daysAgo(10)` , start_date : cel `daysAgo(10)` , end_date : cel `daysAgo(6)` , due_date : cel `daysAgo(6)` , location : { lat : 45.5152 , lng : - 122.6784 } } ,
169197 ] ,
170198} ) ;
171199
0 commit comments