MCPcopy Create free account
hub / github.com/electric-sql/electric / generateIssue

Function generateIssue

examples/linearlite/db/generate_data.js:15–41  ·  view source on GitHub ↗
(kanbanKey)

Source from the content-addressed store, hash-verified

13}
14
15function generateIssue(kanbanKey) {
16 const issueId = uuidv4()
17 const createdAt = faker.date.past()
18 return {
19 id: issueId,
20 title: faker.lorem.sentence({ min: 3, max: 8 }),
21 description: faker.lorem.sentences({ min: 2, max: 6 }, `\n`),
22 priority: faker.helpers.arrayElement([`none`, `low`, `medium`, `high`]),
23 status: faker.helpers.arrayElement([
24 `backlog`,
25 `todo`,
26 `in_progress`,
27 `done`,
28 `canceled`,
29 ]),
30 created: createdAt.toISOString(),
31 modified: faker.date
32 .between({ from: createdAt, to: new Date() })
33 .toISOString(),
34 kanbanorder: kanbanKey,
35 username: faker.internet.userName(),
36 comments: faker.helpers.multiple(
37 () => generateComment(issueId, createdAt),
38 { count: faker.number.int({ min: 0, max: 1 }) }
39 ),
40 }
41}
42
43function generateComment(issueId, issueCreatedAt) {
44 const createdAt = faker.date.between({ from: issueCreatedAt, to: new Date() })

Callers 1

generateIssuesFunction · 0.70

Calls 1

generateCommentFunction · 0.70

Tested by

no test coverage detected