/
models_gen.go
370 lines (305 loc) · 8.27 KB
/
models_gen.go
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
import (
"fmt"
"io"
"strconv"
"github.com/savannahghi/onboarding/pkg/onboarding/domain"
"github.com/savannahghi/scalarutils"
)
type Beneficiary struct {
Name string `json:"name"`
Msisdns []string `json:"msisdns"`
Emails []string `json:"emails"`
Relationship domain.BeneficiaryRelationship `json:"relationship"`
DateOfBirth scalarutils.Date `json:"dateOfBirth"`
}
type BeneficiaryInput struct {
Name string `json:"name"`
Msisdns []string `json:"msisdns"`
Emails []string `json:"emails"`
Relationship domain.BeneficiaryRelationship `json:"relationship"`
DateOfBirth scalarutils.Date `json:"dateOfBirth"`
}
type LocationInput struct {
ID string `json:"id"`
Name string `json:"name"`
BranchSladeCode *string `json:"branchSladeCode"`
}
type OtherPractitionerServiceInput struct {
OtherServices []string `json:"otherServices"`
}
type PractitionerServiceInput struct {
Services []domain.PractitionerService `json:"services"`
}
type ServicesOffered struct {
Services []domain.PractitionerService `json:"services"`
OtherServices []string `json:"otherServices"`
}
type ChannelOfContact string
const (
ChannelOfContactApp ChannelOfContact = "APP"
ChannelOfContactShortcode ChannelOfContact = "SHORTCODE"
)
var AllChannelOfContact = []ChannelOfContact{
ChannelOfContactApp,
ChannelOfContactShortcode,
}
func (e ChannelOfContact) IsValid() bool {
switch e {
case ChannelOfContactApp, ChannelOfContactShortcode:
return true
}
return false
}
func (e ChannelOfContact) String() string {
return string(e)
}
func (e *ChannelOfContact) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = ChannelOfContact(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid ChannelOfContact", str)
}
return nil
}
func (e ChannelOfContact) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type FilterOperatorType string
const (
FilterOperatorTypeEq FilterOperatorType = "EQ"
FilterOperatorTypeNeq FilterOperatorType = "NEQ"
FilterOperatorTypeLt FilterOperatorType = "LT"
FilterOperatorTypeLte FilterOperatorType = "LTE"
FilterOperatorTypeGt FilterOperatorType = "GT"
FilterOperatorTypeGte FilterOperatorType = "GTE"
FilterOperatorTypeHasProperty FilterOperatorType = "HAS_PROPERTY"
FilterOperatorTypeNotHasProperty FilterOperatorType = "NOT_HAS_PROPERTY"
FilterOperatorTypeContainsToken FilterOperatorType = "CONTAINS_TOKEN"
FilterOperatorTypeNotContainsToken FilterOperatorType = "NOT_CONTAINS_TOKEN"
)
var AllFilterOperatorType = []FilterOperatorType{
FilterOperatorTypeEq,
FilterOperatorTypeNeq,
FilterOperatorTypeLt,
FilterOperatorTypeLte,
FilterOperatorTypeGt,
FilterOperatorTypeGte,
FilterOperatorTypeHasProperty,
FilterOperatorTypeNotHasProperty,
FilterOperatorTypeContainsToken,
FilterOperatorTypeNotContainsToken,
}
func (e FilterOperatorType) IsValid() bool {
switch e {
case FilterOperatorTypeEq, FilterOperatorTypeNeq, FilterOperatorTypeLt, FilterOperatorTypeLte, FilterOperatorTypeGt, FilterOperatorTypeGte, FilterOperatorTypeHasProperty, FilterOperatorTypeNotHasProperty, FilterOperatorTypeContainsToken, FilterOperatorTypeNotContainsToken:
return true
}
return false
}
func (e FilterOperatorType) String() string {
return string(e)
}
func (e *FilterOperatorType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = FilterOperatorType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid FilterOperatorType", str)
}
return nil
}
func (e FilterOperatorType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type GeneralOptionType string
const (
GeneralOptionTypeYes GeneralOptionType = "YES"
GeneralOptionTypeNo GeneralOptionType = "NO"
GeneralOptionTypeNotGiven GeneralOptionType = "NOT_GIVEN"
)
var AllGeneralOptionType = []GeneralOptionType{
GeneralOptionTypeYes,
GeneralOptionTypeNo,
GeneralOptionTypeNotGiven,
}
func (e GeneralOptionType) IsValid() bool {
switch e {
case GeneralOptionTypeYes, GeneralOptionTypeNo, GeneralOptionTypeNotGiven:
return true
}
return false
}
func (e GeneralOptionType) String() string {
return string(e)
}
func (e *GeneralOptionType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = GeneralOptionType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid GeneralOptionType", str)
}
return nil
}
func (e GeneralOptionType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type Payor string
const (
PayorApa Payor = "APA"
PayorJubilee Payor = "JUBILEE"
PayorResolution Payor = "RESOLUTION"
PayorBritam Payor = "BRITAM"
PayorMinet Payor = "MINET"
PayorMadison Payor = "MADISON"
)
var AllPayor = []Payor{
PayorApa,
PayorJubilee,
PayorResolution,
PayorBritam,
PayorMinet,
PayorMadison,
}
func (e Payor) IsValid() bool {
switch e {
case PayorApa, PayorJubilee, PayorResolution, PayorBritam, PayorMinet, PayorMadison:
return true
}
return false
}
func (e Payor) String() string {
return string(e)
}
func (e *Payor) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = Payor(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid Payor", str)
}
return nil
}
func (e Payor) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type Persona string
const (
PersonaAlice Persona = "ALICE"
PersonaJuma Persona = "JUMA"
PersonaBob Persona = "BOB"
PersonaAndrew Persona = "ANDREW"
)
var AllPersona = []Persona{
PersonaAlice,
PersonaJuma,
PersonaBob,
PersonaAndrew,
}
func (e Persona) IsValid() bool {
switch e {
case PersonaAlice, PersonaJuma, PersonaBob, PersonaAndrew:
return true
}
return false
}
func (e Persona) String() string {
return string(e)
}
func (e *Persona) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = Persona(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid Persona", str)
}
return nil
}
func (e Persona) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type SignUpMethod string
const (
SignUpMethodAnonymous SignUpMethod = "anonymous"
SignUpMethodApple SignUpMethod = "apple"
SignUpMethodFacebook SignUpMethod = "facebook"
SignUpMethodGoogle SignUpMethod = "google"
SignUpMethodPhone SignUpMethod = "phone"
)
var AllSignUpMethod = []SignUpMethod{
SignUpMethodAnonymous,
SignUpMethodApple,
SignUpMethodFacebook,
SignUpMethodGoogle,
SignUpMethodPhone,
}
func (e SignUpMethod) IsValid() bool {
switch e {
case SignUpMethodAnonymous, SignUpMethodApple, SignUpMethodFacebook, SignUpMethodGoogle, SignUpMethodPhone:
return true
}
return false
}
func (e SignUpMethod) String() string {
return string(e)
}
func (e *SignUpMethod) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = SignUpMethod(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid SignUpMethod", str)
}
return nil
}
func (e SignUpMethod) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type SortType string
const (
SortTypeAscending SortType = "ASCENDING"
SortTypeDescending SortType = "DESCENDING"
)
var AllSortType = []SortType{
SortTypeAscending,
SortTypeDescending,
}
func (e SortType) IsValid() bool {
switch e {
case SortTypeAscending, SortTypeDescending:
return true
}
return false
}
func (e SortType) String() string {
return string(e)
}
func (e *SortType) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = SortType(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid SortType", str)
}
return nil
}
func (e SortType) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}