]> git.r.bdr.sh - rbdr/corona-regeln/blame - src/lib/rules/business.js
Add license
[rbdr/corona-regeln] / src / lib / rules / business.js
CommitLineData
07d8db2b
RBR
1const internals ={
2
3 businesses: [
4 'butcher shops',
5 'plant shops',
6 'balloon factories',
7 'pet hotels',
8 'sex shops',
9 'clothes incineration facilities',
10 'city dumps',
11 'glass factories',
12 'roads',
13 'windfarm analysis consultancies',
14 'peanut depots',
15 'glue factories',
16 'bürgeramts',
17 'chiropractors',
18 'gong bath facilities',
19 'wrestling rings',
20 'cat cafés',
21 'paint your own pottery centers',
22 'dungeons',
23 'television sets',
24 'nasa offices',
25 'toilet factories',
26 'condom inspection facilities',
27 'high school newspapers',
28 'dog spas',
29 'mink breeding centers',
8f0b2265 30 'NGOs',
07d8db2b 31 'yoga cults',
8f0b2265 32 'MI6 safehouses',
07d8db2b
RBR
33 'döner shops',
34 'hospitals'
35 ],
36
37 restrictions: [
38 'are required to work from home',
39 'require mandatory testing',
40 'must remain closed',
41 'must remain open',
42 'must offer 50% covid discounts',
43 'must become vaccination centers',
44 'must pay staff 3x on thursdays',
45 'can only meet with one other household',
46 'must share facilities',
47 'are exempt from mask rules',
48 ],
49
50 join(array) {
51
52 const firstPart = array.slice(0, -1).join(', ')
53 const lastPart = array.slice(-1)
54
55 const conjunction = array.length <= 1 ? '' : ', and '
56
57 return [firstPart, lastPart].join(conjunction)
58 }
59};
60
5d9f7190 61export default function () {
07d8db2b
RBR
62
63 const businesses = internals.businesses
64 .filter(() => true)
65 .sort(() => Math.random() - 0.5)
66 .slice(0, Math.floor(Math.random() * 3) + 1)
67 const restriction = internals.restrictions[Math.floor(Math.random() * internals.restrictions.length)];
68 const text = `${internals.join(businesses)} ${restriction}`
69
70 return {
71 emoji: '🏢',
72 text: text.charAt(0).toUpperCase() + text.slice(1)
73 };
74}