@@ -28,64 +28,107 @@ async function seed() {
2828 await session . run ( 'MATCH (n) DETACH DELETE n' ) ;
2929 // eslint-disable-next-line no-console
3030 console . log ( '✨ Cleared existing data' ) ;
31-
32- // Create work items with proper team IDs
31+
32+ // Create graphs first
33+ const graphs = [
34+ {
35+ id : 'welcome-graph-shared' ,
36+ name : 'Welcome to GraphDone' ,
37+ description : 'A tutorial graph to help you understand GraphDone' ,
38+ isPublic : true ,
39+ teamId : 'team-1' ,
40+ userId : 'user-1'
41+ } ,
42+ {
43+ id : 'graph-project-alpha' ,
44+ name : 'Project Alpha' ,
45+ description : 'Main development project' ,
46+ isPublic : false ,
47+ teamId : 'team-1' ,
48+ userId : 'user-1'
49+ } ,
50+ {
51+ id : 'graph-test-beta' ,
52+ name : 'Test Graph Beta' ,
53+ description : 'Testing and experimentation' ,
54+ isPublic : false ,
55+ teamId : 'team-1' ,
56+ userId : 'user-2'
57+ }
58+ ] ;
59+
60+ for ( const graph of graphs ) {
61+ await session . run (
62+ `CREATE (g:Graph {
63+ id: $id,
64+ name: $name,
65+ description: $description,
66+ isPublic: $isPublic,
67+ teamId: $teamId,
68+ userId: $userId,
69+ createdAt: datetime(),
70+ updatedAt: datetime()
71+ })` ,
72+ graph
73+ ) ;
74+ }
75+ // eslint-disable-next-line no-console
76+ console . log ( `✅ Created ${ graphs . length } graphs` ) ;
77+
78+ // Create work items with proper team IDs and graph assignments
3379 const workItems = [
34- // Infrastructure & Setup
35- { id : 'wi-1' , title : 'Set up Neo4j database' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' } ,
36- { id : 'wi-2' , title : 'Configure GraphQL schema' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' } ,
37- { id : 'wi-3' , title : 'Implement authentication' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' } ,
38- { id : 'wi-4' , title : 'Set up CI/CD pipeline' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-3' } ,
39-
40- // Core Features
41- { id : 'wi-5' , title : 'Graph visualization system' , type : 'MILESTONE' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-1' } ,
42- { id : 'wi-6' , title : 'Implement D3.js force layout' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-2' } ,
43- { id : 'wi-7' , title : 'Add node drag interaction' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-2' } ,
44- { id : 'wi-8' , title : 'Create edge rendering system' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-3' } ,
45-
46- // Ideas & Proposals
47- { id : 'wi-9' , title : 'AI agent integration' , type : 'IDEA' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' } ,
48- { id : 'wi-10' , title : 'Mobile app development' , type : 'IDEA' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-5' } ,
49- { id : 'wi-11' , title : 'Real-time collaboration' , type : 'IDEA' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-1' } ,
50-
51- // Outcomes
52- { id : 'wi-12' , title : 'Production-ready graph system' , type : 'OUTCOME' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-1' } ,
53- { id : 'wi-13' , title : 'Scalable architecture' , type : 'OUTCOME' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' } ,
54-
55- // Additional tasks for testing
56- { id : 'wi-14' , title : 'Write unit tests' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-3' } ,
57- { id : 'wi-15' , title : 'Performance optimization' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-4' } ,
58- { id : 'wi-16' , title : 'Documentation update' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-5' } ,
59-
60- // More features
61- { id : 'wi-17' , title : 'User dashboard' , type : 'MILESTONE' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-1' } ,
62- { id : 'wi-18' , title : 'Analytics module' , type : 'MILESTONE' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-2' } ,
63- { id : 'wi-19' , title : 'Export functionality' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-3' } ,
64- { id : 'wi-20' , title : 'Import from other tools' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' } ,
65-
66- // Test data variations
67- { id : 'wi-21' , title : 'Test WithAPOC' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' } ,
68- { id : 'wi-22' , title : 'testUI Test' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' } ,
69- { id : 'wi-23' , title : 'Form validation testing' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-3' } ,
70- { id : 'wi-24' , title : 'Edge case handling' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' } ,
80+ // Welcome Graph Items (tutorial)
81+ { id : 'wi-welcome-1' , title : 'Welcome to GraphDone!' , type : 'MILESTONE' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'welcome-graph-shared' } ,
82+ { id : 'wi-welcome-2' , title : 'Create your first work item' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'welcome-graph-shared' } ,
83+ { id : 'wi-welcome-3' , title : 'Connect work items together' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-1' , graphId : 'welcome-graph-shared' } ,
84+ { id : 'wi-welcome-4' , title : 'Explore different views' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'welcome-graph-shared' } ,
85+
86+ // Project Alpha - Infrastructure & Setup
87+ { id : 'wi-1' , title : 'Set up Neo4j database' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-project-alpha' } ,
88+ { id : 'wi-2' , title : 'Configure GraphQL schema' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-project-alpha' } ,
89+ { id : 'wi-3' , title : 'Implement authentication' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-project-alpha' } ,
90+ { id : 'wi-4' , title : 'Set up CI/CD pipeline' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-project-alpha' } ,
7191
72- // Strategic items
73- { id : 'wi-25 ' , title : 'Q1 2024 Planning ' , type : 'MILESTONE' , status : 'COMPLETED ' , teamId : 'team-1' , userId : 'user-1' } ,
74- { id : 'wi-26 ' , title : 'Product roadmap review ' , type : 'OUTCOME ' , status : 'IN_PROGRESS ' , teamId : 'team-1' , userId : 'user-2' } ,
75- { id : 'wi-27 ' , title : 'Customer feedback analysis ' , type : 'TASK' , status : 'PLANNED ' , teamId : 'team-1' , userId : 'user-3 ' } ,
76- { id : 'wi-28 ' , title : 'Market research ' , type : 'TASK' , status : 'PROPOSED ' , teamId : 'team-1' , userId : 'user-4 ' } ,
92+ // Project Alpha - Core Features
93+ { id : 'wi-5 ' , title : 'Graph visualization system ' , type : 'MILESTONE' , status : 'IN_PROGRESS ' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-project-alpha ' } ,
94+ { id : 'wi-6 ' , title : 'Implement D3.js force layout ' , type : 'TASK ' , status : 'COMPLETED ' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-project-alpha ' } ,
95+ { id : 'wi-7 ' , title : 'Add node drag interaction ' , type : 'TASK' , status : 'COMPLETED ' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-project-alpha ' } ,
96+ { id : 'wi-8 ' , title : 'Create edge rendering system ' , type : 'TASK' , status : 'IN_PROGRESS ' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-project-alpha ' } ,
7797
78- // Technical debt
79- { id : 'wi-29' , title : 'Refactor graph engine' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-5' } ,
80- { id : 'wi-30' , title : 'Update dependencies' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-1' } ,
81- { id : 'wi-31' , title : 'Security audit' , type : 'MILESTONE' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-2' } ,
82- { id : 'wi-32' , title : 'Performance benchmarking' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-3' }
98+ // Project Alpha - Ideas & More
99+ { id : 'wi-9' , title : 'AI agent integration' , type : 'IDEA' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' , graphId : 'graph-project-alpha' } ,
100+ { id : 'wi-10' , title : 'Mobile app development' , type : 'IDEA' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-5' , graphId : 'graph-project-alpha' } ,
101+ { id : 'wi-11' , title : 'Real-time collaboration' , type : 'IDEA' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-project-alpha' } ,
102+ { id : 'wi-12' , title : 'Production-ready graph system' , type : 'OUTCOME' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-project-alpha' } ,
103+ { id : 'wi-13' , title : 'Scalable architecture' , type : 'OUTCOME' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-project-alpha' } ,
104+
105+ // Test Graph Beta - Testing items
106+ { id : 'wi-14' , title : 'Write unit tests' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-test-beta' } ,
107+ { id : 'wi-15' , title : 'Performance optimization' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-4' , graphId : 'graph-test-beta' } ,
108+ { id : 'wi-16' , title : 'Documentation update' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-5' , graphId : 'graph-test-beta' } ,
109+ { id : 'wi-17' , title : 'User dashboard' , type : 'MILESTONE' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-test-beta' } ,
110+ { id : 'wi-18' , title : 'Analytics module' , type : 'MILESTONE' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-test-beta' } ,
111+ { id : 'wi-19' , title : 'Export functionality' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-test-beta' } ,
112+ { id : 'wi-20' , title : 'Import from other tools' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' , graphId : 'graph-test-beta' } ,
113+ { id : 'wi-21' , title : 'Test WithAPOC' , type : 'TASK' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-test-beta' } ,
114+ { id : 'wi-22' , title : 'testUI Test' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-test-beta' } ,
115+ { id : 'wi-23' , title : 'Form validation testing' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-test-beta' } ,
116+ { id : 'wi-24' , title : 'Edge case handling' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' , graphId : 'graph-test-beta' } ,
117+ { id : 'wi-25' , title : 'Q1 2024 Planning' , type : 'MILESTONE' , status : 'COMPLETED' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-test-beta' } ,
118+ { id : 'wi-26' , title : 'Product roadmap review' , type : 'OUTCOME' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-test-beta' } ,
119+ { id : 'wi-27' , title : 'Customer feedback analysis' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-test-beta' } ,
120+ { id : 'wi-28' , title : 'Market research' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-4' , graphId : 'graph-test-beta' } ,
121+ { id : 'wi-29' , title : 'Refactor graph engine' , type : 'TASK' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-5' , graphId : 'graph-test-beta' } ,
122+ { id : 'wi-30' , title : 'Update dependencies' , type : 'TASK' , status : 'IN_PROGRESS' , teamId : 'team-1' , userId : 'user-1' , graphId : 'graph-test-beta' } ,
123+ { id : 'wi-31' , title : 'Security audit' , type : 'MILESTONE' , status : 'PLANNED' , teamId : 'team-1' , userId : 'user-2' , graphId : 'graph-test-beta' } ,
124+ { id : 'wi-32' , title : 'Performance benchmarking' , type : 'TASK' , status : 'PROPOSED' , teamId : 'team-1' , userId : 'user-3' , graphId : 'graph-test-beta' }
83125 ] ;
84126
85- // Create work items
127+ // Create work items and link to graphs
86128 for ( const item of workItems ) {
87129 await session . run (
88- `CREATE (w:WorkItem {
130+ `MATCH (g:Graph {id: $graphId})
131+ CREATE (w:WorkItem {
89132 id: $id,
90133 title: $title,
91134 type: $type,
@@ -106,7 +149,8 @@ async function seed() {
106149 tags: $tags,
107150 createdAt: datetime(),
108151 updatedAt: datetime()
109- })` ,
152+ })
153+ CREATE (w)-[:BELONGS_TO]->(g)` ,
110154 {
111155 ...item ,
112156 description : `Description for ${ item . title } ` ,
@@ -125,12 +169,22 @@ async function seed() {
125169
126170 // Create edges (relationships between work items)
127171 const edges = [
172+ // Welcome graph edges
173+ { source : 'wi-welcome-1' , target : 'wi-welcome-2' , type : 'DEPENDS_ON' } ,
174+ { source : 'wi-welcome-2' , target : 'wi-welcome-3' , type : 'DEPENDS_ON' } ,
175+ { source : 'wi-welcome-3' , target : 'wi-welcome-4' , type : 'DEPENDS_ON' } ,
176+
177+ // Project Alpha edges
128178 { source : 'wi-1' , target : 'wi-2' , type : 'DEPENDS_ON' } ,
129179 { source : 'wi-2' , target : 'wi-3' , type : 'DEPENDS_ON' } ,
130180 { source : 'wi-5' , target : 'wi-6' , type : 'IS_PART_OF' } ,
131181 { source : 'wi-5' , target : 'wi-7' , type : 'IS_PART_OF' } ,
132182 { source : 'wi-5' , target : 'wi-8' , type : 'IS_PART_OF' } ,
133- { source : 'wi-12' , target : 'wi-5' , type : 'DEPENDS_ON' }
183+ { source : 'wi-12' , target : 'wi-5' , type : 'DEPENDS_ON' } ,
184+
185+ // Test graph edges
186+ { source : 'wi-14' , target : 'wi-15' , type : 'DEPENDS_ON' } ,
187+ { source : 'wi-17' , target : 'wi-18' , type : 'IS_PART_OF' }
134188 ] ;
135189
136190 for ( const edge of edges ) {
0 commit comments