-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.js
More file actions
70 lines (62 loc) · 2.85 KB
/
Copy pathdata.js
File metadata and controls
70 lines (62 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(function () {
const reps = [
{ name: 'Ava Patel', region: 'North America', quota: 820000 },
{ name: 'Marcus Chen', region: 'North America', quota: 760000 },
{ name: 'Sofia Ramirez', region: 'Europe', quota: 720000 },
{ name: 'Liam Johnson', region: 'Europe', quota: 690000 },
{ name: 'Noah Kim', region: 'APAC', quota: 650000 },
{ name: 'Emma Brown', region: 'APAC', quota: 670000 },
{ name: 'Olivia Davis', region: 'LATAM', quota: 530000 },
{ name: 'Daniel Wright', region: 'LATAM', quota: 510000 }
];
const products = ['Platform', 'Analytics', 'Automation', 'Support', 'Enterprise'];
const channels = ['Inbound', 'Outbound', 'Partner', 'Referral', 'Expansion'];
const stages = ['Lead', 'Qualified', 'Proposal', 'Negotiation', 'Closed Won', 'Closed Lost'];
const companies = ['Acme', 'Nordic Labs', 'BluePeak', 'Summit One', 'DeltaPath', 'GreenForge', 'NovaWave', 'Crestline', 'Vertex', 'Orchid'];
function seededRandom(seed) {
let value = seed % 2147483647;
return function () {
value = value * 16807 % 2147483647;
return (value - 1) / 2147483646;
};
}
const rand = seededRandom(42);
const opportunities = [];
const start = new Date('2025-01-01T00:00:00');
const end = new Date('2026-04-20T00:00:00');
const msRange = end - start;
for (let i = 1; i <= 2600; i++) {
const rep = reps[Math.floor(rand() * reps.length)];
const product = products[Math.floor(rand() * products.length)];
const channel = channels[Math.floor(rand() * channels.length)];
let stageRoll = rand();
let stage = 'Lead';
if (stageRoll > 0.88) stage = 'Closed Won';
else if (stageRoll > 0.76) stage = 'Closed Lost';
else if (stageRoll > 0.58) stage = 'Negotiation';
else if (stageRoll > 0.38) stage = 'Proposal';
else if (stageRoll > 0.18) stage = 'Qualified';
const baseAmount = 5000 + rand() * 85000;
const productMultiplier = { Platform: 1.4, Analytics: 1.15, Automation: 1.55, Support: 0.65, Enterprise: 2.1 }[product];
const channelMultiplier = { Inbound: 1.0, Outbound: 0.92, Partner: 1.2, Referral: 1.35, Expansion: 1.5 }[channel];
const amount = Math.round(baseAmount * productMultiplier * channelMultiplier);
const createdAt = new Date(start.getTime() + rand() * msRange);
const cycleDays = Math.max(7, Math.round(10 + rand() * 115));
const closeDate = new Date(createdAt.getTime() + cycleDays * 86400000);
opportunities.push({
id: i,
opportunity: `${companies[Math.floor(rand() * companies.length)]} ${100 + i}`,
rep: rep.name,
region: rep.region,
product,
channel,
stage,
amount,
createdAt: createdAt.toISOString().slice(0, 10),
closeDate: closeDate.toISOString().slice(0, 10),
cycleDays,
quota: rep.quota
});
}
window.salesDataset = { opportunities, reps, products, channels, stages };
})();