-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.schema.json
197 lines (197 loc) · 7.79 KB
/
config.schema.json
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
{
"$id": "https://github.com/luczsoma/lottery-random/blob/master/config.schema.py",
"$schema": "http://json-schema.org/schema#",
"title": "lottery-random configuration file schema",
"description": "Your supplied config.json file for lottery-random must comply with this schema.",
"type": "object",
"properties": {
"random_org_api_key": {
"title": "random.org API key",
"description": "Your API key for the random.org API. The lottery-random MUST NOT be used with neither the free Developer nor the Non-Profit API key license: visit https://api.random.org/pricing for details.",
"type": "string",
"minLength": 1
},
"sendgrid_api_key": {
"title": "SendGrid API key",
"description": "Your API key for the SendGrid API.",
"type": "string",
"minLength": 1
},
"email_from": {
"title": "Email from",
"description": "This email address will be used as the sender address when emailing the lottery ticket packs.",
"type": "object",
"properties": {
"email": {
"title": "Email",
"description": "The email address of the sender",
"type": "string",
"format": "email"
},
"name": {
"title": "Name",
"description": "The name of the sender",
"type": "string",
"minLength": 1
}
},
"required": ["email", "name"],
"additionalProperties": false
},
"lottery_game_definitions": {
"title": "Lottery game definitions",
"description": "Define your lottery game definitions here.",
"type": "array",
"items": {
"title": "Lottery game definition",
"description": "A lottery game definition describes a type of lottery game in general: with a name and one or more drawing sets with the number of drawn elements from the sets of numbers between min and max.",
"type": "object",
"properties": {
"game_name": {
"title": "Game name",
"description": "Use this game name in the lottery_ticket_packs section to reference a particular game definition.",
"type": "string",
"minLength": 1
},
"drawing_sets": {
"title": "Drawing sets",
"description": "Define the drawing sets for the lottery game here.",
"type": "array",
"items": {
"title": "Drawing set",
"description": "A drawing set is a set of numbers between min and max (inclusive) to draw n unique numbers from.",
"type": "object",
"properties": {
"n": {
"title": "n",
"description": "Draw n unique numbers from the drawing set.",
"type": "integer",
"minimum": 1
},
"min": {
"title": "min",
"description": "The lowest possible drawn value.",
"type": "integer",
"minimum": 1
},
"max": {
"title": "max",
"description": "The highest possible drawn value.",
"type": "integer",
"minimum": 1
}
},
"required": ["n", "min", "max"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["game_name", "drawing_sets"],
"additionalProperties": false
},
"minItems": 1
},
"lottery_ticket_packs": {
"title": "Lottery ticket packs",
"description": "Define your lottery ticket packs here. A lottery ticket pack is one or more lottery tickets to be played (in any lottery games defined above) containing random numbers, sent to one or more given email addresses.",
"type": "array",
"items": {
"title": "Lottery ticket pack",
"description": "A set of lottery tickets with random numbers to be played, sent to one or more email addresses.",
"type": "object",
"properties": {
"email_to": {
"title": "Email to",
"description": "The lottery ticket pack will be sent to these email addresses.",
"type": "array",
"items": {
"title": "Email to",
"description": "An email address where the lottery ticket pack will be sent.",
"type": "object",
"properties": {
"email": {
"title": "Email",
"description": "The email address of the recipient",
"type": "string",
"format": "email"
},
"name": {
"title": "Name",
"description": "The name of the recipient",
"type": "string",
"minLength": 1
}
},
"required": ["email", "name"],
"additionalProperties": false
},
"minItems": 1
},
"elements": {
"title": "Lottery tickets pack elements",
"description": "Define the number of lottery tickets to be played from a given lottery game.",
"type": "array",
"items": {
"title": "Lottery ticket configuration",
"description": "Define the number of lottery tickets to be played from a given lottery game.",
"type": "object",
"properties": {
"game_name": {
"title": "Game name",
"description": "The name of the lottery game. Must be the game_name of a defined lottery game definition in lottery_game_definitions above.",
"type": "string",
"minLength": 1
},
"number_of_random_tickets": {
"title": "Number of tickets to be randomly generated",
"description": "The number of tickets (to be randomly generated) to be played in this lottery game.",
"type": "integer",
"minimum": 1
},
"permanent_tickets": {
"title": "Tickets to be played regularly, with permanent numbers",
"description": "If a player has permanent numbers, it can be configured here, so it will also be sent in email, in addition to the rangomly generated tickets. The given tickets must conform to the game definition, and cannot contain duplicate numbers.",
"type": "array",
"items": {
"title": "Permament ticket",
"description": "A ticket to be played containing permanent numbers.",
"type": "array",
"items": {
"title": "Permanent drawing set",
"description": "A drawing set of a permanent ticket.",
"type": "array",
"items": {
"title": "Permanent number",
"description": "A permanent number to be played in a permanent ticket.",
"type": "number"
}
}
}
}
},
"required": [
"game_name",
"number_of_random_tickets",
"permanent_tickets"
],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["email_to", "elements"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": [
"random_org_api_key",
"sendgrid_api_key",
"email_from",
"lottery_game_definitions",
"lottery_ticket_packs"
],
"additionalProperties": false
}