ondc-code-generator 0.8.7 → 0.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +1 -1
  2. package/alpha/docs/page/index.html +6137 -0
  3. package/alpha/docs/page/style.css +204 -0
  4. package/alpha/docs/readme.md +5939 -0
  5. package/alpha/docs/validPaths.json +14351 -0
  6. package/alpha/page/index.html +6137 -0
  7. package/alpha/page/style.css +204 -0
  8. package/alpha/readme.md +5939 -0
  9. package/alpha/validPaths.json +11393 -34240
  10. package/alpha/validationpkg/examples/search.json +143 -0
  11. package/alpha/validationpkg/examples_output/search/case-001/output.json +12 -0
  12. package/alpha/validationpkg/go.mod +8 -0
  13. package/alpha/validationpkg/go.sum +4 -0
  14. package/alpha/validationpkg/jsonvalidations/cancel.go +1289 -0
  15. package/alpha/validationpkg/jsonvalidations/confirm.go +9121 -0
  16. package/alpha/validationpkg/jsonvalidations/init.go +4864 -0
  17. package/alpha/validationpkg/jsonvalidations/issue.go +4868 -0
  18. package/alpha/validationpkg/jsonvalidations/on_cancel.go +7111 -0
  19. package/alpha/validationpkg/jsonvalidations/on_confirm.go +8903 -0
  20. package/alpha/validationpkg/jsonvalidations/on_init.go +4445 -0
  21. package/alpha/validationpkg/jsonvalidations/on_issue.go +2828 -0
  22. package/alpha/validationpkg/jsonvalidations/on_issue_status.go +1938 -0
  23. package/alpha/validationpkg/jsonvalidations/on_search.go +3356 -0
  24. package/alpha/validationpkg/jsonvalidations/on_status.go +8129 -0
  25. package/alpha/validationpkg/jsonvalidations/on_track.go +1415 -0
  26. package/alpha/validationpkg/jsonvalidations/on_update.go +8700 -0
  27. package/alpha/validationpkg/jsonvalidations/search.go +3585 -0
  28. package/alpha/validationpkg/jsonvalidations/status.go +1073 -0
  29. package/alpha/validationpkg/jsonvalidations/track.go +1073 -0
  30. package/alpha/validationpkg/jsonvalidations/update.go +3012 -0
  31. package/alpha/validationpkg/main-validator.go +196 -0
  32. package/alpha/validationpkg/main-validator_test.go +165 -0
  33. package/alpha/validationpkg/storageutils/api_save_utils.go +83 -0
  34. package/alpha/validationpkg/storageutils/cancel.go +30 -0
  35. package/alpha/validationpkg/storageutils/confirm.go +30 -0
  36. package/alpha/validationpkg/storageutils/index.go +132 -0
  37. package/alpha/validationpkg/storageutils/init.go +30 -0
  38. package/alpha/validationpkg/storageutils/issue.go +30 -0
  39. package/alpha/validationpkg/storageutils/on_cancel.go +30 -0
  40. package/alpha/validationpkg/storageutils/on_confirm.go +30 -0
  41. package/alpha/validationpkg/storageutils/on_init.go +30 -0
  42. package/alpha/validationpkg/storageutils/on_issue.go +30 -0
  43. package/alpha/validationpkg/storageutils/on_issue_status.go +30 -0
  44. package/alpha/validationpkg/storageutils/on_search.go +30 -0
  45. package/alpha/validationpkg/storageutils/on_status.go +30 -0
  46. package/alpha/validationpkg/storageutils/on_track.go +30 -0
  47. package/alpha/validationpkg/storageutils/on_update.go +30 -0
  48. package/alpha/validationpkg/storageutils/save_utils.go +75 -0
  49. package/alpha/validationpkg/storageutils/search.go +30 -0
  50. package/alpha/validationpkg/storageutils/status.go +30 -0
  51. package/alpha/validationpkg/storageutils/track.go +30 -0
  52. package/alpha/validationpkg/storageutils/update.go +30 -0
  53. package/alpha/validationpkg/validationutils/json_normalizer.go +152 -0
  54. package/alpha/validationpkg/validationutils/json_path_utils.go +173 -0
  55. package/alpha/validationpkg/validationutils/storage-interface.go +107 -0
  56. package/alpha/validationpkg/validationutils/test-config.go +69 -0
  57. package/alpha/validationpkg/validationutils/validation_utils.go +429 -0
  58. package/dist/bin/cli.js +6 -2
  59. package/dist/generator/config-compiler.d.ts +2 -2
  60. package/dist/generator/config-compiler.js +10 -4
  61. package/dist/generator/generators/classes/abstract-generator.d.ts +1 -0
  62. package/dist/generator/generators/go/go-generator.js +34 -17
  63. package/dist/generator/generators/go/templates/api-tests.mustache +1 -1
  64. package/dist/generator/generators/go/templates/go-mod.mustache +1 -1
  65. package/dist/generator/generators/go/templates/index.mustache +1 -1
  66. package/dist/generator/generators/go/templates/storage-templates/api-save-utils.mustache +1 -1
  67. package/dist/generator/generators/go/templates/storage-templates/api-save.mustache +1 -1
  68. package/dist/generator/generators/go/templates/storage-templates/index.mustache +1 -1
  69. package/dist/generator/generators/go/templates/storage-templates/save-utils.mustache +1 -1
  70. package/dist/generator/generators/go/templates/test-templates/validator-test.mustache +6 -6
  71. package/dist/types/compiler-types.d.ts +2 -1
  72. package/dist/types/compiler-types.js +1 -0
  73. package/docs/jval-dsl.md +913 -0
  74. package/package.json +1 -1
  75. package/alpha/possible-json-paths.json +0 -248
@@ -0,0 +1,4445 @@
1
+ // Code generated by github.com/ONDC-Official/automation-validation-compiler, DO NOT EDIT.
2
+
3
+ package jsonvalidations
4
+
5
+ import (
6
+ "validationpkg/validationutils"
7
+ )
8
+
9
+ func On_init_Tests(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
10
+ totalResults, err := On_initValidations(input)
11
+ if err != nil {
12
+ return nil, err
13
+ }
14
+
15
+ if !input.Config.Debug {
16
+ for i := range totalResults {
17
+ totalResults[i].DebugInfo = nil
18
+ }
19
+ }
20
+
21
+ if input.Config.HideParentErrors {
22
+ // Delete results with valid false and no description
23
+ filtered := make([]validationutils.ValidationOutput, 0)
24
+ for _, r := range totalResults {
25
+ if !r.Valid && r.Description == "" {
26
+ continue
27
+ }
28
+ filtered = append(filtered, r)
29
+ }
30
+ totalResults = filtered
31
+ }
32
+
33
+ if input.Config.OnlyInvalid {
34
+ res := make([]validationutils.ValidationOutput, 0)
35
+ for _, r := range totalResults {
36
+ if !r.Valid {
37
+ res = append(res, r)
38
+ }
39
+ }
40
+
41
+ if len(res) == 0 {
42
+ // Find the overall test result
43
+ var targetSuccess *validationutils.ValidationOutput
44
+ for i := range totalResults {
45
+ if totalResults[i].TestName == "On_initValidations" {
46
+ targetSuccess = &totalResults[i]
47
+ break
48
+ }
49
+ }
50
+
51
+ if targetSuccess == nil {
52
+ panic("Critical: Overall test result not found")
53
+ }
54
+
55
+ return []validationutils.ValidationOutput{*targetSuccess}, nil
56
+ }
57
+
58
+ return res, nil
59
+ }
60
+
61
+ return totalResults, nil
62
+ }
63
+
64
+ var On_initValidations = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
65
+
66
+ if input.Config.SkipTestsDict != nil {
67
+ if _, skip := input.Config.SkipTestsDict["On_initValidations"]; skip {
68
+ return []validationutils.ValidationOutput{}, nil
69
+ }
70
+ }
71
+
72
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
73
+
74
+ subResults := make([]validationutils.ValidationOutput, 0)
75
+ valid := true
76
+ configureDebugInfo := ""
77
+ for _, testObjMap := range scope {
78
+ validationutils.UnusedFunction(testObjMap)
79
+
80
+ var REQUIRED_CONTEXT_DOMAIN = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
81
+
82
+ if input.Config.SkipTestsDict != nil {
83
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_DOMAIN"]; skip {
84
+ return []validationutils.ValidationOutput{}, nil
85
+ }
86
+ }
87
+
88
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
89
+
90
+ subResults := make([]validationutils.ValidationOutput, 0)
91
+ valid := true
92
+ configureDebugInfo := ""
93
+ for _, testObjMap := range scope {
94
+ validationutils.UnusedFunction(testObjMap)
95
+
96
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.domain", true)
97
+ validationutils.UnusedFunction(attr)
98
+ enumList := validationutils.StringSliceToInterface([]string{`ONDC:LOG10`, `ONDC:LOG11`, `nic2004:60232`})
99
+ validationutils.UnusedFunction(enumList)
100
+
101
+ validate := (validationutils.ArePresent(attr)) && (validationutils.AllIn(attr, enumList))
102
+
103
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_DOMAIN","attr":"$.context.domain","_RETURN_":"attr are present && attr all in enumList","enumList":["ONDC:LOG10","ONDC:LOG11","nic2004:60232"]}`
104
+
105
+ if !validate {
106
+ result := validationutils.ValidationOutput{
107
+ TestName: "REQUIRED_CONTEXT_DOMAIN",
108
+ Valid: false,
109
+ Code: 30000,
110
+ Description: `#### **REQUIRED_CONTEXT_DOMAIN**
111
+
112
+ **All of the following must be true:**
113
+ - $.context.domain must be present in the payload
114
+ - All elements of $.context.domain must be in ["ONDC:LOG10", "ONDC:LOG11", "nic2004:60232"]`,
115
+ DebugInfo: &validationutils.DebugInfo{
116
+ FedConfig: configureDebugInfo,
117
+ },
118
+ }
119
+ return []validationutils.ValidationOutput{result}, nil
120
+ }
121
+
122
+ }
123
+
124
+ result := validationutils.ValidationOutput{
125
+ TestName: "REQUIRED_CONTEXT_DOMAIN",
126
+ Valid: valid,
127
+ Code: 0,
128
+ DebugInfo: &validationutils.DebugInfo{
129
+ FedConfig: configureDebugInfo,
130
+ },
131
+ }
132
+
133
+ if valid {
134
+ result.Code = 200
135
+ } else {
136
+ result.Code = 30000
137
+ }
138
+
139
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
140
+ results = append(results, result)
141
+ results = append(results, subResults...)
142
+
143
+ return results, nil
144
+ }
145
+ var REQUIRED_CONTEXT_COUNTRY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
146
+
147
+ if input.Config.SkipTestsDict != nil {
148
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_COUNTRY"]; skip {
149
+ return []validationutils.ValidationOutput{}, nil
150
+ }
151
+ }
152
+
153
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
154
+
155
+ subResults := make([]validationutils.ValidationOutput, 0)
156
+ valid := true
157
+ configureDebugInfo := ""
158
+ for _, testObjMap := range scope {
159
+ validationutils.UnusedFunction(testObjMap)
160
+
161
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.country", true)
162
+ validationutils.UnusedFunction(attr)
163
+
164
+ validate := validationutils.ArePresent(attr)
165
+
166
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_COUNTRY","attr":"$.context.country","_RETURN_":"attr are present"}`
167
+
168
+ if !validate {
169
+ result := validationutils.ValidationOutput{
170
+ TestName: "REQUIRED_CONTEXT_COUNTRY",
171
+ Valid: false,
172
+ Code: 30000,
173
+ Description: `#### **REQUIRED_CONTEXT_COUNTRY**
174
+
175
+ - $.context.country must be present in the payload`,
176
+ DebugInfo: &validationutils.DebugInfo{
177
+ FedConfig: configureDebugInfo,
178
+ },
179
+ }
180
+ return []validationutils.ValidationOutput{result}, nil
181
+ }
182
+
183
+ }
184
+
185
+ result := validationutils.ValidationOutput{
186
+ TestName: "REQUIRED_CONTEXT_COUNTRY",
187
+ Valid: valid,
188
+ Code: 0,
189
+ DebugInfo: &validationutils.DebugInfo{
190
+ FedConfig: configureDebugInfo,
191
+ },
192
+ }
193
+
194
+ if valid {
195
+ result.Code = 200
196
+ } else {
197
+ result.Code = 30000
198
+ }
199
+
200
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
201
+ results = append(results, result)
202
+ results = append(results, subResults...)
203
+
204
+ return results, nil
205
+ }
206
+ var REQUIRED_CONTEXT_CITY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
207
+
208
+ if input.Config.SkipTestsDict != nil {
209
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_CITY"]; skip {
210
+ return []validationutils.ValidationOutput{}, nil
211
+ }
212
+ }
213
+
214
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
215
+
216
+ subResults := make([]validationutils.ValidationOutput, 0)
217
+ valid := true
218
+ configureDebugInfo := ""
219
+ for _, testObjMap := range scope {
220
+ validationutils.UnusedFunction(testObjMap)
221
+
222
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.city", true)
223
+ validationutils.UnusedFunction(attr)
224
+
225
+ validate := validationutils.ArePresent(attr)
226
+
227
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_CITY","attr":"$.context.city","_RETURN_":"attr are present"}`
228
+
229
+ if !validate {
230
+ result := validationutils.ValidationOutput{
231
+ TestName: "REQUIRED_CONTEXT_CITY",
232
+ Valid: false,
233
+ Code: 30000,
234
+ Description: `#### **REQUIRED_CONTEXT_CITY**
235
+
236
+ - $.context.city must be present in the payload`,
237
+ DebugInfo: &validationutils.DebugInfo{
238
+ FedConfig: configureDebugInfo,
239
+ },
240
+ }
241
+ return []validationutils.ValidationOutput{result}, nil
242
+ }
243
+
244
+ }
245
+
246
+ result := validationutils.ValidationOutput{
247
+ TestName: "REQUIRED_CONTEXT_CITY",
248
+ Valid: valid,
249
+ Code: 0,
250
+ DebugInfo: &validationutils.DebugInfo{
251
+ FedConfig: configureDebugInfo,
252
+ },
253
+ }
254
+
255
+ if valid {
256
+ result.Code = 200
257
+ } else {
258
+ result.Code = 30000
259
+ }
260
+
261
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
262
+ results = append(results, result)
263
+ results = append(results, subResults...)
264
+
265
+ return results, nil
266
+ }
267
+ var REQUIRED_CONTEXT_ACTION = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
268
+
269
+ if input.Config.SkipTestsDict != nil {
270
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_ACTION"]; skip {
271
+ return []validationutils.ValidationOutput{}, nil
272
+ }
273
+ }
274
+
275
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
276
+
277
+ subResults := make([]validationutils.ValidationOutput, 0)
278
+ valid := true
279
+ configureDebugInfo := ""
280
+ for _, testObjMap := range scope {
281
+ validationutils.UnusedFunction(testObjMap)
282
+
283
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.action", true)
284
+ validationutils.UnusedFunction(attr)
285
+
286
+ validate := validationutils.ArePresent(attr)
287
+
288
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_ACTION","attr":"$.context.action","_RETURN_":"attr are present"}`
289
+
290
+ if !validate {
291
+ result := validationutils.ValidationOutput{
292
+ TestName: "REQUIRED_CONTEXT_ACTION",
293
+ Valid: false,
294
+ Code: 30000,
295
+ Description: `#### **REQUIRED_CONTEXT_ACTION**
296
+
297
+ - $.context.action must be present in the payload`,
298
+ DebugInfo: &validationutils.DebugInfo{
299
+ FedConfig: configureDebugInfo,
300
+ },
301
+ }
302
+ return []validationutils.ValidationOutput{result}, nil
303
+ }
304
+
305
+ }
306
+
307
+ result := validationutils.ValidationOutput{
308
+ TestName: "REQUIRED_CONTEXT_ACTION",
309
+ Valid: valid,
310
+ Code: 0,
311
+ DebugInfo: &validationutils.DebugInfo{
312
+ FedConfig: configureDebugInfo,
313
+ },
314
+ }
315
+
316
+ if valid {
317
+ result.Code = 200
318
+ } else {
319
+ result.Code = 30000
320
+ }
321
+
322
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
323
+ results = append(results, result)
324
+ results = append(results, subResults...)
325
+
326
+ return results, nil
327
+ }
328
+ var REQUIRED_CONTEXT_CORE_VERSION = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
329
+
330
+ if input.Config.SkipTestsDict != nil {
331
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_CORE_VERSION"]; skip {
332
+ return []validationutils.ValidationOutput{}, nil
333
+ }
334
+ }
335
+
336
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
337
+
338
+ subResults := make([]validationutils.ValidationOutput, 0)
339
+ valid := true
340
+ configureDebugInfo := ""
341
+ for _, testObjMap := range scope {
342
+ validationutils.UnusedFunction(testObjMap)
343
+
344
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.core_version", true)
345
+ validationutils.UnusedFunction(attr)
346
+
347
+ validate := validationutils.ArePresent(attr)
348
+
349
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_CORE_VERSION","attr":"$.context.core_version","_RETURN_":"attr are present"}`
350
+
351
+ if !validate {
352
+ result := validationutils.ValidationOutput{
353
+ TestName: "REQUIRED_CONTEXT_CORE_VERSION",
354
+ Valid: false,
355
+ Code: 30000,
356
+ Description: `#### **REQUIRED_CONTEXT_CORE_VERSION**
357
+
358
+ - $.context.core_version must be present in the payload`,
359
+ DebugInfo: &validationutils.DebugInfo{
360
+ FedConfig: configureDebugInfo,
361
+ },
362
+ }
363
+ return []validationutils.ValidationOutput{result}, nil
364
+ }
365
+
366
+ }
367
+
368
+ result := validationutils.ValidationOutput{
369
+ TestName: "REQUIRED_CONTEXT_CORE_VERSION",
370
+ Valid: valid,
371
+ Code: 0,
372
+ DebugInfo: &validationutils.DebugInfo{
373
+ FedConfig: configureDebugInfo,
374
+ },
375
+ }
376
+
377
+ if valid {
378
+ result.Code = 200
379
+ } else {
380
+ result.Code = 30000
381
+ }
382
+
383
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
384
+ results = append(results, result)
385
+ results = append(results, subResults...)
386
+
387
+ return results, nil
388
+ }
389
+ var REQUIRED_CONTEXT_BAP_ID = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
390
+
391
+ if input.Config.SkipTestsDict != nil {
392
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_BAP_ID"]; skip {
393
+ return []validationutils.ValidationOutput{}, nil
394
+ }
395
+ }
396
+
397
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
398
+
399
+ subResults := make([]validationutils.ValidationOutput, 0)
400
+ valid := true
401
+ configureDebugInfo := ""
402
+ for _, testObjMap := range scope {
403
+ validationutils.UnusedFunction(testObjMap)
404
+
405
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.bap_id", true)
406
+ validationutils.UnusedFunction(attr)
407
+
408
+ validate := validationutils.ArePresent(attr)
409
+
410
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_BAP_ID","attr":"$.context.bap_id","_RETURN_":"attr are present"}`
411
+
412
+ if !validate {
413
+ result := validationutils.ValidationOutput{
414
+ TestName: "REQUIRED_CONTEXT_BAP_ID",
415
+ Valid: false,
416
+ Code: 30000,
417
+ Description: `#### **REQUIRED_CONTEXT_BAP_ID**
418
+
419
+ - $.context.bap_id must be present in the payload`,
420
+ DebugInfo: &validationutils.DebugInfo{
421
+ FedConfig: configureDebugInfo,
422
+ },
423
+ }
424
+ return []validationutils.ValidationOutput{result}, nil
425
+ }
426
+
427
+ }
428
+
429
+ result := validationutils.ValidationOutput{
430
+ TestName: "REQUIRED_CONTEXT_BAP_ID",
431
+ Valid: valid,
432
+ Code: 0,
433
+ DebugInfo: &validationutils.DebugInfo{
434
+ FedConfig: configureDebugInfo,
435
+ },
436
+ }
437
+
438
+ if valid {
439
+ result.Code = 200
440
+ } else {
441
+ result.Code = 30000
442
+ }
443
+
444
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
445
+ results = append(results, result)
446
+ results = append(results, subResults...)
447
+
448
+ return results, nil
449
+ }
450
+ var REQUIRED_CONTEXT_BAP_URI = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
451
+
452
+ if input.Config.SkipTestsDict != nil {
453
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_BAP_URI"]; skip {
454
+ return []validationutils.ValidationOutput{}, nil
455
+ }
456
+ }
457
+
458
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
459
+
460
+ subResults := make([]validationutils.ValidationOutput, 0)
461
+ valid := true
462
+ configureDebugInfo := ""
463
+ for _, testObjMap := range scope {
464
+ validationutils.UnusedFunction(testObjMap)
465
+
466
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.bap_uri", true)
467
+ validationutils.UnusedFunction(attr)
468
+
469
+ validate := validationutils.ArePresent(attr)
470
+
471
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_BAP_URI","attr":"$.context.bap_uri","_RETURN_":"attr are present"}`
472
+
473
+ if !validate {
474
+ result := validationutils.ValidationOutput{
475
+ TestName: "REQUIRED_CONTEXT_BAP_URI",
476
+ Valid: false,
477
+ Code: 30000,
478
+ Description: `#### **REQUIRED_CONTEXT_BAP_URI**
479
+
480
+ - $.context.bap_uri must be present in the payload`,
481
+ DebugInfo: &validationutils.DebugInfo{
482
+ FedConfig: configureDebugInfo,
483
+ },
484
+ }
485
+ return []validationutils.ValidationOutput{result}, nil
486
+ }
487
+
488
+ }
489
+
490
+ result := validationutils.ValidationOutput{
491
+ TestName: "REQUIRED_CONTEXT_BAP_URI",
492
+ Valid: valid,
493
+ Code: 0,
494
+ DebugInfo: &validationutils.DebugInfo{
495
+ FedConfig: configureDebugInfo,
496
+ },
497
+ }
498
+
499
+ if valid {
500
+ result.Code = 200
501
+ } else {
502
+ result.Code = 30000
503
+ }
504
+
505
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
506
+ results = append(results, result)
507
+ results = append(results, subResults...)
508
+
509
+ return results, nil
510
+ }
511
+ var REQUIRED_CONTEXT_BPP_ID = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
512
+
513
+ if input.Config.SkipTestsDict != nil {
514
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_BPP_ID"]; skip {
515
+ return []validationutils.ValidationOutput{}, nil
516
+ }
517
+ }
518
+
519
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
520
+
521
+ subResults := make([]validationutils.ValidationOutput, 0)
522
+ valid := true
523
+ configureDebugInfo := ""
524
+ for _, testObjMap := range scope {
525
+ validationutils.UnusedFunction(testObjMap)
526
+
527
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.bpp_id", true)
528
+ validationutils.UnusedFunction(attr)
529
+
530
+ validate := validationutils.ArePresent(attr)
531
+
532
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_BPP_ID","attr":"$.context.bpp_id","_RETURN_":"attr are present"}`
533
+
534
+ if !validate {
535
+ result := validationutils.ValidationOutput{
536
+ TestName: "REQUIRED_CONTEXT_BPP_ID",
537
+ Valid: false,
538
+ Code: 30000,
539
+ Description: `#### **REQUIRED_CONTEXT_BPP_ID**
540
+
541
+ - $.context.bpp_id must be present in the payload`,
542
+ DebugInfo: &validationutils.DebugInfo{
543
+ FedConfig: configureDebugInfo,
544
+ },
545
+ }
546
+ return []validationutils.ValidationOutput{result}, nil
547
+ }
548
+
549
+ }
550
+
551
+ result := validationutils.ValidationOutput{
552
+ TestName: "REQUIRED_CONTEXT_BPP_ID",
553
+ Valid: valid,
554
+ Code: 0,
555
+ DebugInfo: &validationutils.DebugInfo{
556
+ FedConfig: configureDebugInfo,
557
+ },
558
+ }
559
+
560
+ if valid {
561
+ result.Code = 200
562
+ } else {
563
+ result.Code = 30000
564
+ }
565
+
566
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
567
+ results = append(results, result)
568
+ results = append(results, subResults...)
569
+
570
+ return results, nil
571
+ }
572
+ var REQUIRED_CONTEXT_BPP_URI = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
573
+
574
+ if input.Config.SkipTestsDict != nil {
575
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_BPP_URI"]; skip {
576
+ return []validationutils.ValidationOutput{}, nil
577
+ }
578
+ }
579
+
580
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
581
+
582
+ subResults := make([]validationutils.ValidationOutput, 0)
583
+ valid := true
584
+ configureDebugInfo := ""
585
+ for _, testObjMap := range scope {
586
+ validationutils.UnusedFunction(testObjMap)
587
+
588
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.bpp_uri", true)
589
+ validationutils.UnusedFunction(attr)
590
+
591
+ validate := validationutils.ArePresent(attr)
592
+
593
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_BPP_URI","attr":"$.context.bpp_uri","_RETURN_":"attr are present"}`
594
+
595
+ if !validate {
596
+ result := validationutils.ValidationOutput{
597
+ TestName: "REQUIRED_CONTEXT_BPP_URI",
598
+ Valid: false,
599
+ Code: 30000,
600
+ Description: `#### **REQUIRED_CONTEXT_BPP_URI**
601
+
602
+ - $.context.bpp_uri must be present in the payload`,
603
+ DebugInfo: &validationutils.DebugInfo{
604
+ FedConfig: configureDebugInfo,
605
+ },
606
+ }
607
+ return []validationutils.ValidationOutput{result}, nil
608
+ }
609
+
610
+ }
611
+
612
+ result := validationutils.ValidationOutput{
613
+ TestName: "REQUIRED_CONTEXT_BPP_URI",
614
+ Valid: valid,
615
+ Code: 0,
616
+ DebugInfo: &validationutils.DebugInfo{
617
+ FedConfig: configureDebugInfo,
618
+ },
619
+ }
620
+
621
+ if valid {
622
+ result.Code = 200
623
+ } else {
624
+ result.Code = 30000
625
+ }
626
+
627
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
628
+ results = append(results, result)
629
+ results = append(results, subResults...)
630
+
631
+ return results, nil
632
+ }
633
+ var REQUIRED_CONTEXT_TRANSACTION_ID = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
634
+
635
+ if input.Config.SkipTestsDict != nil {
636
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_TRANSACTION_ID"]; skip {
637
+ return []validationutils.ValidationOutput{}, nil
638
+ }
639
+ }
640
+
641
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
642
+
643
+ subResults := make([]validationutils.ValidationOutput, 0)
644
+ valid := true
645
+ configureDebugInfo := ""
646
+ for _, testObjMap := range scope {
647
+ validationutils.UnusedFunction(testObjMap)
648
+
649
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.transaction_id", true)
650
+ validationutils.UnusedFunction(attr)
651
+
652
+ validate := validationutils.ArePresent(attr)
653
+
654
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_TRANSACTION_ID","attr":"$.context.transaction_id","_RETURN_":"attr are present"}`
655
+
656
+ if !validate {
657
+ result := validationutils.ValidationOutput{
658
+ TestName: "REQUIRED_CONTEXT_TRANSACTION_ID",
659
+ Valid: false,
660
+ Code: 30000,
661
+ Description: `#### **REQUIRED_CONTEXT_TRANSACTION_ID**
662
+
663
+ - $.context.transaction_id must be present in the payload`,
664
+ DebugInfo: &validationutils.DebugInfo{
665
+ FedConfig: configureDebugInfo,
666
+ },
667
+ }
668
+ return []validationutils.ValidationOutput{result}, nil
669
+ }
670
+
671
+ }
672
+
673
+ result := validationutils.ValidationOutput{
674
+ TestName: "REQUIRED_CONTEXT_TRANSACTION_ID",
675
+ Valid: valid,
676
+ Code: 0,
677
+ DebugInfo: &validationutils.DebugInfo{
678
+ FedConfig: configureDebugInfo,
679
+ },
680
+ }
681
+
682
+ if valid {
683
+ result.Code = 200
684
+ } else {
685
+ result.Code = 30000
686
+ }
687
+
688
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
689
+ results = append(results, result)
690
+ results = append(results, subResults...)
691
+
692
+ return results, nil
693
+ }
694
+ var REQUIRED_CONTEXT_MESSAGE_ID = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
695
+
696
+ if input.Config.SkipTestsDict != nil {
697
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_MESSAGE_ID"]; skip {
698
+ return []validationutils.ValidationOutput{}, nil
699
+ }
700
+ }
701
+
702
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
703
+
704
+ subResults := make([]validationutils.ValidationOutput, 0)
705
+ valid := true
706
+ configureDebugInfo := ""
707
+ for _, testObjMap := range scope {
708
+ validationutils.UnusedFunction(testObjMap)
709
+
710
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.message_id", true)
711
+ validationutils.UnusedFunction(attr)
712
+
713
+ validate := validationutils.ArePresent(attr)
714
+
715
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_MESSAGE_ID","attr":"$.context.message_id","_RETURN_":"attr are present"}`
716
+
717
+ if !validate {
718
+ result := validationutils.ValidationOutput{
719
+ TestName: "REQUIRED_CONTEXT_MESSAGE_ID",
720
+ Valid: false,
721
+ Code: 30000,
722
+ Description: `#### **REQUIRED_CONTEXT_MESSAGE_ID**
723
+
724
+ - $.context.message_id must be present in the payload`,
725
+ DebugInfo: &validationutils.DebugInfo{
726
+ FedConfig: configureDebugInfo,
727
+ },
728
+ }
729
+ return []validationutils.ValidationOutput{result}, nil
730
+ }
731
+
732
+ }
733
+
734
+ result := validationutils.ValidationOutput{
735
+ TestName: "REQUIRED_CONTEXT_MESSAGE_ID",
736
+ Valid: valid,
737
+ Code: 0,
738
+ DebugInfo: &validationutils.DebugInfo{
739
+ FedConfig: configureDebugInfo,
740
+ },
741
+ }
742
+
743
+ if valid {
744
+ result.Code = 200
745
+ } else {
746
+ result.Code = 30000
747
+ }
748
+
749
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
750
+ results = append(results, result)
751
+ results = append(results, subResults...)
752
+
753
+ return results, nil
754
+ }
755
+ var REQUIRED_CONTEXT_TIMESTAMP = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
756
+
757
+ if input.Config.SkipTestsDict != nil {
758
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_CONTEXT_TIMESTAMP"]; skip {
759
+ return []validationutils.ValidationOutput{}, nil
760
+ }
761
+ }
762
+
763
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
764
+
765
+ subResults := make([]validationutils.ValidationOutput, 0)
766
+ valid := true
767
+ configureDebugInfo := ""
768
+ for _, testObjMap := range scope {
769
+ validationutils.UnusedFunction(testObjMap)
770
+
771
+ attr := validationutils.GetJsonPath(testObjMap, "$.context.timestamp", true)
772
+ validationutils.UnusedFunction(attr)
773
+
774
+ validate := validationutils.ArePresent(attr)
775
+
776
+ configureDebugInfo = `{"_NAME_":"REQUIRED_CONTEXT_TIMESTAMP","attr":"$.context.timestamp","_RETURN_":"attr are present"}`
777
+
778
+ if !validate {
779
+ result := validationutils.ValidationOutput{
780
+ TestName: "REQUIRED_CONTEXT_TIMESTAMP",
781
+ Valid: false,
782
+ Code: 30000,
783
+ Description: `#### **REQUIRED_CONTEXT_TIMESTAMP**
784
+
785
+ - $.context.timestamp must be present in the payload`,
786
+ DebugInfo: &validationutils.DebugInfo{
787
+ FedConfig: configureDebugInfo,
788
+ },
789
+ }
790
+ return []validationutils.ValidationOutput{result}, nil
791
+ }
792
+
793
+ }
794
+
795
+ result := validationutils.ValidationOutput{
796
+ TestName: "REQUIRED_CONTEXT_TIMESTAMP",
797
+ Valid: valid,
798
+ Code: 0,
799
+ DebugInfo: &validationutils.DebugInfo{
800
+ FedConfig: configureDebugInfo,
801
+ },
802
+ }
803
+
804
+ if valid {
805
+ result.Code = 200
806
+ } else {
807
+ result.Code = 30000
808
+ }
809
+
810
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
811
+ results = append(results, result)
812
+ results = append(results, subResults...)
813
+
814
+ return results, nil
815
+ }
816
+ var REQUIRED_MESSAGE_ID = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
817
+
818
+ if input.Config.SkipTestsDict != nil {
819
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_ID"]; skip {
820
+ return []validationutils.ValidationOutput{}, nil
821
+ }
822
+ }
823
+
824
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
825
+
826
+ subResults := make([]validationutils.ValidationOutput, 0)
827
+ valid := true
828
+ configureDebugInfo := ""
829
+ for _, testObjMap := range scope {
830
+ validationutils.UnusedFunction(testObjMap)
831
+
832
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.items[*].id", true)
833
+ validationutils.UnusedFunction(attr)
834
+
835
+ validate := validationutils.ArePresent(attr)
836
+
837
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_ID","attr":"$.message.order.items[*].id","_RETURN_":"attr are present"}`
838
+
839
+ if !validate {
840
+ result := validationutils.ValidationOutput{
841
+ TestName: "REQUIRED_MESSAGE_ID",
842
+ Valid: false,
843
+ Code: 30000,
844
+ Description: `#### **REQUIRED_MESSAGE_ID**
845
+
846
+ - $.message.order.items[*].id must be present in the payload`,
847
+ DebugInfo: &validationutils.DebugInfo{
848
+ FedConfig: configureDebugInfo,
849
+ },
850
+ }
851
+ return []validationutils.ValidationOutput{result}, nil
852
+ }
853
+
854
+ }
855
+
856
+ result := validationutils.ValidationOutput{
857
+ TestName: "REQUIRED_MESSAGE_ID",
858
+ Valid: valid,
859
+ Code: 0,
860
+ DebugInfo: &validationutils.DebugInfo{
861
+ FedConfig: configureDebugInfo,
862
+ },
863
+ }
864
+
865
+ if valid {
866
+ result.Code = 200
867
+ } else {
868
+ result.Code = 30000
869
+ }
870
+
871
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
872
+ results = append(results, result)
873
+ results = append(results, subResults...)
874
+
875
+ return results, nil
876
+ }
877
+ var REQUIRED_MESSAGE_ID_14 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
878
+
879
+ if input.Config.SkipTestsDict != nil {
880
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_ID_14"]; skip {
881
+ return []validationutils.ValidationOutput{}, nil
882
+ }
883
+ }
884
+
885
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
886
+
887
+ subResults := make([]validationutils.ValidationOutput, 0)
888
+ valid := true
889
+ configureDebugInfo := ""
890
+ for _, testObjMap := range scope {
891
+ validationutils.UnusedFunction(testObjMap)
892
+
893
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].id", true)
894
+ validationutils.UnusedFunction(attr)
895
+
896
+ validate := validationutils.ArePresent(attr)
897
+
898
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_ID_14","attr":"$.message.order.fulfillments[*].id","_RETURN_":"attr are present"}`
899
+
900
+ if !validate {
901
+ result := validationutils.ValidationOutput{
902
+ TestName: "REQUIRED_MESSAGE_ID_14",
903
+ Valid: false,
904
+ Code: 30000,
905
+ Description: `#### **REQUIRED_MESSAGE_ID_14**
906
+
907
+ - $.message.order.fulfillments[*].id must be present in the payload`,
908
+ DebugInfo: &validationutils.DebugInfo{
909
+ FedConfig: configureDebugInfo,
910
+ },
911
+ }
912
+ return []validationutils.ValidationOutput{result}, nil
913
+ }
914
+
915
+ }
916
+
917
+ result := validationutils.ValidationOutput{
918
+ TestName: "REQUIRED_MESSAGE_ID_14",
919
+ Valid: valid,
920
+ Code: 0,
921
+ DebugInfo: &validationutils.DebugInfo{
922
+ FedConfig: configureDebugInfo,
923
+ },
924
+ }
925
+
926
+ if valid {
927
+ result.Code = 200
928
+ } else {
929
+ result.Code = 30000
930
+ }
931
+
932
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
933
+ results = append(results, result)
934
+ results = append(results, subResults...)
935
+
936
+ return results, nil
937
+ }
938
+ var REQUIRED_MESSAGE_TYPE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
939
+
940
+ if input.Config.SkipTestsDict != nil {
941
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_TYPE"]; skip {
942
+ return []validationutils.ValidationOutput{}, nil
943
+ }
944
+ }
945
+
946
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
947
+
948
+ subResults := make([]validationutils.ValidationOutput, 0)
949
+ valid := true
950
+ configureDebugInfo := ""
951
+ for _, testObjMap := range scope {
952
+ validationutils.UnusedFunction(testObjMap)
953
+
954
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
955
+ validationutils.UnusedFunction(attr)
956
+ enumList := validationutils.StringSliceToInterface([]string{`Delivery`, `Return`, `Batch`, `RTO`, `FTL`, `PTL`, `FIFO`})
957
+ validationutils.UnusedFunction(enumList)
958
+
959
+ validate := (validationutils.ArePresent(attr)) && (validationutils.AllIn(attr, enumList))
960
+
961
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_TYPE","attr":"$.message.order.fulfillments[*].type","_RETURN_":"attr are present && attr all in enumList","enumList":["Delivery","Return","Batch","RTO","FTL","PTL","FIFO"]}`
962
+
963
+ if !validate {
964
+ result := validationutils.ValidationOutput{
965
+ TestName: "REQUIRED_MESSAGE_TYPE",
966
+ Valid: false,
967
+ Code: 30000,
968
+ Description: `#### **REQUIRED_MESSAGE_TYPE**
969
+
970
+ **All of the following must be true:**
971
+ - $.message.order.fulfillments[*].type must be present in the payload
972
+ - All elements of $.message.order.fulfillments[*].type must be in ["Delivery", "Return", "Batch", "RTO", "FTL", "PTL", "FIFO"]`,
973
+ DebugInfo: &validationutils.DebugInfo{
974
+ FedConfig: configureDebugInfo,
975
+ },
976
+ }
977
+ return []validationutils.ValidationOutput{result}, nil
978
+ }
979
+
980
+ }
981
+
982
+ result := validationutils.ValidationOutput{
983
+ TestName: "REQUIRED_MESSAGE_TYPE",
984
+ Valid: valid,
985
+ Code: 0,
986
+ DebugInfo: &validationutils.DebugInfo{
987
+ FedConfig: configureDebugInfo,
988
+ },
989
+ }
990
+
991
+ if valid {
992
+ result.Code = 200
993
+ } else {
994
+ result.Code = 30000
995
+ }
996
+
997
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
998
+ results = append(results, result)
999
+ results = append(results, subResults...)
1000
+
1001
+ return results, nil
1002
+ }
1003
+ var REQUIRED_MESSAGE_ID_16 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1004
+
1005
+ if input.Config.SkipTestsDict != nil {
1006
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_ID_16"]; skip {
1007
+ return []validationutils.ValidationOutput{}, nil
1008
+ }
1009
+ }
1010
+
1011
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1012
+
1013
+ subResults := make([]validationutils.ValidationOutput, 0)
1014
+ valid := true
1015
+ configureDebugInfo := ""
1016
+ for _, testObjMap := range scope {
1017
+ validationutils.UnusedFunction(testObjMap)
1018
+
1019
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.id", true)
1020
+ validationutils.UnusedFunction(attr)
1021
+
1022
+ skipCheck := !(validationutils.ArePresent(attr))
1023
+ if skipCheck {
1024
+ continue
1025
+ }
1026
+
1027
+ validate := validationutils.ArePresent(attr)
1028
+
1029
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_ID_16","attr":"$.message.order.fulfillments[*].start.location.id","_RETURN_":"attr are present","_CONTINUE_":"!(attr are present)"}`
1030
+
1031
+ if !validate {
1032
+ result := validationutils.ValidationOutput{
1033
+ TestName: "REQUIRED_MESSAGE_ID_16",
1034
+ Valid: false,
1035
+ Code: 30000,
1036
+ Description: `#### **REQUIRED_MESSAGE_ID_16**
1037
+
1038
+ - $.message.order.fulfillments[*].start.location.id must be present in the payload
1039
+
1040
+ > **Skip if:**
1041
+ >
1042
+ > - $.message.order.fulfillments[*].start.location.id is not in the payload`,
1043
+ DebugInfo: &validationutils.DebugInfo{
1044
+ FedConfig: configureDebugInfo,
1045
+ },
1046
+ }
1047
+ return []validationutils.ValidationOutput{result}, nil
1048
+ }
1049
+
1050
+ }
1051
+
1052
+ result := validationutils.ValidationOutput{
1053
+ TestName: "REQUIRED_MESSAGE_ID_16",
1054
+ Valid: valid,
1055
+ Code: 0,
1056
+ DebugInfo: &validationutils.DebugInfo{
1057
+ FedConfig: configureDebugInfo,
1058
+ },
1059
+ }
1060
+
1061
+ if valid {
1062
+ result.Code = 200
1063
+ } else {
1064
+ result.Code = 30000
1065
+ }
1066
+
1067
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1068
+ results = append(results, result)
1069
+ results = append(results, subResults...)
1070
+
1071
+ return results, nil
1072
+ }
1073
+ var REQUIRED_MESSAGE_GPS = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1074
+
1075
+ if input.Config.SkipTestsDict != nil {
1076
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_GPS"]; skip {
1077
+ return []validationutils.ValidationOutput{}, nil
1078
+ }
1079
+ }
1080
+
1081
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1082
+
1083
+ subResults := make([]validationutils.ValidationOutput, 0)
1084
+ valid := true
1085
+ configureDebugInfo := ""
1086
+ for _, testObjMap := range scope {
1087
+ validationutils.UnusedFunction(testObjMap)
1088
+
1089
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.gps", true)
1090
+ validationutils.UnusedFunction(attr)
1091
+
1092
+ validate := validationutils.ArePresent(attr)
1093
+
1094
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_GPS","attr":"$.message.order.fulfillments[*].start.location.gps","_RETURN_":"attr are present"}`
1095
+
1096
+ if !validate {
1097
+ result := validationutils.ValidationOutput{
1098
+ TestName: "REQUIRED_MESSAGE_GPS",
1099
+ Valid: false,
1100
+ Code: 30000,
1101
+ Description: `#### **REQUIRED_MESSAGE_GPS**
1102
+
1103
+ - $.message.order.fulfillments[*].start.location.gps must be present in the payload`,
1104
+ DebugInfo: &validationutils.DebugInfo{
1105
+ FedConfig: configureDebugInfo,
1106
+ },
1107
+ }
1108
+ return []validationutils.ValidationOutput{result}, nil
1109
+ }
1110
+
1111
+ }
1112
+
1113
+ result := validationutils.ValidationOutput{
1114
+ TestName: "REQUIRED_MESSAGE_GPS",
1115
+ Valid: valid,
1116
+ Code: 0,
1117
+ DebugInfo: &validationutils.DebugInfo{
1118
+ FedConfig: configureDebugInfo,
1119
+ },
1120
+ }
1121
+
1122
+ if valid {
1123
+ result.Code = 200
1124
+ } else {
1125
+ result.Code = 30000
1126
+ }
1127
+
1128
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1129
+ results = append(results, result)
1130
+ results = append(results, subResults...)
1131
+
1132
+ return results, nil
1133
+ }
1134
+ var REQUIRED_MESSAGE_NAME = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1135
+
1136
+ if input.Config.SkipTestsDict != nil {
1137
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_NAME"]; skip {
1138
+ return []validationutils.ValidationOutput{}, nil
1139
+ }
1140
+ }
1141
+
1142
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1143
+
1144
+ subResults := make([]validationutils.ValidationOutput, 0)
1145
+ valid := true
1146
+ configureDebugInfo := ""
1147
+ for _, testObjMap := range scope {
1148
+ validationutils.UnusedFunction(testObjMap)
1149
+
1150
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.name", true)
1151
+ validationutils.UnusedFunction(attr)
1152
+
1153
+ validate := validationutils.ArePresent(attr)
1154
+
1155
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_NAME","attr":"$.message.order.fulfillments[*].start.location.address.name","_RETURN_":"attr are present"}`
1156
+
1157
+ if !validate {
1158
+ result := validationutils.ValidationOutput{
1159
+ TestName: "REQUIRED_MESSAGE_NAME",
1160
+ Valid: false,
1161
+ Code: 30000,
1162
+ Description: `#### **REQUIRED_MESSAGE_NAME**
1163
+
1164
+ - $.message.order.fulfillments[*].start.location.address.name must be present in the payload`,
1165
+ DebugInfo: &validationutils.DebugInfo{
1166
+ FedConfig: configureDebugInfo,
1167
+ },
1168
+ }
1169
+ return []validationutils.ValidationOutput{result}, nil
1170
+ }
1171
+
1172
+ }
1173
+
1174
+ result := validationutils.ValidationOutput{
1175
+ TestName: "REQUIRED_MESSAGE_NAME",
1176
+ Valid: valid,
1177
+ Code: 0,
1178
+ DebugInfo: &validationutils.DebugInfo{
1179
+ FedConfig: configureDebugInfo,
1180
+ },
1181
+ }
1182
+
1183
+ if valid {
1184
+ result.Code = 200
1185
+ } else {
1186
+ result.Code = 30000
1187
+ }
1188
+
1189
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1190
+ results = append(results, result)
1191
+ results = append(results, subResults...)
1192
+
1193
+ return results, nil
1194
+ }
1195
+ var REQUIRED_MESSAGE_BUILDING = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1196
+
1197
+ if input.Config.SkipTestsDict != nil {
1198
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_BUILDING"]; skip {
1199
+ return []validationutils.ValidationOutput{}, nil
1200
+ }
1201
+ }
1202
+
1203
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1204
+
1205
+ subResults := make([]validationutils.ValidationOutput, 0)
1206
+ valid := true
1207
+ configureDebugInfo := ""
1208
+ for _, testObjMap := range scope {
1209
+ validationutils.UnusedFunction(testObjMap)
1210
+
1211
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.building", true)
1212
+ validationutils.UnusedFunction(attr)
1213
+
1214
+ validate := validationutils.ArePresent(attr)
1215
+
1216
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_BUILDING","attr":"$.message.order.fulfillments[*].start.location.address.building","_RETURN_":"attr are present"}`
1217
+
1218
+ if !validate {
1219
+ result := validationutils.ValidationOutput{
1220
+ TestName: "REQUIRED_MESSAGE_BUILDING",
1221
+ Valid: false,
1222
+ Code: 30000,
1223
+ Description: `#### **REQUIRED_MESSAGE_BUILDING**
1224
+
1225
+ - $.message.order.fulfillments[*].start.location.address.building must be present in the payload`,
1226
+ DebugInfo: &validationutils.DebugInfo{
1227
+ FedConfig: configureDebugInfo,
1228
+ },
1229
+ }
1230
+ return []validationutils.ValidationOutput{result}, nil
1231
+ }
1232
+
1233
+ }
1234
+
1235
+ result := validationutils.ValidationOutput{
1236
+ TestName: "REQUIRED_MESSAGE_BUILDING",
1237
+ Valid: valid,
1238
+ Code: 0,
1239
+ DebugInfo: &validationutils.DebugInfo{
1240
+ FedConfig: configureDebugInfo,
1241
+ },
1242
+ }
1243
+
1244
+ if valid {
1245
+ result.Code = 200
1246
+ } else {
1247
+ result.Code = 30000
1248
+ }
1249
+
1250
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1251
+ results = append(results, result)
1252
+ results = append(results, subResults...)
1253
+
1254
+ return results, nil
1255
+ }
1256
+ var REQUIRED_MESSAGE_LOCALITY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1257
+
1258
+ if input.Config.SkipTestsDict != nil {
1259
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_LOCALITY"]; skip {
1260
+ return []validationutils.ValidationOutput{}, nil
1261
+ }
1262
+ }
1263
+
1264
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1265
+
1266
+ subResults := make([]validationutils.ValidationOutput, 0)
1267
+ valid := true
1268
+ configureDebugInfo := ""
1269
+ for _, testObjMap := range scope {
1270
+ validationutils.UnusedFunction(testObjMap)
1271
+
1272
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.locality", true)
1273
+ validationutils.UnusedFunction(attr)
1274
+
1275
+ validate := validationutils.ArePresent(attr)
1276
+
1277
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_LOCALITY","attr":"$.message.order.fulfillments[*].start.location.address.locality","_RETURN_":"attr are present"}`
1278
+
1279
+ if !validate {
1280
+ result := validationutils.ValidationOutput{
1281
+ TestName: "REQUIRED_MESSAGE_LOCALITY",
1282
+ Valid: false,
1283
+ Code: 30000,
1284
+ Description: `#### **REQUIRED_MESSAGE_LOCALITY**
1285
+
1286
+ - $.message.order.fulfillments[*].start.location.address.locality must be present in the payload`,
1287
+ DebugInfo: &validationutils.DebugInfo{
1288
+ FedConfig: configureDebugInfo,
1289
+ },
1290
+ }
1291
+ return []validationutils.ValidationOutput{result}, nil
1292
+ }
1293
+
1294
+ }
1295
+
1296
+ result := validationutils.ValidationOutput{
1297
+ TestName: "REQUIRED_MESSAGE_LOCALITY",
1298
+ Valid: valid,
1299
+ Code: 0,
1300
+ DebugInfo: &validationutils.DebugInfo{
1301
+ FedConfig: configureDebugInfo,
1302
+ },
1303
+ }
1304
+
1305
+ if valid {
1306
+ result.Code = 200
1307
+ } else {
1308
+ result.Code = 30000
1309
+ }
1310
+
1311
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1312
+ results = append(results, result)
1313
+ results = append(results, subResults...)
1314
+
1315
+ return results, nil
1316
+ }
1317
+ var REQUIRED_MESSAGE_CITY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1318
+
1319
+ if input.Config.SkipTestsDict != nil {
1320
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_CITY"]; skip {
1321
+ return []validationutils.ValidationOutput{}, nil
1322
+ }
1323
+ }
1324
+
1325
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1326
+
1327
+ subResults := make([]validationutils.ValidationOutput, 0)
1328
+ valid := true
1329
+ configureDebugInfo := ""
1330
+ for _, testObjMap := range scope {
1331
+ validationutils.UnusedFunction(testObjMap)
1332
+
1333
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.city", true)
1334
+ validationutils.UnusedFunction(attr)
1335
+
1336
+ validate := validationutils.ArePresent(attr)
1337
+
1338
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_CITY","attr":"$.message.order.fulfillments[*].start.location.address.city","_RETURN_":"attr are present"}`
1339
+
1340
+ if !validate {
1341
+ result := validationutils.ValidationOutput{
1342
+ TestName: "REQUIRED_MESSAGE_CITY",
1343
+ Valid: false,
1344
+ Code: 30000,
1345
+ Description: `#### **REQUIRED_MESSAGE_CITY**
1346
+
1347
+ - $.message.order.fulfillments[*].start.location.address.city must be present in the payload`,
1348
+ DebugInfo: &validationutils.DebugInfo{
1349
+ FedConfig: configureDebugInfo,
1350
+ },
1351
+ }
1352
+ return []validationutils.ValidationOutput{result}, nil
1353
+ }
1354
+
1355
+ }
1356
+
1357
+ result := validationutils.ValidationOutput{
1358
+ TestName: "REQUIRED_MESSAGE_CITY",
1359
+ Valid: valid,
1360
+ Code: 0,
1361
+ DebugInfo: &validationutils.DebugInfo{
1362
+ FedConfig: configureDebugInfo,
1363
+ },
1364
+ }
1365
+
1366
+ if valid {
1367
+ result.Code = 200
1368
+ } else {
1369
+ result.Code = 30000
1370
+ }
1371
+
1372
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1373
+ results = append(results, result)
1374
+ results = append(results, subResults...)
1375
+
1376
+ return results, nil
1377
+ }
1378
+ var REQUIRED_MESSAGE_STATE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1379
+
1380
+ if input.Config.SkipTestsDict != nil {
1381
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_STATE"]; skip {
1382
+ return []validationutils.ValidationOutput{}, nil
1383
+ }
1384
+ }
1385
+
1386
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1387
+
1388
+ subResults := make([]validationutils.ValidationOutput, 0)
1389
+ valid := true
1390
+ configureDebugInfo := ""
1391
+ for _, testObjMap := range scope {
1392
+ validationutils.UnusedFunction(testObjMap)
1393
+
1394
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.state", true)
1395
+ validationutils.UnusedFunction(attr)
1396
+
1397
+ validate := validationutils.ArePresent(attr)
1398
+
1399
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_STATE","attr":"$.message.order.fulfillments[*].start.location.address.state","_RETURN_":"attr are present"}`
1400
+
1401
+ if !validate {
1402
+ result := validationutils.ValidationOutput{
1403
+ TestName: "REQUIRED_MESSAGE_STATE",
1404
+ Valid: false,
1405
+ Code: 30000,
1406
+ Description: `#### **REQUIRED_MESSAGE_STATE**
1407
+
1408
+ - $.message.order.fulfillments[*].start.location.address.state must be present in the payload`,
1409
+ DebugInfo: &validationutils.DebugInfo{
1410
+ FedConfig: configureDebugInfo,
1411
+ },
1412
+ }
1413
+ return []validationutils.ValidationOutput{result}, nil
1414
+ }
1415
+
1416
+ }
1417
+
1418
+ result := validationutils.ValidationOutput{
1419
+ TestName: "REQUIRED_MESSAGE_STATE",
1420
+ Valid: valid,
1421
+ Code: 0,
1422
+ DebugInfo: &validationutils.DebugInfo{
1423
+ FedConfig: configureDebugInfo,
1424
+ },
1425
+ }
1426
+
1427
+ if valid {
1428
+ result.Code = 200
1429
+ } else {
1430
+ result.Code = 30000
1431
+ }
1432
+
1433
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1434
+ results = append(results, result)
1435
+ results = append(results, subResults...)
1436
+
1437
+ return results, nil
1438
+ }
1439
+ var REQUIRED_MESSAGE_COUNTRY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1440
+
1441
+ if input.Config.SkipTestsDict != nil {
1442
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_COUNTRY"]; skip {
1443
+ return []validationutils.ValidationOutput{}, nil
1444
+ }
1445
+ }
1446
+
1447
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1448
+
1449
+ subResults := make([]validationutils.ValidationOutput, 0)
1450
+ valid := true
1451
+ configureDebugInfo := ""
1452
+ for _, testObjMap := range scope {
1453
+ validationutils.UnusedFunction(testObjMap)
1454
+
1455
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.country", true)
1456
+ validationutils.UnusedFunction(attr)
1457
+
1458
+ validate := validationutils.ArePresent(attr)
1459
+
1460
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_COUNTRY","attr":"$.message.order.fulfillments[*].start.location.address.country","_RETURN_":"attr are present"}`
1461
+
1462
+ if !validate {
1463
+ result := validationutils.ValidationOutput{
1464
+ TestName: "REQUIRED_MESSAGE_COUNTRY",
1465
+ Valid: false,
1466
+ Code: 30000,
1467
+ Description: `#### **REQUIRED_MESSAGE_COUNTRY**
1468
+
1469
+ - $.message.order.fulfillments[*].start.location.address.country must be present in the payload`,
1470
+ DebugInfo: &validationutils.DebugInfo{
1471
+ FedConfig: configureDebugInfo,
1472
+ },
1473
+ }
1474
+ return []validationutils.ValidationOutput{result}, nil
1475
+ }
1476
+
1477
+ }
1478
+
1479
+ result := validationutils.ValidationOutput{
1480
+ TestName: "REQUIRED_MESSAGE_COUNTRY",
1481
+ Valid: valid,
1482
+ Code: 0,
1483
+ DebugInfo: &validationutils.DebugInfo{
1484
+ FedConfig: configureDebugInfo,
1485
+ },
1486
+ }
1487
+
1488
+ if valid {
1489
+ result.Code = 200
1490
+ } else {
1491
+ result.Code = 30000
1492
+ }
1493
+
1494
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1495
+ results = append(results, result)
1496
+ results = append(results, subResults...)
1497
+
1498
+ return results, nil
1499
+ }
1500
+ var REQUIRED_MESSAGE_AREA_CODE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1501
+
1502
+ if input.Config.SkipTestsDict != nil {
1503
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_AREA_CODE"]; skip {
1504
+ return []validationutils.ValidationOutput{}, nil
1505
+ }
1506
+ }
1507
+
1508
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1509
+
1510
+ subResults := make([]validationutils.ValidationOutput, 0)
1511
+ valid := true
1512
+ configureDebugInfo := ""
1513
+ for _, testObjMap := range scope {
1514
+ validationutils.UnusedFunction(testObjMap)
1515
+
1516
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.location.address.area_code", true)
1517
+ validationutils.UnusedFunction(attr)
1518
+
1519
+ validate := validationutils.ArePresent(attr)
1520
+
1521
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_AREA_CODE","attr":"$.message.order.fulfillments[*].start.location.address.area_code","_RETURN_":"attr are present"}`
1522
+
1523
+ if !validate {
1524
+ result := validationutils.ValidationOutput{
1525
+ TestName: "REQUIRED_MESSAGE_AREA_CODE",
1526
+ Valid: false,
1527
+ Code: 30000,
1528
+ Description: `#### **REQUIRED_MESSAGE_AREA_CODE**
1529
+
1530
+ - $.message.order.fulfillments[*].start.location.address.area_code must be present in the payload`,
1531
+ DebugInfo: &validationutils.DebugInfo{
1532
+ FedConfig: configureDebugInfo,
1533
+ },
1534
+ }
1535
+ return []validationutils.ValidationOutput{result}, nil
1536
+ }
1537
+
1538
+ }
1539
+
1540
+ result := validationutils.ValidationOutput{
1541
+ TestName: "REQUIRED_MESSAGE_AREA_CODE",
1542
+ Valid: valid,
1543
+ Code: 0,
1544
+ DebugInfo: &validationutils.DebugInfo{
1545
+ FedConfig: configureDebugInfo,
1546
+ },
1547
+ }
1548
+
1549
+ if valid {
1550
+ result.Code = 200
1551
+ } else {
1552
+ result.Code = 30000
1553
+ }
1554
+
1555
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1556
+ results = append(results, result)
1557
+ results = append(results, subResults...)
1558
+
1559
+ return results, nil
1560
+ }
1561
+ var REQUIRED_MESSAGE_PHONE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1562
+
1563
+ if input.Config.SkipTestsDict != nil {
1564
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_PHONE"]; skip {
1565
+ return []validationutils.ValidationOutput{}, nil
1566
+ }
1567
+ }
1568
+
1569
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1570
+
1571
+ subResults := make([]validationutils.ValidationOutput, 0)
1572
+ valid := true
1573
+ configureDebugInfo := ""
1574
+ for _, testObjMap := range scope {
1575
+ validationutils.UnusedFunction(testObjMap)
1576
+
1577
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.contact.phone", true)
1578
+ validationutils.UnusedFunction(attr)
1579
+
1580
+ validate := validationutils.ArePresent(attr)
1581
+
1582
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_PHONE","attr":"$.message.order.fulfillments[*].start.contact.phone","_RETURN_":"attr are present"}`
1583
+
1584
+ if !validate {
1585
+ result := validationutils.ValidationOutput{
1586
+ TestName: "REQUIRED_MESSAGE_PHONE",
1587
+ Valid: false,
1588
+ Code: 30000,
1589
+ Description: `#### **REQUIRED_MESSAGE_PHONE**
1590
+
1591
+ - $.message.order.fulfillments[*].start.contact.phone must be present in the payload`,
1592
+ DebugInfo: &validationutils.DebugInfo{
1593
+ FedConfig: configureDebugInfo,
1594
+ },
1595
+ }
1596
+ return []validationutils.ValidationOutput{result}, nil
1597
+ }
1598
+
1599
+ }
1600
+
1601
+ result := validationutils.ValidationOutput{
1602
+ TestName: "REQUIRED_MESSAGE_PHONE",
1603
+ Valid: valid,
1604
+ Code: 0,
1605
+ DebugInfo: &validationutils.DebugInfo{
1606
+ FedConfig: configureDebugInfo,
1607
+ },
1608
+ }
1609
+
1610
+ if valid {
1611
+ result.Code = 200
1612
+ } else {
1613
+ result.Code = 30000
1614
+ }
1615
+
1616
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1617
+ results = append(results, result)
1618
+ results = append(results, subResults...)
1619
+
1620
+ return results, nil
1621
+ }
1622
+ var REQUIRED_MESSAGE_EMAIL = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1623
+
1624
+ if input.Config.SkipTestsDict != nil {
1625
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_EMAIL"]; skip {
1626
+ return []validationutils.ValidationOutput{}, nil
1627
+ }
1628
+ }
1629
+
1630
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1631
+
1632
+ subResults := make([]validationutils.ValidationOutput, 0)
1633
+ valid := true
1634
+ configureDebugInfo := ""
1635
+ for _, testObjMap := range scope {
1636
+ validationutils.UnusedFunction(testObjMap)
1637
+
1638
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.contact.email", true)
1639
+ validationutils.UnusedFunction(attr)
1640
+
1641
+ validate := validationutils.ArePresent(attr)
1642
+
1643
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_EMAIL","attr":"$.message.order.fulfillments[*].start.contact.email","_RETURN_":"attr are present"}`
1644
+
1645
+ if !validate {
1646
+ result := validationutils.ValidationOutput{
1647
+ TestName: "REQUIRED_MESSAGE_EMAIL",
1648
+ Valid: false,
1649
+ Code: 30000,
1650
+ Description: `#### **REQUIRED_MESSAGE_EMAIL**
1651
+
1652
+ - $.message.order.fulfillments[*].start.contact.email must be present in the payload`,
1653
+ DebugInfo: &validationutils.DebugInfo{
1654
+ FedConfig: configureDebugInfo,
1655
+ },
1656
+ }
1657
+ return []validationutils.ValidationOutput{result}, nil
1658
+ }
1659
+
1660
+ }
1661
+
1662
+ result := validationutils.ValidationOutput{
1663
+ TestName: "REQUIRED_MESSAGE_EMAIL",
1664
+ Valid: valid,
1665
+ Code: 0,
1666
+ DebugInfo: &validationutils.DebugInfo{
1667
+ FedConfig: configureDebugInfo,
1668
+ },
1669
+ }
1670
+
1671
+ if valid {
1672
+ result.Code = 200
1673
+ } else {
1674
+ result.Code = 30000
1675
+ }
1676
+
1677
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1678
+ results = append(results, result)
1679
+ results = append(results, subResults...)
1680
+
1681
+ return results, nil
1682
+ }
1683
+ var REQUIRED_MESSAGE_GPS_27 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1684
+
1685
+ if input.Config.SkipTestsDict != nil {
1686
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_GPS_27"]; skip {
1687
+ return []validationutils.ValidationOutput{}, nil
1688
+ }
1689
+ }
1690
+
1691
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1692
+
1693
+ subResults := make([]validationutils.ValidationOutput, 0)
1694
+ valid := true
1695
+ configureDebugInfo := ""
1696
+ for _, testObjMap := range scope {
1697
+ validationutils.UnusedFunction(testObjMap)
1698
+
1699
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.gps", true)
1700
+ validationutils.UnusedFunction(attr)
1701
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
1702
+ validationutils.UnusedFunction(fulfillmentType)
1703
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
1704
+ validationutils.UnusedFunction(fulType)
1705
+
1706
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
1707
+ if skipCheck {
1708
+ continue
1709
+ }
1710
+
1711
+ validate := validationutils.ArePresent(attr)
1712
+
1713
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_GPS_27","attr":"$.message.order.fulfillments[*].end.location.gps","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
1714
+
1715
+ if !validate {
1716
+ result := validationutils.ValidationOutput{
1717
+ TestName: "REQUIRED_MESSAGE_GPS_27",
1718
+ Valid: false,
1719
+ Code: 30000,
1720
+ Description: `#### **REQUIRED_MESSAGE_GPS_27**
1721
+
1722
+ - $.message.order.fulfillments[*].end.location.gps must be present in the payload
1723
+
1724
+ > **Skip if:**
1725
+ >
1726
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
1727
+ DebugInfo: &validationutils.DebugInfo{
1728
+ FedConfig: configureDebugInfo,
1729
+ },
1730
+ }
1731
+ return []validationutils.ValidationOutput{result}, nil
1732
+ }
1733
+
1734
+ }
1735
+
1736
+ result := validationutils.ValidationOutput{
1737
+ TestName: "REQUIRED_MESSAGE_GPS_27",
1738
+ Valid: valid,
1739
+ Code: 0,
1740
+ DebugInfo: &validationutils.DebugInfo{
1741
+ FedConfig: configureDebugInfo,
1742
+ },
1743
+ }
1744
+
1745
+ if valid {
1746
+ result.Code = 200
1747
+ } else {
1748
+ result.Code = 30000
1749
+ }
1750
+
1751
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1752
+ results = append(results, result)
1753
+ results = append(results, subResults...)
1754
+
1755
+ return results, nil
1756
+ }
1757
+ var REQUIRED_MESSAGE_NAME_28 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1758
+
1759
+ if input.Config.SkipTestsDict != nil {
1760
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_NAME_28"]; skip {
1761
+ return []validationutils.ValidationOutput{}, nil
1762
+ }
1763
+ }
1764
+
1765
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1766
+
1767
+ subResults := make([]validationutils.ValidationOutput, 0)
1768
+ valid := true
1769
+ configureDebugInfo := ""
1770
+ for _, testObjMap := range scope {
1771
+ validationutils.UnusedFunction(testObjMap)
1772
+
1773
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.name", true)
1774
+ validationutils.UnusedFunction(attr)
1775
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
1776
+ validationutils.UnusedFunction(fulfillmentType)
1777
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
1778
+ validationutils.UnusedFunction(fulType)
1779
+
1780
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
1781
+ if skipCheck {
1782
+ continue
1783
+ }
1784
+
1785
+ validate := validationutils.ArePresent(attr)
1786
+
1787
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_NAME_28","attr":"$.message.order.fulfillments[*].end.location.address.name","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
1788
+
1789
+ if !validate {
1790
+ result := validationutils.ValidationOutput{
1791
+ TestName: "REQUIRED_MESSAGE_NAME_28",
1792
+ Valid: false,
1793
+ Code: 30000,
1794
+ Description: `#### **REQUIRED_MESSAGE_NAME_28**
1795
+
1796
+ - $.message.order.fulfillments[*].end.location.address.name must be present in the payload
1797
+
1798
+ > **Skip if:**
1799
+ >
1800
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
1801
+ DebugInfo: &validationutils.DebugInfo{
1802
+ FedConfig: configureDebugInfo,
1803
+ },
1804
+ }
1805
+ return []validationutils.ValidationOutput{result}, nil
1806
+ }
1807
+
1808
+ }
1809
+
1810
+ result := validationutils.ValidationOutput{
1811
+ TestName: "REQUIRED_MESSAGE_NAME_28",
1812
+ Valid: valid,
1813
+ Code: 0,
1814
+ DebugInfo: &validationutils.DebugInfo{
1815
+ FedConfig: configureDebugInfo,
1816
+ },
1817
+ }
1818
+
1819
+ if valid {
1820
+ result.Code = 200
1821
+ } else {
1822
+ result.Code = 30000
1823
+ }
1824
+
1825
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1826
+ results = append(results, result)
1827
+ results = append(results, subResults...)
1828
+
1829
+ return results, nil
1830
+ }
1831
+ var REQUIRED_MESSAGE_BUILDING_29 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1832
+
1833
+ if input.Config.SkipTestsDict != nil {
1834
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_BUILDING_29"]; skip {
1835
+ return []validationutils.ValidationOutput{}, nil
1836
+ }
1837
+ }
1838
+
1839
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1840
+
1841
+ subResults := make([]validationutils.ValidationOutput, 0)
1842
+ valid := true
1843
+ configureDebugInfo := ""
1844
+ for _, testObjMap := range scope {
1845
+ validationutils.UnusedFunction(testObjMap)
1846
+
1847
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.building", true)
1848
+ validationutils.UnusedFunction(attr)
1849
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
1850
+ validationutils.UnusedFunction(fulfillmentType)
1851
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
1852
+ validationutils.UnusedFunction(fulType)
1853
+
1854
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
1855
+ if skipCheck {
1856
+ continue
1857
+ }
1858
+
1859
+ validate := validationutils.ArePresent(attr)
1860
+
1861
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_BUILDING_29","attr":"$.message.order.fulfillments[*].end.location.address.building","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
1862
+
1863
+ if !validate {
1864
+ result := validationutils.ValidationOutput{
1865
+ TestName: "REQUIRED_MESSAGE_BUILDING_29",
1866
+ Valid: false,
1867
+ Code: 30000,
1868
+ Description: `#### **REQUIRED_MESSAGE_BUILDING_29**
1869
+
1870
+ - $.message.order.fulfillments[*].end.location.address.building must be present in the payload
1871
+
1872
+ > **Skip if:**
1873
+ >
1874
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
1875
+ DebugInfo: &validationutils.DebugInfo{
1876
+ FedConfig: configureDebugInfo,
1877
+ },
1878
+ }
1879
+ return []validationutils.ValidationOutput{result}, nil
1880
+ }
1881
+
1882
+ }
1883
+
1884
+ result := validationutils.ValidationOutput{
1885
+ TestName: "REQUIRED_MESSAGE_BUILDING_29",
1886
+ Valid: valid,
1887
+ Code: 0,
1888
+ DebugInfo: &validationutils.DebugInfo{
1889
+ FedConfig: configureDebugInfo,
1890
+ },
1891
+ }
1892
+
1893
+ if valid {
1894
+ result.Code = 200
1895
+ } else {
1896
+ result.Code = 30000
1897
+ }
1898
+
1899
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1900
+ results = append(results, result)
1901
+ results = append(results, subResults...)
1902
+
1903
+ return results, nil
1904
+ }
1905
+ var REQUIRED_MESSAGE_LOCALITY_30 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1906
+
1907
+ if input.Config.SkipTestsDict != nil {
1908
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_LOCALITY_30"]; skip {
1909
+ return []validationutils.ValidationOutput{}, nil
1910
+ }
1911
+ }
1912
+
1913
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1914
+
1915
+ subResults := make([]validationutils.ValidationOutput, 0)
1916
+ valid := true
1917
+ configureDebugInfo := ""
1918
+ for _, testObjMap := range scope {
1919
+ validationutils.UnusedFunction(testObjMap)
1920
+
1921
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.locality", true)
1922
+ validationutils.UnusedFunction(attr)
1923
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
1924
+ validationutils.UnusedFunction(fulfillmentType)
1925
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
1926
+ validationutils.UnusedFunction(fulType)
1927
+
1928
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
1929
+ if skipCheck {
1930
+ continue
1931
+ }
1932
+
1933
+ validate := validationutils.ArePresent(attr)
1934
+
1935
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_LOCALITY_30","attr":"$.message.order.fulfillments[*].end.location.address.locality","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
1936
+
1937
+ if !validate {
1938
+ result := validationutils.ValidationOutput{
1939
+ TestName: "REQUIRED_MESSAGE_LOCALITY_30",
1940
+ Valid: false,
1941
+ Code: 30000,
1942
+ Description: `#### **REQUIRED_MESSAGE_LOCALITY_30**
1943
+
1944
+ - $.message.order.fulfillments[*].end.location.address.locality must be present in the payload
1945
+
1946
+ > **Skip if:**
1947
+ >
1948
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
1949
+ DebugInfo: &validationutils.DebugInfo{
1950
+ FedConfig: configureDebugInfo,
1951
+ },
1952
+ }
1953
+ return []validationutils.ValidationOutput{result}, nil
1954
+ }
1955
+
1956
+ }
1957
+
1958
+ result := validationutils.ValidationOutput{
1959
+ TestName: "REQUIRED_MESSAGE_LOCALITY_30",
1960
+ Valid: valid,
1961
+ Code: 0,
1962
+ DebugInfo: &validationutils.DebugInfo{
1963
+ FedConfig: configureDebugInfo,
1964
+ },
1965
+ }
1966
+
1967
+ if valid {
1968
+ result.Code = 200
1969
+ } else {
1970
+ result.Code = 30000
1971
+ }
1972
+
1973
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
1974
+ results = append(results, result)
1975
+ results = append(results, subResults...)
1976
+
1977
+ return results, nil
1978
+ }
1979
+ var REQUIRED_MESSAGE_CITY_31 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
1980
+
1981
+ if input.Config.SkipTestsDict != nil {
1982
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_CITY_31"]; skip {
1983
+ return []validationutils.ValidationOutput{}, nil
1984
+ }
1985
+ }
1986
+
1987
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
1988
+
1989
+ subResults := make([]validationutils.ValidationOutput, 0)
1990
+ valid := true
1991
+ configureDebugInfo := ""
1992
+ for _, testObjMap := range scope {
1993
+ validationutils.UnusedFunction(testObjMap)
1994
+
1995
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.city", true)
1996
+ validationutils.UnusedFunction(attr)
1997
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
1998
+ validationutils.UnusedFunction(fulfillmentType)
1999
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
2000
+ validationutils.UnusedFunction(fulType)
2001
+
2002
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
2003
+ if skipCheck {
2004
+ continue
2005
+ }
2006
+
2007
+ validate := validationutils.ArePresent(attr)
2008
+
2009
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_CITY_31","attr":"$.message.order.fulfillments[*].end.location.address.city","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
2010
+
2011
+ if !validate {
2012
+ result := validationutils.ValidationOutput{
2013
+ TestName: "REQUIRED_MESSAGE_CITY_31",
2014
+ Valid: false,
2015
+ Code: 30000,
2016
+ Description: `#### **REQUIRED_MESSAGE_CITY_31**
2017
+
2018
+ - $.message.order.fulfillments[*].end.location.address.city must be present in the payload
2019
+
2020
+ > **Skip if:**
2021
+ >
2022
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
2023
+ DebugInfo: &validationutils.DebugInfo{
2024
+ FedConfig: configureDebugInfo,
2025
+ },
2026
+ }
2027
+ return []validationutils.ValidationOutput{result}, nil
2028
+ }
2029
+
2030
+ }
2031
+
2032
+ result := validationutils.ValidationOutput{
2033
+ TestName: "REQUIRED_MESSAGE_CITY_31",
2034
+ Valid: valid,
2035
+ Code: 0,
2036
+ DebugInfo: &validationutils.DebugInfo{
2037
+ FedConfig: configureDebugInfo,
2038
+ },
2039
+ }
2040
+
2041
+ if valid {
2042
+ result.Code = 200
2043
+ } else {
2044
+ result.Code = 30000
2045
+ }
2046
+
2047
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2048
+ results = append(results, result)
2049
+ results = append(results, subResults...)
2050
+
2051
+ return results, nil
2052
+ }
2053
+ var REQUIRED_MESSAGE_STATE_32 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2054
+
2055
+ if input.Config.SkipTestsDict != nil {
2056
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_STATE_32"]; skip {
2057
+ return []validationutils.ValidationOutput{}, nil
2058
+ }
2059
+ }
2060
+
2061
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2062
+
2063
+ subResults := make([]validationutils.ValidationOutput, 0)
2064
+ valid := true
2065
+ configureDebugInfo := ""
2066
+ for _, testObjMap := range scope {
2067
+ validationutils.UnusedFunction(testObjMap)
2068
+
2069
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.state", true)
2070
+ validationutils.UnusedFunction(attr)
2071
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
2072
+ validationutils.UnusedFunction(fulfillmentType)
2073
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
2074
+ validationutils.UnusedFunction(fulType)
2075
+
2076
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
2077
+ if skipCheck {
2078
+ continue
2079
+ }
2080
+
2081
+ validate := validationutils.ArePresent(attr)
2082
+
2083
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_STATE_32","attr":"$.message.order.fulfillments[*].end.location.address.state","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
2084
+
2085
+ if !validate {
2086
+ result := validationutils.ValidationOutput{
2087
+ TestName: "REQUIRED_MESSAGE_STATE_32",
2088
+ Valid: false,
2089
+ Code: 30000,
2090
+ Description: `#### **REQUIRED_MESSAGE_STATE_32**
2091
+
2092
+ - $.message.order.fulfillments[*].end.location.address.state must be present in the payload
2093
+
2094
+ > **Skip if:**
2095
+ >
2096
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
2097
+ DebugInfo: &validationutils.DebugInfo{
2098
+ FedConfig: configureDebugInfo,
2099
+ },
2100
+ }
2101
+ return []validationutils.ValidationOutput{result}, nil
2102
+ }
2103
+
2104
+ }
2105
+
2106
+ result := validationutils.ValidationOutput{
2107
+ TestName: "REQUIRED_MESSAGE_STATE_32",
2108
+ Valid: valid,
2109
+ Code: 0,
2110
+ DebugInfo: &validationutils.DebugInfo{
2111
+ FedConfig: configureDebugInfo,
2112
+ },
2113
+ }
2114
+
2115
+ if valid {
2116
+ result.Code = 200
2117
+ } else {
2118
+ result.Code = 30000
2119
+ }
2120
+
2121
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2122
+ results = append(results, result)
2123
+ results = append(results, subResults...)
2124
+
2125
+ return results, nil
2126
+ }
2127
+ var REQUIRED_MESSAGE_COUNTRY_33 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2128
+
2129
+ if input.Config.SkipTestsDict != nil {
2130
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_COUNTRY_33"]; skip {
2131
+ return []validationutils.ValidationOutput{}, nil
2132
+ }
2133
+ }
2134
+
2135
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2136
+
2137
+ subResults := make([]validationutils.ValidationOutput, 0)
2138
+ valid := true
2139
+ configureDebugInfo := ""
2140
+ for _, testObjMap := range scope {
2141
+ validationutils.UnusedFunction(testObjMap)
2142
+
2143
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.country", true)
2144
+ validationutils.UnusedFunction(attr)
2145
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
2146
+ validationutils.UnusedFunction(fulfillmentType)
2147
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
2148
+ validationutils.UnusedFunction(fulType)
2149
+
2150
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
2151
+ if skipCheck {
2152
+ continue
2153
+ }
2154
+
2155
+ validate := validationutils.ArePresent(attr)
2156
+
2157
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_COUNTRY_33","attr":"$.message.order.fulfillments[*].end.location.address.country","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
2158
+
2159
+ if !validate {
2160
+ result := validationutils.ValidationOutput{
2161
+ TestName: "REQUIRED_MESSAGE_COUNTRY_33",
2162
+ Valid: false,
2163
+ Code: 30000,
2164
+ Description: `#### **REQUIRED_MESSAGE_COUNTRY_33**
2165
+
2166
+ - $.message.order.fulfillments[*].end.location.address.country must be present in the payload
2167
+
2168
+ > **Skip if:**
2169
+ >
2170
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
2171
+ DebugInfo: &validationutils.DebugInfo{
2172
+ FedConfig: configureDebugInfo,
2173
+ },
2174
+ }
2175
+ return []validationutils.ValidationOutput{result}, nil
2176
+ }
2177
+
2178
+ }
2179
+
2180
+ result := validationutils.ValidationOutput{
2181
+ TestName: "REQUIRED_MESSAGE_COUNTRY_33",
2182
+ Valid: valid,
2183
+ Code: 0,
2184
+ DebugInfo: &validationutils.DebugInfo{
2185
+ FedConfig: configureDebugInfo,
2186
+ },
2187
+ }
2188
+
2189
+ if valid {
2190
+ result.Code = 200
2191
+ } else {
2192
+ result.Code = 30000
2193
+ }
2194
+
2195
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2196
+ results = append(results, result)
2197
+ results = append(results, subResults...)
2198
+
2199
+ return results, nil
2200
+ }
2201
+ var REQUIRED_MESSAGE_AREA_CODE_34 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2202
+
2203
+ if input.Config.SkipTestsDict != nil {
2204
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_AREA_CODE_34"]; skip {
2205
+ return []validationutils.ValidationOutput{}, nil
2206
+ }
2207
+ }
2208
+
2209
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2210
+
2211
+ subResults := make([]validationutils.ValidationOutput, 0)
2212
+ valid := true
2213
+ configureDebugInfo := ""
2214
+ for _, testObjMap := range scope {
2215
+ validationutils.UnusedFunction(testObjMap)
2216
+
2217
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.location.address.area_code", true)
2218
+ validationutils.UnusedFunction(attr)
2219
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
2220
+ validationutils.UnusedFunction(fulfillmentType)
2221
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
2222
+ validationutils.UnusedFunction(fulType)
2223
+
2224
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
2225
+ if skipCheck {
2226
+ continue
2227
+ }
2228
+
2229
+ validate := validationutils.ArePresent(attr)
2230
+
2231
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_AREA_CODE_34","attr":"$.message.order.fulfillments[*].end.location.address.area_code","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
2232
+
2233
+ if !validate {
2234
+ result := validationutils.ValidationOutput{
2235
+ TestName: "REQUIRED_MESSAGE_AREA_CODE_34",
2236
+ Valid: false,
2237
+ Code: 30000,
2238
+ Description: `#### **REQUIRED_MESSAGE_AREA_CODE_34**
2239
+
2240
+ - $.message.order.fulfillments[*].end.location.address.area_code must be present in the payload
2241
+
2242
+ > **Skip if:**
2243
+ >
2244
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
2245
+ DebugInfo: &validationutils.DebugInfo{
2246
+ FedConfig: configureDebugInfo,
2247
+ },
2248
+ }
2249
+ return []validationutils.ValidationOutput{result}, nil
2250
+ }
2251
+
2252
+ }
2253
+
2254
+ result := validationutils.ValidationOutput{
2255
+ TestName: "REQUIRED_MESSAGE_AREA_CODE_34",
2256
+ Valid: valid,
2257
+ Code: 0,
2258
+ DebugInfo: &validationutils.DebugInfo{
2259
+ FedConfig: configureDebugInfo,
2260
+ },
2261
+ }
2262
+
2263
+ if valid {
2264
+ result.Code = 200
2265
+ } else {
2266
+ result.Code = 30000
2267
+ }
2268
+
2269
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2270
+ results = append(results, result)
2271
+ results = append(results, subResults...)
2272
+
2273
+ return results, nil
2274
+ }
2275
+ var REQUIRED_MESSAGE_PHONE_35 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2276
+
2277
+ if input.Config.SkipTestsDict != nil {
2278
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_PHONE_35"]; skip {
2279
+ return []validationutils.ValidationOutput{}, nil
2280
+ }
2281
+ }
2282
+
2283
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2284
+
2285
+ subResults := make([]validationutils.ValidationOutput, 0)
2286
+ valid := true
2287
+ configureDebugInfo := ""
2288
+ for _, testObjMap := range scope {
2289
+ validationutils.UnusedFunction(testObjMap)
2290
+
2291
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.contact.phone", true)
2292
+ validationutils.UnusedFunction(attr)
2293
+ fulfillmentType := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
2294
+ validationutils.UnusedFunction(fulfillmentType)
2295
+ fulType := validationutils.StringSliceToInterface([]string{`Delivery`})
2296
+ validationutils.UnusedFunction(fulType)
2297
+
2298
+ skipCheck := !(validationutils.AllIn(fulfillmentType, fulType))
2299
+ if skipCheck {
2300
+ continue
2301
+ }
2302
+
2303
+ validate := validationutils.ArePresent(attr)
2304
+
2305
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_PHONE_35","attr":"$.message.order.fulfillments[*].end.contact.phone","fulfillmentType":"$.message.order.fulfillments[*].type","fulType":["Delivery"],"_CONTINUE_":"!(fulfillmentType all in fulType)","_RETURN_":"attr are present"}`
2306
+
2307
+ if !validate {
2308
+ result := validationutils.ValidationOutput{
2309
+ TestName: "REQUIRED_MESSAGE_PHONE_35",
2310
+ Valid: false,
2311
+ Code: 30000,
2312
+ Description: `#### **REQUIRED_MESSAGE_PHONE_35**
2313
+
2314
+ - $.message.order.fulfillments[*].end.contact.phone must be present in the payload
2315
+
2316
+ > **Skip if:**
2317
+ >
2318
+ > - not all elements of $.message.order.fulfillments[*].type are in ["Delivery"]`,
2319
+ DebugInfo: &validationutils.DebugInfo{
2320
+ FedConfig: configureDebugInfo,
2321
+ },
2322
+ }
2323
+ return []validationutils.ValidationOutput{result}, nil
2324
+ }
2325
+
2326
+ }
2327
+
2328
+ result := validationutils.ValidationOutput{
2329
+ TestName: "REQUIRED_MESSAGE_PHONE_35",
2330
+ Valid: valid,
2331
+ Code: 0,
2332
+ DebugInfo: &validationutils.DebugInfo{
2333
+ FedConfig: configureDebugInfo,
2334
+ },
2335
+ }
2336
+
2337
+ if valid {
2338
+ result.Code = 200
2339
+ } else {
2340
+ result.Code = 30000
2341
+ }
2342
+
2343
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2344
+ results = append(results, result)
2345
+ results = append(results, subResults...)
2346
+
2347
+ return results, nil
2348
+ }
2349
+ var REQUIRED_MESSAGE_CURRENCY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2350
+
2351
+ if input.Config.SkipTestsDict != nil {
2352
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_CURRENCY"]; skip {
2353
+ return []validationutils.ValidationOutput{}, nil
2354
+ }
2355
+ }
2356
+
2357
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2358
+
2359
+ subResults := make([]validationutils.ValidationOutput, 0)
2360
+ valid := true
2361
+ configureDebugInfo := ""
2362
+ for _, testObjMap := range scope {
2363
+ validationutils.UnusedFunction(testObjMap)
2364
+
2365
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.price.currency", true)
2366
+ validationutils.UnusedFunction(attr)
2367
+
2368
+ validate := validationutils.ArePresent(attr)
2369
+
2370
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_CURRENCY","attr":"$.message.order.quote.price.currency","_RETURN_":"attr are present"}`
2371
+
2372
+ if !validate {
2373
+ result := validationutils.ValidationOutput{
2374
+ TestName: "REQUIRED_MESSAGE_CURRENCY",
2375
+ Valid: false,
2376
+ Code: 30000,
2377
+ Description: `#### **REQUIRED_MESSAGE_CURRENCY**
2378
+
2379
+ - $.message.order.quote.price.currency must be present in the payload`,
2380
+ DebugInfo: &validationutils.DebugInfo{
2381
+ FedConfig: configureDebugInfo,
2382
+ },
2383
+ }
2384
+ return []validationutils.ValidationOutput{result}, nil
2385
+ }
2386
+
2387
+ }
2388
+
2389
+ result := validationutils.ValidationOutput{
2390
+ TestName: "REQUIRED_MESSAGE_CURRENCY",
2391
+ Valid: valid,
2392
+ Code: 0,
2393
+ DebugInfo: &validationutils.DebugInfo{
2394
+ FedConfig: configureDebugInfo,
2395
+ },
2396
+ }
2397
+
2398
+ if valid {
2399
+ result.Code = 200
2400
+ } else {
2401
+ result.Code = 30000
2402
+ }
2403
+
2404
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2405
+ results = append(results, result)
2406
+ results = append(results, subResults...)
2407
+
2408
+ return results, nil
2409
+ }
2410
+ var REQUIRED_MESSAGE_VALUE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2411
+
2412
+ if input.Config.SkipTestsDict != nil {
2413
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_VALUE"]; skip {
2414
+ return []validationutils.ValidationOutput{}, nil
2415
+ }
2416
+ }
2417
+
2418
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2419
+
2420
+ subResults := make([]validationutils.ValidationOutput, 0)
2421
+ valid := true
2422
+ configureDebugInfo := ""
2423
+ for _, testObjMap := range scope {
2424
+ validationutils.UnusedFunction(testObjMap)
2425
+
2426
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.price.value", true)
2427
+ validationutils.UnusedFunction(attr)
2428
+
2429
+ validate := validationutils.ArePresent(attr)
2430
+
2431
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_VALUE","attr":"$.message.order.quote.price.value","_RETURN_":"attr are present"}`
2432
+
2433
+ if !validate {
2434
+ result := validationutils.ValidationOutput{
2435
+ TestName: "REQUIRED_MESSAGE_VALUE",
2436
+ Valid: false,
2437
+ Code: 30000,
2438
+ Description: `#### **REQUIRED_MESSAGE_VALUE**
2439
+
2440
+ - $.message.order.quote.price.value must be present in the payload`,
2441
+ DebugInfo: &validationutils.DebugInfo{
2442
+ FedConfig: configureDebugInfo,
2443
+ },
2444
+ }
2445
+ return []validationutils.ValidationOutput{result}, nil
2446
+ }
2447
+
2448
+ }
2449
+
2450
+ result := validationutils.ValidationOutput{
2451
+ TestName: "REQUIRED_MESSAGE_VALUE",
2452
+ Valid: valid,
2453
+ Code: 0,
2454
+ DebugInfo: &validationutils.DebugInfo{
2455
+ FedConfig: configureDebugInfo,
2456
+ },
2457
+ }
2458
+
2459
+ if valid {
2460
+ result.Code = 200
2461
+ } else {
2462
+ result.Code = 30000
2463
+ }
2464
+
2465
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2466
+ results = append(results, result)
2467
+ results = append(results, subResults...)
2468
+
2469
+ return results, nil
2470
+ }
2471
+ var REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2472
+
2473
+ if input.Config.SkipTestsDict != nil {
2474
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID"]; skip {
2475
+ return []validationutils.ValidationOutput{}, nil
2476
+ }
2477
+ }
2478
+
2479
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2480
+
2481
+ subResults := make([]validationutils.ValidationOutput, 0)
2482
+ valid := true
2483
+ configureDebugInfo := ""
2484
+ for _, testObjMap := range scope {
2485
+ validationutils.UnusedFunction(testObjMap)
2486
+
2487
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.breakup[*]['@ondc/org/item_id']", true)
2488
+ validationutils.UnusedFunction(attr)
2489
+
2490
+ validate := validationutils.ArePresent(attr)
2491
+
2492
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID","attr":"$.message.order.quote.breakup[*]['@ondc/org/item_id']","_RETURN_":"attr are present"}`
2493
+
2494
+ if !validate {
2495
+ result := validationutils.ValidationOutput{
2496
+ TestName: "REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID",
2497
+ Valid: false,
2498
+ Code: 30000,
2499
+ Description: `#### **REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID**
2500
+
2501
+ - $.message.order.quote.breakup[*]['@ondc/org/item_id'] must be present in the payload`,
2502
+ DebugInfo: &validationutils.DebugInfo{
2503
+ FedConfig: configureDebugInfo,
2504
+ },
2505
+ }
2506
+ return []validationutils.ValidationOutput{result}, nil
2507
+ }
2508
+
2509
+ }
2510
+
2511
+ result := validationutils.ValidationOutput{
2512
+ TestName: "REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID",
2513
+ Valid: valid,
2514
+ Code: 0,
2515
+ DebugInfo: &validationutils.DebugInfo{
2516
+ FedConfig: configureDebugInfo,
2517
+ },
2518
+ }
2519
+
2520
+ if valid {
2521
+ result.Code = 200
2522
+ } else {
2523
+ result.Code = 30000
2524
+ }
2525
+
2526
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2527
+ results = append(results, result)
2528
+ results = append(results, subResults...)
2529
+
2530
+ return results, nil
2531
+ }
2532
+ var REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2533
+
2534
+ if input.Config.SkipTestsDict != nil {
2535
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE"]; skip {
2536
+ return []validationutils.ValidationOutput{}, nil
2537
+ }
2538
+ }
2539
+
2540
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2541
+
2542
+ subResults := make([]validationutils.ValidationOutput, 0)
2543
+ valid := true
2544
+ configureDebugInfo := ""
2545
+ for _, testObjMap := range scope {
2546
+ validationutils.UnusedFunction(testObjMap)
2547
+
2548
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.breakup[*]['@ondc/org/title_type']", true)
2549
+ validationutils.UnusedFunction(attr)
2550
+ enumList := validationutils.StringSliceToInterface([]string{`delivery`, `rto`, `tax`, `diff`, `tax_diff`, `discount`, `cod`, `surge`, `insurance`})
2551
+ validationutils.UnusedFunction(enumList)
2552
+
2553
+ validate := (validationutils.ArePresent(attr)) && (validationutils.AllIn(attr, enumList))
2554
+
2555
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE","attr":"$.message.order.quote.breakup[*]['@ondc/org/title_type']","_RETURN_":"attr are present && attr all in enumList","enumList":["delivery","rto","tax","diff","tax_diff","discount","cod","surge","insurance"]}`
2556
+
2557
+ if !validate {
2558
+ result := validationutils.ValidationOutput{
2559
+ TestName: "REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE",
2560
+ Valid: false,
2561
+ Code: 30000,
2562
+ Description: `#### **REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE**
2563
+
2564
+ **All of the following must be true:**
2565
+ - $.message.order.quote.breakup[*]['@ondc/org/title_type'] must be present in the payload
2566
+ - All elements of $.message.order.quote.breakup[*]['@ondc/org/title_type'] must be in ["delivery", "rto", "tax", "diff", "tax_diff", "discount", "cod", "surge", "insurance"]`,
2567
+ DebugInfo: &validationutils.DebugInfo{
2568
+ FedConfig: configureDebugInfo,
2569
+ },
2570
+ }
2571
+ return []validationutils.ValidationOutput{result}, nil
2572
+ }
2573
+
2574
+ }
2575
+
2576
+ result := validationutils.ValidationOutput{
2577
+ TestName: "REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE",
2578
+ Valid: valid,
2579
+ Code: 0,
2580
+ DebugInfo: &validationutils.DebugInfo{
2581
+ FedConfig: configureDebugInfo,
2582
+ },
2583
+ }
2584
+
2585
+ if valid {
2586
+ result.Code = 200
2587
+ } else {
2588
+ result.Code = 30000
2589
+ }
2590
+
2591
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2592
+ results = append(results, result)
2593
+ results = append(results, subResults...)
2594
+
2595
+ return results, nil
2596
+ }
2597
+ var REQUIRED_MESSAGE_CURRENCY_40 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2598
+
2599
+ if input.Config.SkipTestsDict != nil {
2600
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_CURRENCY_40"]; skip {
2601
+ return []validationutils.ValidationOutput{}, nil
2602
+ }
2603
+ }
2604
+
2605
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2606
+
2607
+ subResults := make([]validationutils.ValidationOutput, 0)
2608
+ valid := true
2609
+ configureDebugInfo := ""
2610
+ for _, testObjMap := range scope {
2611
+ validationutils.UnusedFunction(testObjMap)
2612
+
2613
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.breakup[*].price.currency", true)
2614
+ validationutils.UnusedFunction(attr)
2615
+
2616
+ validate := validationutils.ArePresent(attr)
2617
+
2618
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_CURRENCY_40","attr":"$.message.order.quote.breakup[*].price.currency","_RETURN_":"attr are present"}`
2619
+
2620
+ if !validate {
2621
+ result := validationutils.ValidationOutput{
2622
+ TestName: "REQUIRED_MESSAGE_CURRENCY_40",
2623
+ Valid: false,
2624
+ Code: 30000,
2625
+ Description: `#### **REQUIRED_MESSAGE_CURRENCY_40**
2626
+
2627
+ - $.message.order.quote.breakup[*].price.currency must be present in the payload`,
2628
+ DebugInfo: &validationutils.DebugInfo{
2629
+ FedConfig: configureDebugInfo,
2630
+ },
2631
+ }
2632
+ return []validationutils.ValidationOutput{result}, nil
2633
+ }
2634
+
2635
+ }
2636
+
2637
+ result := validationutils.ValidationOutput{
2638
+ TestName: "REQUIRED_MESSAGE_CURRENCY_40",
2639
+ Valid: valid,
2640
+ Code: 0,
2641
+ DebugInfo: &validationutils.DebugInfo{
2642
+ FedConfig: configureDebugInfo,
2643
+ },
2644
+ }
2645
+
2646
+ if valid {
2647
+ result.Code = 200
2648
+ } else {
2649
+ result.Code = 30000
2650
+ }
2651
+
2652
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2653
+ results = append(results, result)
2654
+ results = append(results, subResults...)
2655
+
2656
+ return results, nil
2657
+ }
2658
+ var REQUIRED_MESSAGE_VALUE_41 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2659
+
2660
+ if input.Config.SkipTestsDict != nil {
2661
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_VALUE_41"]; skip {
2662
+ return []validationutils.ValidationOutput{}, nil
2663
+ }
2664
+ }
2665
+
2666
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2667
+
2668
+ subResults := make([]validationutils.ValidationOutput, 0)
2669
+ valid := true
2670
+ configureDebugInfo := ""
2671
+ for _, testObjMap := range scope {
2672
+ validationutils.UnusedFunction(testObjMap)
2673
+
2674
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.breakup[*].price.value", true)
2675
+ validationutils.UnusedFunction(attr)
2676
+
2677
+ validate := validationutils.ArePresent(attr)
2678
+
2679
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_VALUE_41","attr":"$.message.order.quote.breakup[*].price.value","_RETURN_":"attr are present"}`
2680
+
2681
+ if !validate {
2682
+ result := validationutils.ValidationOutput{
2683
+ TestName: "REQUIRED_MESSAGE_VALUE_41",
2684
+ Valid: false,
2685
+ Code: 30000,
2686
+ Description: `#### **REQUIRED_MESSAGE_VALUE_41**
2687
+
2688
+ - $.message.order.quote.breakup[*].price.value must be present in the payload`,
2689
+ DebugInfo: &validationutils.DebugInfo{
2690
+ FedConfig: configureDebugInfo,
2691
+ },
2692
+ }
2693
+ return []validationutils.ValidationOutput{result}, nil
2694
+ }
2695
+
2696
+ }
2697
+
2698
+ result := validationutils.ValidationOutput{
2699
+ TestName: "REQUIRED_MESSAGE_VALUE_41",
2700
+ Valid: valid,
2701
+ Code: 0,
2702
+ DebugInfo: &validationutils.DebugInfo{
2703
+ FedConfig: configureDebugInfo,
2704
+ },
2705
+ }
2706
+
2707
+ if valid {
2708
+ result.Code = 200
2709
+ } else {
2710
+ result.Code = 30000
2711
+ }
2712
+
2713
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2714
+ results = append(results, result)
2715
+ results = append(results, subResults...)
2716
+
2717
+ return results, nil
2718
+ }
2719
+ var REQUIRED_MESSAGE_TTL = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2720
+
2721
+ if input.Config.SkipTestsDict != nil {
2722
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_TTL"]; skip {
2723
+ return []validationutils.ValidationOutput{}, nil
2724
+ }
2725
+ }
2726
+
2727
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2728
+
2729
+ subResults := make([]validationutils.ValidationOutput, 0)
2730
+ valid := true
2731
+ configureDebugInfo := ""
2732
+ for _, testObjMap := range scope {
2733
+ validationutils.UnusedFunction(testObjMap)
2734
+
2735
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.ttl", true)
2736
+ validationutils.UnusedFunction(attr)
2737
+
2738
+ validate := validationutils.ArePresent(attr)
2739
+
2740
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_TTL","attr":"$.message.order.quote.ttl","_RETURN_":"attr are present"}`
2741
+
2742
+ if !validate {
2743
+ result := validationutils.ValidationOutput{
2744
+ TestName: "REQUIRED_MESSAGE_TTL",
2745
+ Valid: false,
2746
+ Code: 30000,
2747
+ Description: `#### **REQUIRED_MESSAGE_TTL**
2748
+
2749
+ - $.message.order.quote.ttl must be present in the payload`,
2750
+ DebugInfo: &validationutils.DebugInfo{
2751
+ FedConfig: configureDebugInfo,
2752
+ },
2753
+ }
2754
+ return []validationutils.ValidationOutput{result}, nil
2755
+ }
2756
+
2757
+ }
2758
+
2759
+ result := validationutils.ValidationOutput{
2760
+ TestName: "REQUIRED_MESSAGE_TTL",
2761
+ Valid: valid,
2762
+ Code: 0,
2763
+ DebugInfo: &validationutils.DebugInfo{
2764
+ FedConfig: configureDebugInfo,
2765
+ },
2766
+ }
2767
+
2768
+ if valid {
2769
+ result.Code = 200
2770
+ } else {
2771
+ result.Code = 30000
2772
+ }
2773
+
2774
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2775
+ results = append(results, result)
2776
+ results = append(results, subResults...)
2777
+
2778
+ return results, nil
2779
+ }
2780
+ var REQUIRED_MESSAGE_TYPE_43 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2781
+
2782
+ if input.Config.SkipTestsDict != nil {
2783
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_TYPE_43"]; skip {
2784
+ return []validationutils.ValidationOutput{}, nil
2785
+ }
2786
+ }
2787
+
2788
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2789
+
2790
+ subResults := make([]validationutils.ValidationOutput, 0)
2791
+ valid := true
2792
+ configureDebugInfo := ""
2793
+ for _, testObjMap := range scope {
2794
+ validationutils.UnusedFunction(testObjMap)
2795
+
2796
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.payment.type", true)
2797
+ validationutils.UnusedFunction(attr)
2798
+ enumList := validationutils.StringSliceToInterface([]string{`ON-ORDER`, `ON-FULFILLMENT`, `POST-FULFILLMENT`})
2799
+ validationutils.UnusedFunction(enumList)
2800
+
2801
+ skipCheck := !(validationutils.ArePresent(attr))
2802
+ if skipCheck {
2803
+ continue
2804
+ }
2805
+
2806
+ validate := (validationutils.ArePresent(attr)) && (validationutils.AllIn(attr, enumList))
2807
+
2808
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_TYPE_43","attr":"$.message.order.payment.type","_RETURN_":"attr are present && attr all in enumList","_CONTINUE_":"!(attr are present)","enumList":["ON-ORDER","ON-FULFILLMENT","POST-FULFILLMENT"]}`
2809
+
2810
+ if !validate {
2811
+ result := validationutils.ValidationOutput{
2812
+ TestName: "REQUIRED_MESSAGE_TYPE_43",
2813
+ Valid: false,
2814
+ Code: 30000,
2815
+ Description: `#### **REQUIRED_MESSAGE_TYPE_43**
2816
+
2817
+ **All of the following must be true:**
2818
+ - $.message.order.payment.type must be present in the payload
2819
+ - All elements of $.message.order.payment.type must be in ["ON-ORDER", "ON-FULFILLMENT", "POST-FULFILLMENT"]
2820
+
2821
+ > **Skip if:**
2822
+ >
2823
+ > - $.message.order.payment.type is not in the payload`,
2824
+ DebugInfo: &validationutils.DebugInfo{
2825
+ FedConfig: configureDebugInfo,
2826
+ },
2827
+ }
2828
+ return []validationutils.ValidationOutput{result}, nil
2829
+ }
2830
+
2831
+ }
2832
+
2833
+ result := validationutils.ValidationOutput{
2834
+ TestName: "REQUIRED_MESSAGE_TYPE_43",
2835
+ Valid: valid,
2836
+ Code: 0,
2837
+ DebugInfo: &validationutils.DebugInfo{
2838
+ FedConfig: configureDebugInfo,
2839
+ },
2840
+ }
2841
+
2842
+ if valid {
2843
+ result.Code = 200
2844
+ } else {
2845
+ result.Code = 30000
2846
+ }
2847
+
2848
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2849
+ results = append(results, result)
2850
+ results = append(results, subResults...)
2851
+
2852
+ return results, nil
2853
+ }
2854
+ var REQUIRED_MESSAGE_COLLECTED_BY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2855
+
2856
+ if input.Config.SkipTestsDict != nil {
2857
+ if _, skip := input.Config.SkipTestsDict["REQUIRED_MESSAGE_COLLECTED_BY"]; skip {
2858
+ return []validationutils.ValidationOutput{}, nil
2859
+ }
2860
+ }
2861
+
2862
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2863
+
2864
+ subResults := make([]validationutils.ValidationOutput, 0)
2865
+ valid := true
2866
+ configureDebugInfo := ""
2867
+ for _, testObjMap := range scope {
2868
+ validationutils.UnusedFunction(testObjMap)
2869
+
2870
+ attr := validationutils.GetJsonPath(testObjMap, "$.message.order.payment.collected_by", true)
2871
+ validationutils.UnusedFunction(attr)
2872
+
2873
+ skipCheck := !(validationutils.ArePresent(attr))
2874
+ if skipCheck {
2875
+ continue
2876
+ }
2877
+
2878
+ validate := validationutils.ArePresent(attr)
2879
+
2880
+ configureDebugInfo = `{"_NAME_":"REQUIRED_MESSAGE_COLLECTED_BY","attr":"$.message.order.payment.collected_by","_RETURN_":"attr are present","_CONTINUE_":"!(attr are present)"}`
2881
+
2882
+ if !validate {
2883
+ result := validationutils.ValidationOutput{
2884
+ TestName: "REQUIRED_MESSAGE_COLLECTED_BY",
2885
+ Valid: false,
2886
+ Code: 30000,
2887
+ Description: `#### **REQUIRED_MESSAGE_COLLECTED_BY**
2888
+
2889
+ - $.message.order.payment.collected_by must be present in the payload
2890
+
2891
+ > **Skip if:**
2892
+ >
2893
+ > - $.message.order.payment.collected_by is not in the payload`,
2894
+ DebugInfo: &validationutils.DebugInfo{
2895
+ FedConfig: configureDebugInfo,
2896
+ },
2897
+ }
2898
+ return []validationutils.ValidationOutput{result}, nil
2899
+ }
2900
+
2901
+ }
2902
+
2903
+ result := validationutils.ValidationOutput{
2904
+ TestName: "REQUIRED_MESSAGE_COLLECTED_BY",
2905
+ Valid: valid,
2906
+ Code: 0,
2907
+ DebugInfo: &validationutils.DebugInfo{
2908
+ FedConfig: configureDebugInfo,
2909
+ },
2910
+ }
2911
+
2912
+ if valid {
2913
+ result.Code = 200
2914
+ } else {
2915
+ result.Code = 30000
2916
+ }
2917
+
2918
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2919
+ results = append(results, result)
2920
+ results = append(results, subResults...)
2921
+
2922
+ return results, nil
2923
+ }
2924
+ var VALID_ENUM_CONTEXT_DOMAIN = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2925
+
2926
+ if input.Config.SkipTestsDict != nil {
2927
+ if _, skip := input.Config.SkipTestsDict["VALID_ENUM_CONTEXT_DOMAIN"]; skip {
2928
+ return []validationutils.ValidationOutput{}, nil
2929
+ }
2930
+ }
2931
+
2932
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
2933
+
2934
+ subResults := make([]validationutils.ValidationOutput, 0)
2935
+ valid := true
2936
+ configureDebugInfo := ""
2937
+ for _, testObjMap := range scope {
2938
+ validationutils.UnusedFunction(testObjMap)
2939
+
2940
+ enumList := validationutils.StringSliceToInterface([]string{`ONDC:LOG10`, `ONDC:LOG11`, `nic2004:60232`})
2941
+ validationutils.UnusedFunction(enumList)
2942
+ enumPath := validationutils.GetJsonPath(testObjMap, "$.context.domain", true)
2943
+ validationutils.UnusedFunction(enumPath)
2944
+
2945
+ skipCheck := !(validationutils.ArePresent(enumPath))
2946
+ if skipCheck {
2947
+ continue
2948
+ }
2949
+
2950
+ validate := validationutils.AllIn(enumPath, enumList)
2951
+
2952
+ configureDebugInfo = `{"_NAME_":"VALID_ENUM_CONTEXT_DOMAIN","enumList":["ONDC:LOG10","ONDC:LOG11","nic2004:60232"],"enumPath":"$.context.domain","_CONTINUE_":"!(enumPath are present)","_RETURN_":"enumPath all in enumList"}`
2953
+
2954
+ if !validate {
2955
+ result := validationutils.ValidationOutput{
2956
+ TestName: "VALID_ENUM_CONTEXT_DOMAIN",
2957
+ Valid: false,
2958
+ Code: 30000,
2959
+ Description: `#### **VALID_ENUM_CONTEXT_DOMAIN**
2960
+
2961
+ - All elements of $.context.domain must be in ["ONDC:LOG10", "ONDC:LOG11", "nic2004:60232"]
2962
+
2963
+ > **Skip if:**
2964
+ >
2965
+ > - $.context.domain is not in the payload`,
2966
+ DebugInfo: &validationutils.DebugInfo{
2967
+ FedConfig: configureDebugInfo,
2968
+ },
2969
+ }
2970
+ return []validationutils.ValidationOutput{result}, nil
2971
+ }
2972
+
2973
+ }
2974
+
2975
+ result := validationutils.ValidationOutput{
2976
+ TestName: "VALID_ENUM_CONTEXT_DOMAIN",
2977
+ Valid: valid,
2978
+ Code: 0,
2979
+ DebugInfo: &validationutils.DebugInfo{
2980
+ FedConfig: configureDebugInfo,
2981
+ },
2982
+ }
2983
+
2984
+ if valid {
2985
+ result.Code = 200
2986
+ } else {
2987
+ result.Code = 30000
2988
+ }
2989
+
2990
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
2991
+ results = append(results, result)
2992
+ results = append(results, subResults...)
2993
+
2994
+ return results, nil
2995
+ }
2996
+ var VALID_ENUM_MESSAGE_TYPE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
2997
+
2998
+ if input.Config.SkipTestsDict != nil {
2999
+ if _, skip := input.Config.SkipTestsDict["VALID_ENUM_MESSAGE_TYPE"]; skip {
3000
+ return []validationutils.ValidationOutput{}, nil
3001
+ }
3002
+ }
3003
+
3004
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3005
+
3006
+ subResults := make([]validationutils.ValidationOutput, 0)
3007
+ valid := true
3008
+ configureDebugInfo := ""
3009
+ for _, testObjMap := range scope {
3010
+ validationutils.UnusedFunction(testObjMap)
3011
+
3012
+ enumList := validationutils.StringSliceToInterface([]string{`Delivery`, `Return`, `Batch`, `RTO`, `FTL`, `PTL`, `FIFO`})
3013
+ validationutils.UnusedFunction(enumList)
3014
+ enumPath := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].type", true)
3015
+ validationutils.UnusedFunction(enumPath)
3016
+
3017
+ skipCheck := !(validationutils.ArePresent(enumPath))
3018
+ if skipCheck {
3019
+ continue
3020
+ }
3021
+
3022
+ validate := validationutils.AllIn(enumPath, enumList)
3023
+
3024
+ configureDebugInfo = `{"_NAME_":"VALID_ENUM_MESSAGE_TYPE","enumList":["Delivery","Return","Batch","RTO","FTL","PTL","FIFO"],"enumPath":"$.message.order.fulfillments[*].type","_CONTINUE_":"!(enumPath are present)","_RETURN_":"enumPath all in enumList"}`
3025
+
3026
+ if !validate {
3027
+ result := validationutils.ValidationOutput{
3028
+ TestName: "VALID_ENUM_MESSAGE_TYPE",
3029
+ Valid: false,
3030
+ Code: 30000,
3031
+ Description: `#### **VALID_ENUM_MESSAGE_TYPE**
3032
+
3033
+ - All elements of $.message.order.fulfillments[*].type must be in ["Delivery", "Return", "Batch", "RTO", "FTL", "PTL", "FIFO"]
3034
+
3035
+ > **Skip if:**
3036
+ >
3037
+ > - $.message.order.fulfillments[*].type is not in the payload`,
3038
+ DebugInfo: &validationutils.DebugInfo{
3039
+ FedConfig: configureDebugInfo,
3040
+ },
3041
+ }
3042
+ return []validationutils.ValidationOutput{result}, nil
3043
+ }
3044
+
3045
+ }
3046
+
3047
+ result := validationutils.ValidationOutput{
3048
+ TestName: "VALID_ENUM_MESSAGE_TYPE",
3049
+ Valid: valid,
3050
+ Code: 0,
3051
+ DebugInfo: &validationutils.DebugInfo{
3052
+ FedConfig: configureDebugInfo,
3053
+ },
3054
+ }
3055
+
3056
+ if valid {
3057
+ result.Code = 200
3058
+ } else {
3059
+ result.Code = 30000
3060
+ }
3061
+
3062
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3063
+ results = append(results, result)
3064
+ results = append(results, subResults...)
3065
+
3066
+ return results, nil
3067
+ }
3068
+ var VALID_ENUM_MESSAGE_TYPE_3 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3069
+
3070
+ if input.Config.SkipTestsDict != nil {
3071
+ if _, skip := input.Config.SkipTestsDict["VALID_ENUM_MESSAGE_TYPE_3"]; skip {
3072
+ return []validationutils.ValidationOutput{}, nil
3073
+ }
3074
+ }
3075
+
3076
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3077
+
3078
+ subResults := make([]validationutils.ValidationOutput, 0)
3079
+ valid := true
3080
+ configureDebugInfo := ""
3081
+ for _, testObjMap := range scope {
3082
+ validationutils.UnusedFunction(testObjMap)
3083
+
3084
+ enumList := validationutils.StringSliceToInterface([]string{`ON-ORDER`, `ON-FULFILLMENT`, `POST-FULFILLMENT`})
3085
+ validationutils.UnusedFunction(enumList)
3086
+ enumPath := validationutils.GetJsonPath(testObjMap, "$.message.order.payment.type", true)
3087
+ validationutils.UnusedFunction(enumPath)
3088
+
3089
+ skipCheck := !(validationutils.ArePresent(enumPath))
3090
+ if skipCheck {
3091
+ continue
3092
+ }
3093
+
3094
+ validate := validationutils.AllIn(enumPath, enumList)
3095
+
3096
+ configureDebugInfo = `{"_NAME_":"VALID_ENUM_MESSAGE_TYPE_3","enumList":["ON-ORDER","ON-FULFILLMENT","POST-FULFILLMENT"],"enumPath":"$.message.order.payment.type","_CONTINUE_":"!(enumPath are present)","_RETURN_":"enumPath all in enumList"}`
3097
+
3098
+ if !validate {
3099
+ result := validationutils.ValidationOutput{
3100
+ TestName: "VALID_ENUM_MESSAGE_TYPE_3",
3101
+ Valid: false,
3102
+ Code: 30000,
3103
+ Description: `#### **VALID_ENUM_MESSAGE_TYPE_3**
3104
+
3105
+ - All elements of $.message.order.payment.type must be in ["ON-ORDER", "ON-FULFILLMENT", "POST-FULFILLMENT"]
3106
+
3107
+ > **Skip if:**
3108
+ >
3109
+ > - $.message.order.payment.type is not in the payload`,
3110
+ DebugInfo: &validationutils.DebugInfo{
3111
+ FedConfig: configureDebugInfo,
3112
+ },
3113
+ }
3114
+ return []validationutils.ValidationOutput{result}, nil
3115
+ }
3116
+
3117
+ }
3118
+
3119
+ result := validationutils.ValidationOutput{
3120
+ TestName: "VALID_ENUM_MESSAGE_TYPE_3",
3121
+ Valid: valid,
3122
+ Code: 0,
3123
+ DebugInfo: &validationutils.DebugInfo{
3124
+ FedConfig: configureDebugInfo,
3125
+ },
3126
+ }
3127
+
3128
+ if valid {
3129
+ result.Code = 200
3130
+ } else {
3131
+ result.Code = 30000
3132
+ }
3133
+
3134
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3135
+ results = append(results, result)
3136
+ results = append(results, subResults...)
3137
+
3138
+ return results, nil
3139
+ }
3140
+ var VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3141
+
3142
+ if input.Config.SkipTestsDict != nil {
3143
+ if _, skip := input.Config.SkipTestsDict["VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY"]; skip {
3144
+ return []validationutils.ValidationOutput{}, nil
3145
+ }
3146
+ }
3147
+
3148
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3149
+
3150
+ subResults := make([]validationutils.ValidationOutput, 0)
3151
+ valid := true
3152
+ configureDebugInfo := ""
3153
+ for _, testObjMap := range scope {
3154
+ validationutils.UnusedFunction(testObjMap)
3155
+
3156
+ enumList := validationutils.StringSliceToInterface([]string{`lbnp`, `lsp`})
3157
+ validationutils.UnusedFunction(enumList)
3158
+ enumPath := validationutils.GetJsonPath(testObjMap, "$.message.order.payment['@ondc/org/settlement_details'][*].settlement_counterparty", true)
3159
+ validationutils.UnusedFunction(enumPath)
3160
+
3161
+ skipCheck := !(validationutils.ArePresent(enumPath))
3162
+ if skipCheck {
3163
+ continue
3164
+ }
3165
+
3166
+ validate := validationutils.AllIn(enumPath, enumList)
3167
+
3168
+ configureDebugInfo = `{"_NAME_":"VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY","enumList":["lbnp","lsp"],"enumPath":"$.message.order.payment['@ondc/org/settlement_details'][*].settlement_counterparty","_CONTINUE_":"!(enumPath are present)","_RETURN_":"enumPath all in enumList"}`
3169
+
3170
+ if !validate {
3171
+ result := validationutils.ValidationOutput{
3172
+ TestName: "VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY",
3173
+ Valid: false,
3174
+ Code: 30000,
3175
+ Description: `#### **VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY**
3176
+
3177
+ - All elements of $.message.order.payment['@ondc/org/settlement_details'][*].settlement_counterparty must be in ["lbnp", "lsp"]
3178
+
3179
+ > **Skip if:**
3180
+ >
3181
+ > - $.message.order.payment['@ondc/org/settlement_details'][*].settlement_counterparty is not in the payload`,
3182
+ DebugInfo: &validationutils.DebugInfo{
3183
+ FedConfig: configureDebugInfo,
3184
+ },
3185
+ }
3186
+ return []validationutils.ValidationOutput{result}, nil
3187
+ }
3188
+
3189
+ }
3190
+
3191
+ result := validationutils.ValidationOutput{
3192
+ TestName: "VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY",
3193
+ Valid: valid,
3194
+ Code: 0,
3195
+ DebugInfo: &validationutils.DebugInfo{
3196
+ FedConfig: configureDebugInfo,
3197
+ },
3198
+ }
3199
+
3200
+ if valid {
3201
+ result.Code = 200
3202
+ } else {
3203
+ result.Code = 30000
3204
+ }
3205
+
3206
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3207
+ results = append(results, result)
3208
+ results = append(results, subResults...)
3209
+
3210
+ return results, nil
3211
+ }
3212
+ var VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3213
+
3214
+ if input.Config.SkipTestsDict != nil {
3215
+ if _, skip := input.Config.SkipTestsDict["VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE"]; skip {
3216
+ return []validationutils.ValidationOutput{}, nil
3217
+ }
3218
+ }
3219
+
3220
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3221
+
3222
+ subResults := make([]validationutils.ValidationOutput, 0)
3223
+ valid := true
3224
+ configureDebugInfo := ""
3225
+ for _, testObjMap := range scope {
3226
+ validationutils.UnusedFunction(testObjMap)
3227
+
3228
+ enumList := validationutils.StringSliceToInterface([]string{`delivery`, `rto`, `tax`, `diff`, `tax_diff`, `discount`, `cod`, `surge`, `insurance`})
3229
+ validationutils.UnusedFunction(enumList)
3230
+ enumPath := validationutils.GetJsonPath(testObjMap, "$.message.order.quote.breakup[*]['@ondc/org/title_type']", true)
3231
+ validationutils.UnusedFunction(enumPath)
3232
+
3233
+ skipCheck := !(validationutils.ArePresent(enumPath))
3234
+ if skipCheck {
3235
+ continue
3236
+ }
3237
+
3238
+ validate := validationutils.AllIn(enumPath, enumList)
3239
+
3240
+ configureDebugInfo = `{"_NAME_":"VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE","enumList":["delivery","rto","tax","diff","tax_diff","discount","cod","surge","insurance"],"enumPath":"$.message.order.quote.breakup[*]['@ondc/org/title_type']","_CONTINUE_":"!(enumPath are present)","_RETURN_":"enumPath all in enumList"}`
3241
+
3242
+ if !validate {
3243
+ result := validationutils.ValidationOutput{
3244
+ TestName: "VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE",
3245
+ Valid: false,
3246
+ Code: 30000,
3247
+ Description: `#### **VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE**
3248
+
3249
+ - All elements of $.message.order.quote.breakup[*]['@ondc/org/title_type'] must be in ["delivery", "rto", "tax", "diff", "tax_diff", "discount", "cod", "surge", "insurance"]
3250
+
3251
+ > **Skip if:**
3252
+ >
3253
+ > - $.message.order.quote.breakup[*]['@ondc/org/title_type'] is not in the payload`,
3254
+ DebugInfo: &validationutils.DebugInfo{
3255
+ FedConfig: configureDebugInfo,
3256
+ },
3257
+ }
3258
+ return []validationutils.ValidationOutput{result}, nil
3259
+ }
3260
+
3261
+ }
3262
+
3263
+ result := validationutils.ValidationOutput{
3264
+ TestName: "VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE",
3265
+ Valid: valid,
3266
+ Code: 0,
3267
+ DebugInfo: &validationutils.DebugInfo{
3268
+ FedConfig: configureDebugInfo,
3269
+ },
3270
+ }
3271
+
3272
+ if valid {
3273
+ result.Code = 200
3274
+ } else {
3275
+ result.Code = 30000
3276
+ }
3277
+
3278
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3279
+ results = append(results, result)
3280
+ results = append(results, subResults...)
3281
+
3282
+ return results, nil
3283
+ }
3284
+ var Validate_tag_0 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3285
+
3286
+ if input.Config.SkipTestsDict != nil {
3287
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_0"]; skip {
3288
+ return []validationutils.ValidationOutput{}, nil
3289
+ }
3290
+ }
3291
+
3292
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3293
+
3294
+ subResults := make([]validationutils.ValidationOutput, 0)
3295
+ valid := true
3296
+ configureDebugInfo := ""
3297
+ for _, testObjMap := range scope {
3298
+ validationutils.UnusedFunction(testObjMap)
3299
+
3300
+ validTags := validationutils.StringSliceToInterface([]string{`masked_contact`})
3301
+ validationutils.UnusedFunction(validTags)
3302
+ tagPath := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].start.contact.tags[*].code", true)
3303
+ validationutils.UnusedFunction(tagPath)
3304
+
3305
+ skipCheck := !(validationutils.ArePresent(tagPath))
3306
+ if skipCheck {
3307
+ continue
3308
+ }
3309
+
3310
+ validate := validationutils.AllIn(tagPath, validTags)
3311
+
3312
+ configureDebugInfo = `{"_NAME_":"validate_tag_0","validTags":["masked_contact"],"tagPath":"$.message.order.fulfillments[*].start.contact.tags[*].code","_CONTINUE_":"!(tagPath are present)","_RETURN_":"tagPath all in validTags"}`
3313
+
3314
+ if !validate {
3315
+ result := validationutils.ValidationOutput{
3316
+ TestName: "validate_tag_0",
3317
+ Valid: false,
3318
+ Code: 30000,
3319
+ Description: `#### **validate_tag_0**
3320
+
3321
+ - All elements of $.message.order.fulfillments[*].start.contact.tags[*].code must be in ["masked_contact"]
3322
+
3323
+ > **Skip if:**
3324
+ >
3325
+ > - $.message.order.fulfillments[*].start.contact.tags[*].code is not in the payload`,
3326
+ DebugInfo: &validationutils.DebugInfo{
3327
+ FedConfig: configureDebugInfo,
3328
+ },
3329
+ }
3330
+ return []validationutils.ValidationOutput{result}, nil
3331
+ }
3332
+
3333
+ }
3334
+
3335
+ result := validationutils.ValidationOutput{
3336
+ TestName: "Validate_tag_0",
3337
+ Valid: valid,
3338
+ Code: 0,
3339
+ DebugInfo: &validationutils.DebugInfo{
3340
+ FedConfig: configureDebugInfo,
3341
+ },
3342
+ }
3343
+
3344
+ if valid {
3345
+ result.Code = 200
3346
+ } else {
3347
+ result.Code = 30000
3348
+ }
3349
+
3350
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3351
+ results = append(results, result)
3352
+ results = append(results, subResults...)
3353
+
3354
+ return results, nil
3355
+ }
3356
+ var Validate_tag_0_masked_contact = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3357
+
3358
+ if input.Config.SkipTestsDict != nil {
3359
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_0_masked_contact"]; skip {
3360
+ return []validationutils.ValidationOutput{}, nil
3361
+ }
3362
+ }
3363
+
3364
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].start.contact.tags[?(@.code=='masked_contact')]", true)
3365
+
3366
+ subResults := make([]validationutils.ValidationOutput, 0)
3367
+ valid := true
3368
+ configureDebugInfo := ""
3369
+ for _, testObjMap := range scope {
3370
+ validationutils.UnusedFunction(testObjMap)
3371
+
3372
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3373
+ validationutils.UnusedFunction(subTags)
3374
+ validValues := validationutils.StringSliceToInterface([]string{`type`, `setup`, `token`})
3375
+ validationutils.UnusedFunction(validValues)
3376
+
3377
+ validate := validationutils.AllIn(subTags, validValues)
3378
+
3379
+ configureDebugInfo = `{"_NAME_":"validate_tag_0_masked_contact","_SCOPE_":"$.message.order.fulfillments[*].start.contact.tags[?(@.code=='masked_contact')]","subTags":"$.list[*].code","validValues":["type","setup","token"],"_RETURN_":"subTags all in validValues"}`
3380
+
3381
+ if !validate {
3382
+ result := validationutils.ValidationOutput{
3383
+ TestName: "validate_tag_0_masked_contact",
3384
+ Valid: false,
3385
+ Code: 30000,
3386
+ Description: `#### **validate_tag_0_masked_contact**
3387
+
3388
+ - All elements of $.message.order.fulfillments[*].start.contact.tags[?(@.code=='masked_contact')].list[*].code must be in ["type", "setup", "token"]`,
3389
+ DebugInfo: &validationutils.DebugInfo{
3390
+ FedConfig: configureDebugInfo,
3391
+ },
3392
+ }
3393
+ return []validationutils.ValidationOutput{result}, nil
3394
+ }
3395
+
3396
+ }
3397
+
3398
+ result := validationutils.ValidationOutput{
3399
+ TestName: "Validate_tag_0_masked_contact",
3400
+ Valid: valid,
3401
+ Code: 0,
3402
+ DebugInfo: &validationutils.DebugInfo{
3403
+ FedConfig: configureDebugInfo,
3404
+ },
3405
+ }
3406
+
3407
+ if valid {
3408
+ result.Code = 200
3409
+ } else {
3410
+ result.Code = 30000
3411
+ }
3412
+
3413
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3414
+ results = append(results, result)
3415
+ results = append(results, subResults...)
3416
+
3417
+ return results, nil
3418
+ }
3419
+ var Validate_tag_1 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3420
+
3421
+ if input.Config.SkipTestsDict != nil {
3422
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_1"]; skip {
3423
+ return []validationutils.ValidationOutput{}, nil
3424
+ }
3425
+ }
3426
+
3427
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3428
+
3429
+ subResults := make([]validationutils.ValidationOutput, 0)
3430
+ valid := true
3431
+ configureDebugInfo := ""
3432
+ for _, testObjMap := range scope {
3433
+ validationutils.UnusedFunction(testObjMap)
3434
+
3435
+ validTags := validationutils.StringSliceToInterface([]string{`masked_contact`})
3436
+ validationutils.UnusedFunction(validTags)
3437
+ tagPath := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].end.contact.tags[*].code", true)
3438
+ validationutils.UnusedFunction(tagPath)
3439
+
3440
+ skipCheck := !(validationutils.ArePresent(tagPath))
3441
+ if skipCheck {
3442
+ continue
3443
+ }
3444
+
3445
+ validate := validationutils.AllIn(tagPath, validTags)
3446
+
3447
+ configureDebugInfo = `{"_NAME_":"validate_tag_1","validTags":["masked_contact"],"tagPath":"$.message.order.fulfillments[*].end.contact.tags[*].code","_CONTINUE_":"!(tagPath are present)","_RETURN_":"tagPath all in validTags"}`
3448
+
3449
+ if !validate {
3450
+ result := validationutils.ValidationOutput{
3451
+ TestName: "validate_tag_1",
3452
+ Valid: false,
3453
+ Code: 30000,
3454
+ Description: `#### **validate_tag_1**
3455
+
3456
+ - All elements of $.message.order.fulfillments[*].end.contact.tags[*].code must be in ["masked_contact"]
3457
+
3458
+ > **Skip if:**
3459
+ >
3460
+ > - $.message.order.fulfillments[*].end.contact.tags[*].code is not in the payload`,
3461
+ DebugInfo: &validationutils.DebugInfo{
3462
+ FedConfig: configureDebugInfo,
3463
+ },
3464
+ }
3465
+ return []validationutils.ValidationOutput{result}, nil
3466
+ }
3467
+
3468
+ }
3469
+
3470
+ result := validationutils.ValidationOutput{
3471
+ TestName: "Validate_tag_1",
3472
+ Valid: valid,
3473
+ Code: 0,
3474
+ DebugInfo: &validationutils.DebugInfo{
3475
+ FedConfig: configureDebugInfo,
3476
+ },
3477
+ }
3478
+
3479
+ if valid {
3480
+ result.Code = 200
3481
+ } else {
3482
+ result.Code = 30000
3483
+ }
3484
+
3485
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3486
+ results = append(results, result)
3487
+ results = append(results, subResults...)
3488
+
3489
+ return results, nil
3490
+ }
3491
+ var Validate_tag_1_masked_contact = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3492
+
3493
+ if input.Config.SkipTestsDict != nil {
3494
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_1_masked_contact"]; skip {
3495
+ return []validationutils.ValidationOutput{}, nil
3496
+ }
3497
+ }
3498
+
3499
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].end.contact.tags[?(@.code=='masked_contact')]", true)
3500
+
3501
+ subResults := make([]validationutils.ValidationOutput, 0)
3502
+ valid := true
3503
+ configureDebugInfo := ""
3504
+ for _, testObjMap := range scope {
3505
+ validationutils.UnusedFunction(testObjMap)
3506
+
3507
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3508
+ validationutils.UnusedFunction(subTags)
3509
+ validValues := validationutils.StringSliceToInterface([]string{`type`, `setup`, `token`})
3510
+ validationutils.UnusedFunction(validValues)
3511
+
3512
+ validate := validationutils.AllIn(subTags, validValues)
3513
+
3514
+ configureDebugInfo = `{"_NAME_":"validate_tag_1_masked_contact","_SCOPE_":"$.message.order.fulfillments[*].end.contact.tags[?(@.code=='masked_contact')]","subTags":"$.list[*].code","validValues":["type","setup","token"],"_RETURN_":"subTags all in validValues"}`
3515
+
3516
+ if !validate {
3517
+ result := validationutils.ValidationOutput{
3518
+ TestName: "validate_tag_1_masked_contact",
3519
+ Valid: false,
3520
+ Code: 30000,
3521
+ Description: `#### **validate_tag_1_masked_contact**
3522
+
3523
+ - All elements of $.message.order.fulfillments[*].end.contact.tags[?(@.code=='masked_contact')].list[*].code must be in ["type", "setup", "token"]`,
3524
+ DebugInfo: &validationutils.DebugInfo{
3525
+ FedConfig: configureDebugInfo,
3526
+ },
3527
+ }
3528
+ return []validationutils.ValidationOutput{result}, nil
3529
+ }
3530
+
3531
+ }
3532
+
3533
+ result := validationutils.ValidationOutput{
3534
+ TestName: "Validate_tag_1_masked_contact",
3535
+ Valid: valid,
3536
+ Code: 0,
3537
+ DebugInfo: &validationutils.DebugInfo{
3538
+ FedConfig: configureDebugInfo,
3539
+ },
3540
+ }
3541
+
3542
+ if valid {
3543
+ result.Code = 200
3544
+ } else {
3545
+ result.Code = 30000
3546
+ }
3547
+
3548
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3549
+ results = append(results, result)
3550
+ results = append(results, subResults...)
3551
+
3552
+ return results, nil
3553
+ }
3554
+ var Validate_tag_2 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3555
+
3556
+ if input.Config.SkipTestsDict != nil {
3557
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2"]; skip {
3558
+ return []validationutils.ValidationOutput{}, nil
3559
+ }
3560
+ }
3561
+
3562
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
3563
+
3564
+ subResults := make([]validationutils.ValidationOutput, 0)
3565
+ valid := true
3566
+ configureDebugInfo := ""
3567
+ for _, testObjMap := range scope {
3568
+ validationutils.UnusedFunction(testObjMap)
3569
+
3570
+ validTags := validationutils.StringSliceToInterface([]string{`rider_check`, `linked_provider`, `fulfill_request`, `fulfill_response`, `linked_order`, `linked_order_item`, `special_req`, `linked_package`, `motorable_distance`})
3571
+ validationutils.UnusedFunction(validTags)
3572
+ tagPath := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].tags[*].code", true)
3573
+ validationutils.UnusedFunction(tagPath)
3574
+
3575
+ skipCheck := !(validationutils.ArePresent(tagPath))
3576
+ if skipCheck {
3577
+ continue
3578
+ }
3579
+
3580
+ validate := validationutils.AllIn(tagPath, validTags)
3581
+
3582
+ configureDebugInfo = `{"_NAME_":"validate_tag_2","validTags":["rider_check","linked_provider","fulfill_request","fulfill_response","linked_order","linked_order_item","special_req","linked_package","motorable_distance"],"tagPath":"$.message.order.fulfillments[*].tags[*].code","_CONTINUE_":"!(tagPath are present)","_RETURN_":"tagPath all in validTags"}`
3583
+
3584
+ if !validate {
3585
+ result := validationutils.ValidationOutput{
3586
+ TestName: "validate_tag_2",
3587
+ Valid: false,
3588
+ Code: 30000,
3589
+ Description: `#### **validate_tag_2**
3590
+
3591
+ - All elements of $.message.order.fulfillments[*].tags[*].code must be in ["rider_check", "linked_provider", "fulfill_request", "fulfill_response", "linked_order", "linked_order_item", "special_req", "linked_package", "motorable_distance"]
3592
+
3593
+ > **Skip if:**
3594
+ >
3595
+ > - $.message.order.fulfillments[*].tags[*].code is not in the payload`,
3596
+ DebugInfo: &validationutils.DebugInfo{
3597
+ FedConfig: configureDebugInfo,
3598
+ },
3599
+ }
3600
+ return []validationutils.ValidationOutput{result}, nil
3601
+ }
3602
+
3603
+ }
3604
+
3605
+ result := validationutils.ValidationOutput{
3606
+ TestName: "Validate_tag_2",
3607
+ Valid: valid,
3608
+ Code: 0,
3609
+ DebugInfo: &validationutils.DebugInfo{
3610
+ FedConfig: configureDebugInfo,
3611
+ },
3612
+ }
3613
+
3614
+ if valid {
3615
+ result.Code = 200
3616
+ } else {
3617
+ result.Code = 30000
3618
+ }
3619
+
3620
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3621
+ results = append(results, result)
3622
+ results = append(results, subResults...)
3623
+
3624
+ return results, nil
3625
+ }
3626
+ var Validate_tag_2_rider_check = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3627
+
3628
+ if input.Config.SkipTestsDict != nil {
3629
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2_rider_check"]; skip {
3630
+ return []validationutils.ValidationOutput{}, nil
3631
+ }
3632
+ }
3633
+
3634
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].tags[?(@.code=='rider_check')]", true)
3635
+
3636
+ subResults := make([]validationutils.ValidationOutput, 0)
3637
+ valid := true
3638
+ configureDebugInfo := ""
3639
+ for _, testObjMap := range scope {
3640
+ validationutils.UnusedFunction(testObjMap)
3641
+
3642
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3643
+ validationutils.UnusedFunction(subTags)
3644
+ validValues := validationutils.StringSliceToInterface([]string{`inline_check_for_rider`})
3645
+ validationutils.UnusedFunction(validValues)
3646
+
3647
+ validate := validationutils.AllIn(subTags, validValues)
3648
+
3649
+ configureDebugInfo = `{"_NAME_":"validate_tag_2_rider_check","_SCOPE_":"$.message.order.fulfillments[*].tags[?(@.code=='rider_check')]","subTags":"$.list[*].code","validValues":["inline_check_for_rider"],"_RETURN_":"subTags all in validValues"}`
3650
+
3651
+ if !validate {
3652
+ result := validationutils.ValidationOutput{
3653
+ TestName: "validate_tag_2_rider_check",
3654
+ Valid: false,
3655
+ Code: 30000,
3656
+ Description: `#### **validate_tag_2_rider_check**
3657
+
3658
+ - All elements of $.message.order.fulfillments[*].tags[?(@.code=='rider_check')].list[*].code must be in ["inline_check_for_rider"]`,
3659
+ DebugInfo: &validationutils.DebugInfo{
3660
+ FedConfig: configureDebugInfo,
3661
+ },
3662
+ }
3663
+ return []validationutils.ValidationOutput{result}, nil
3664
+ }
3665
+
3666
+ }
3667
+
3668
+ result := validationutils.ValidationOutput{
3669
+ TestName: "Validate_tag_2_rider_check",
3670
+ Valid: valid,
3671
+ Code: 0,
3672
+ DebugInfo: &validationutils.DebugInfo{
3673
+ FedConfig: configureDebugInfo,
3674
+ },
3675
+ }
3676
+
3677
+ if valid {
3678
+ result.Code = 200
3679
+ } else {
3680
+ result.Code = 30000
3681
+ }
3682
+
3683
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3684
+ results = append(results, result)
3685
+ results = append(results, subResults...)
3686
+
3687
+ return results, nil
3688
+ }
3689
+ var Validate_tag_2_linked_provider = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3690
+
3691
+ if input.Config.SkipTestsDict != nil {
3692
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2_linked_provider"]; skip {
3693
+ return []validationutils.ValidationOutput{}, nil
3694
+ }
3695
+ }
3696
+
3697
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].tags[?(@.code=='linked_provider')]", true)
3698
+
3699
+ subResults := make([]validationutils.ValidationOutput, 0)
3700
+ valid := true
3701
+ configureDebugInfo := ""
3702
+ for _, testObjMap := range scope {
3703
+ validationutils.UnusedFunction(testObjMap)
3704
+
3705
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3706
+ validationutils.UnusedFunction(subTags)
3707
+ validValues := validationutils.StringSliceToInterface([]string{`id`, `name`, `address`, `cred_code`, `cred_desc`, `tax_id`})
3708
+ validationutils.UnusedFunction(validValues)
3709
+
3710
+ validate := validationutils.AllIn(subTags, validValues)
3711
+
3712
+ configureDebugInfo = `{"_NAME_":"validate_tag_2_linked_provider","_SCOPE_":"$.message.order.fulfillments[*].tags[?(@.code=='linked_provider')]","subTags":"$.list[*].code","validValues":["id","name","address","cred_code","cred_desc","tax_id"],"_RETURN_":"subTags all in validValues"}`
3713
+
3714
+ if !validate {
3715
+ result := validationutils.ValidationOutput{
3716
+ TestName: "validate_tag_2_linked_provider",
3717
+ Valid: false,
3718
+ Code: 30000,
3719
+ Description: `#### **validate_tag_2_linked_provider**
3720
+
3721
+ - All elements of $.message.order.fulfillments[*].tags[?(@.code=='linked_provider')].list[*].code must be in ["id", "name", "address", "cred_code", "cred_desc", "tax_id"]`,
3722
+ DebugInfo: &validationutils.DebugInfo{
3723
+ FedConfig: configureDebugInfo,
3724
+ },
3725
+ }
3726
+ return []validationutils.ValidationOutput{result}, nil
3727
+ }
3728
+
3729
+ }
3730
+
3731
+ result := validationutils.ValidationOutput{
3732
+ TestName: "Validate_tag_2_linked_provider",
3733
+ Valid: valid,
3734
+ Code: 0,
3735
+ DebugInfo: &validationutils.DebugInfo{
3736
+ FedConfig: configureDebugInfo,
3737
+ },
3738
+ }
3739
+
3740
+ if valid {
3741
+ result.Code = 200
3742
+ } else {
3743
+ result.Code = 30000
3744
+ }
3745
+
3746
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3747
+ results = append(results, result)
3748
+ results = append(results, subResults...)
3749
+
3750
+ return results, nil
3751
+ }
3752
+ var Validate_tag_2_fulfill_request = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3753
+
3754
+ if input.Config.SkipTestsDict != nil {
3755
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2_fulfill_request"]; skip {
3756
+ return []validationutils.ValidationOutput{}, nil
3757
+ }
3758
+ }
3759
+
3760
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].tags[?(@.code=='fulfill_request')]", true)
3761
+
3762
+ subResults := make([]validationutils.ValidationOutput, 0)
3763
+ valid := true
3764
+ configureDebugInfo := ""
3765
+ for _, testObjMap := range scope {
3766
+ validationutils.UnusedFunction(testObjMap)
3767
+
3768
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3769
+ validationutils.UnusedFunction(subTags)
3770
+ validValues := validationutils.StringSliceToInterface([]string{`rider_count`, `order_count`, `rate_basis`, `motorable_distance`, `pickup_slot_start`, `pickup_slot_end`, `delivery_slot_start`, `delivery_slot_end`})
3771
+ validationutils.UnusedFunction(validValues)
3772
+
3773
+ validate := validationutils.AllIn(subTags, validValues)
3774
+
3775
+ configureDebugInfo = `{"_NAME_":"validate_tag_2_fulfill_request","_SCOPE_":"$.message.order.fulfillments[*].tags[?(@.code=='fulfill_request')]","subTags":"$.list[*].code","validValues":["rider_count","order_count","rate_basis","motorable_distance","pickup_slot_start","pickup_slot_end","delivery_slot_start","delivery_slot_end"],"_RETURN_":"subTags all in validValues"}`
3776
+
3777
+ if !validate {
3778
+ result := validationutils.ValidationOutput{
3779
+ TestName: "validate_tag_2_fulfill_request",
3780
+ Valid: false,
3781
+ Code: 30000,
3782
+ Description: `#### **validate_tag_2_fulfill_request**
3783
+
3784
+ - All elements of $.message.order.fulfillments[*].tags[?(@.code=='fulfill_request')].list[*].code must be in ["rider_count", "order_count", "rate_basis", "motorable_distance", "pickup_slot_start", "pickup_slot_end", "delivery_slot_start", "delivery_slot_end"]`,
3785
+ DebugInfo: &validationutils.DebugInfo{
3786
+ FedConfig: configureDebugInfo,
3787
+ },
3788
+ }
3789
+ return []validationutils.ValidationOutput{result}, nil
3790
+ }
3791
+
3792
+ }
3793
+
3794
+ result := validationutils.ValidationOutput{
3795
+ TestName: "Validate_tag_2_fulfill_request",
3796
+ Valid: valid,
3797
+ Code: 0,
3798
+ DebugInfo: &validationutils.DebugInfo{
3799
+ FedConfig: configureDebugInfo,
3800
+ },
3801
+ }
3802
+
3803
+ if valid {
3804
+ result.Code = 200
3805
+ } else {
3806
+ result.Code = 30000
3807
+ }
3808
+
3809
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3810
+ results = append(results, result)
3811
+ results = append(results, subResults...)
3812
+
3813
+ return results, nil
3814
+ }
3815
+ var Validate_tag_2_fulfill_response = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3816
+
3817
+ if input.Config.SkipTestsDict != nil {
3818
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2_fulfill_response"]; skip {
3819
+ return []validationutils.ValidationOutput{}, nil
3820
+ }
3821
+ }
3822
+
3823
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].tags[?(@.code=='fulfill_response')]", true)
3824
+
3825
+ subResults := make([]validationutils.ValidationOutput, 0)
3826
+ valid := true
3827
+ configureDebugInfo := ""
3828
+ for _, testObjMap := range scope {
3829
+ validationutils.UnusedFunction(testObjMap)
3830
+
3831
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3832
+ validationutils.UnusedFunction(subTags)
3833
+ validValues := validationutils.StringSliceToInterface([]string{`rider_count`, `order_count`, `rate_basis`})
3834
+ validationutils.UnusedFunction(validValues)
3835
+
3836
+ validate := validationutils.AllIn(subTags, validValues)
3837
+
3838
+ configureDebugInfo = `{"_NAME_":"validate_tag_2_fulfill_response","_SCOPE_":"$.message.order.fulfillments[*].tags[?(@.code=='fulfill_response')]","subTags":"$.list[*].code","validValues":["rider_count","order_count","rate_basis"],"_RETURN_":"subTags all in validValues"}`
3839
+
3840
+ if !validate {
3841
+ result := validationutils.ValidationOutput{
3842
+ TestName: "validate_tag_2_fulfill_response",
3843
+ Valid: false,
3844
+ Code: 30000,
3845
+ Description: `#### **validate_tag_2_fulfill_response**
3846
+
3847
+ - All elements of $.message.order.fulfillments[*].tags[?(@.code=='fulfill_response')].list[*].code must be in ["rider_count", "order_count", "rate_basis"]`,
3848
+ DebugInfo: &validationutils.DebugInfo{
3849
+ FedConfig: configureDebugInfo,
3850
+ },
3851
+ }
3852
+ return []validationutils.ValidationOutput{result}, nil
3853
+ }
3854
+
3855
+ }
3856
+
3857
+ result := validationutils.ValidationOutput{
3858
+ TestName: "Validate_tag_2_fulfill_response",
3859
+ Valid: valid,
3860
+ Code: 0,
3861
+ DebugInfo: &validationutils.DebugInfo{
3862
+ FedConfig: configureDebugInfo,
3863
+ },
3864
+ }
3865
+
3866
+ if valid {
3867
+ result.Code = 200
3868
+ } else {
3869
+ result.Code = 30000
3870
+ }
3871
+
3872
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3873
+ results = append(results, result)
3874
+ results = append(results, subResults...)
3875
+
3876
+ return results, nil
3877
+ }
3878
+ var Validate_tag_2_linked_order = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3879
+
3880
+ if input.Config.SkipTestsDict != nil {
3881
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2_linked_order"]; skip {
3882
+ return []validationutils.ValidationOutput{}, nil
3883
+ }
3884
+ }
3885
+
3886
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].tags[?(@.code=='linked_order')]", true)
3887
+
3888
+ subResults := make([]validationutils.ValidationOutput, 0)
3889
+ valid := true
3890
+ configureDebugInfo := ""
3891
+ for _, testObjMap := range scope {
3892
+ validationutils.UnusedFunction(testObjMap)
3893
+
3894
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3895
+ validationutils.UnusedFunction(subTags)
3896
+ validValues := validationutils.StringSliceToInterface([]string{`id`, `cod_order`, `collection_amount`, `currency`, `declared_value`, `weight_unit`, `weight_value`, `dim_unit`, `length`, `breadth`, `height`, `category`})
3897
+ validationutils.UnusedFunction(validValues)
3898
+
3899
+ validate := validationutils.AllIn(subTags, validValues)
3900
+
3901
+ configureDebugInfo = `{"_NAME_":"validate_tag_2_linked_order","_SCOPE_":"$.message.order.fulfillments[*].tags[?(@.code=='linked_order')]","subTags":"$.list[*].code","validValues":["id","cod_order","collection_amount","currency","declared_value","weight_unit","weight_value","dim_unit","length","breadth","height","category"],"_RETURN_":"subTags all in validValues"}`
3902
+
3903
+ if !validate {
3904
+ result := validationutils.ValidationOutput{
3905
+ TestName: "validate_tag_2_linked_order",
3906
+ Valid: false,
3907
+ Code: 30000,
3908
+ Description: `#### **validate_tag_2_linked_order**
3909
+
3910
+ - All elements of $.message.order.fulfillments[*].tags[?(@.code=='linked_order')].list[*].code must be in ["id", "cod_order", "collection_amount", "currency", "declared_value", "weight_unit", "weight_value", "dim_unit", "length", "breadth", "height", "category"]`,
3911
+ DebugInfo: &validationutils.DebugInfo{
3912
+ FedConfig: configureDebugInfo,
3913
+ },
3914
+ }
3915
+ return []validationutils.ValidationOutput{result}, nil
3916
+ }
3917
+
3918
+ }
3919
+
3920
+ result := validationutils.ValidationOutput{
3921
+ TestName: "Validate_tag_2_linked_order",
3922
+ Valid: valid,
3923
+ Code: 0,
3924
+ DebugInfo: &validationutils.DebugInfo{
3925
+ FedConfig: configureDebugInfo,
3926
+ },
3927
+ }
3928
+
3929
+ if valid {
3930
+ result.Code = 200
3931
+ } else {
3932
+ result.Code = 30000
3933
+ }
3934
+
3935
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3936
+ results = append(results, result)
3937
+ results = append(results, subResults...)
3938
+
3939
+ return results, nil
3940
+ }
3941
+ var Validate_tag_2_linked_order_item = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
3942
+
3943
+ if input.Config.SkipTestsDict != nil {
3944
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_2_linked_order_item"]; skip {
3945
+ return []validationutils.ValidationOutput{}, nil
3946
+ }
3947
+ }
3948
+
3949
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.fulfillments[*].tags[?(@.code=='linked_order_item')]", true)
3950
+
3951
+ subResults := make([]validationutils.ValidationOutput, 0)
3952
+ valid := true
3953
+ configureDebugInfo := ""
3954
+ for _, testObjMap := range scope {
3955
+ validationutils.UnusedFunction(testObjMap)
3956
+
3957
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
3958
+ validationutils.UnusedFunction(subTags)
3959
+ validValues := validationutils.StringSliceToInterface([]string{`category`, `name`, `currency`, `value`, `quantity`, `weight_unit`, `weight_value`, `hsn_code`, `ebn_exempt`})
3960
+ validationutils.UnusedFunction(validValues)
3961
+
3962
+ validate := validationutils.AllIn(subTags, validValues)
3963
+
3964
+ configureDebugInfo = `{"_NAME_":"validate_tag_2_linked_order_item","_SCOPE_":"$.message.order.fulfillments[*].tags[?(@.code=='linked_order_item')]","subTags":"$.list[*].code","validValues":["category","name","currency","value","quantity","weight_unit","weight_value","hsn_code","ebn_exempt"],"_RETURN_":"subTags all in validValues"}`
3965
+
3966
+ if !validate {
3967
+ result := validationutils.ValidationOutput{
3968
+ TestName: "validate_tag_2_linked_order_item",
3969
+ Valid: false,
3970
+ Code: 30000,
3971
+ Description: `#### **validate_tag_2_linked_order_item**
3972
+
3973
+ - All elements of $.message.order.fulfillments[*].tags[?(@.code=='linked_order_item')].list[*].code must be in ["category", "name", "currency", "value", "quantity", "weight_unit", "weight_value", "hsn_code", "ebn_exempt"]`,
3974
+ DebugInfo: &validationutils.DebugInfo{
3975
+ FedConfig: configureDebugInfo,
3976
+ },
3977
+ }
3978
+ return []validationutils.ValidationOutput{result}, nil
3979
+ }
3980
+
3981
+ }
3982
+
3983
+ result := validationutils.ValidationOutput{
3984
+ TestName: "Validate_tag_2_linked_order_item",
3985
+ Valid: valid,
3986
+ Code: 0,
3987
+ DebugInfo: &validationutils.DebugInfo{
3988
+ FedConfig: configureDebugInfo,
3989
+ },
3990
+ }
3991
+
3992
+ if valid {
3993
+ result.Code = 200
3994
+ } else {
3995
+ result.Code = 30000
3996
+ }
3997
+
3998
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
3999
+ results = append(results, result)
4000
+ results = append(results, subResults...)
4001
+
4002
+ return results, nil
4003
+ }
4004
+ var Validate_tag_3 = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
4005
+
4006
+ if input.Config.SkipTestsDict != nil {
4007
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_3"]; skip {
4008
+ return []validationutils.ValidationOutput{}, nil
4009
+ }
4010
+ }
4011
+
4012
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
4013
+
4014
+ subResults := make([]validationutils.ValidationOutput, 0)
4015
+ valid := true
4016
+ configureDebugInfo := ""
4017
+ for _, testObjMap := range scope {
4018
+ validationutils.UnusedFunction(testObjMap)
4019
+
4020
+ validTags := validationutils.StringSliceToInterface([]string{`bpp_terms`})
4021
+ validationutils.UnusedFunction(validTags)
4022
+ tagPath := validationutils.GetJsonPath(testObjMap, "$.message.order.tags[*].code", true)
4023
+ validationutils.UnusedFunction(tagPath)
4024
+
4025
+ skipCheck := !(validationutils.ArePresent(tagPath))
4026
+ if skipCheck {
4027
+ continue
4028
+ }
4029
+
4030
+ validate := validationutils.AllIn(tagPath, validTags)
4031
+
4032
+ configureDebugInfo = `{"_NAME_":"validate_tag_3","validTags":["bpp_terms"],"tagPath":"$.message.order.tags[*].code","_CONTINUE_":"!(tagPath are present)","_RETURN_":"tagPath all in validTags"}`
4033
+
4034
+ if !validate {
4035
+ result := validationutils.ValidationOutput{
4036
+ TestName: "validate_tag_3",
4037
+ Valid: false,
4038
+ Code: 30000,
4039
+ Description: `#### **validate_tag_3**
4040
+
4041
+ - All elements of $.message.order.tags[*].code must be in ["bpp_terms"]
4042
+
4043
+ > **Skip if:**
4044
+ >
4045
+ > - $.message.order.tags[*].code is not in the payload`,
4046
+ DebugInfo: &validationutils.DebugInfo{
4047
+ FedConfig: configureDebugInfo,
4048
+ },
4049
+ }
4050
+ return []validationutils.ValidationOutput{result}, nil
4051
+ }
4052
+
4053
+ }
4054
+
4055
+ result := validationutils.ValidationOutput{
4056
+ TestName: "Validate_tag_3",
4057
+ Valid: valid,
4058
+ Code: 0,
4059
+ DebugInfo: &validationutils.DebugInfo{
4060
+ FedConfig: configureDebugInfo,
4061
+ },
4062
+ }
4063
+
4064
+ if valid {
4065
+ result.Code = 200
4066
+ } else {
4067
+ result.Code = 30000
4068
+ }
4069
+
4070
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
4071
+ results = append(results, result)
4072
+ results = append(results, subResults...)
4073
+
4074
+ return results, nil
4075
+ }
4076
+ var Validate_tag_3_bpp_terms = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
4077
+
4078
+ if input.Config.SkipTestsDict != nil {
4079
+ if _, skip := input.Config.SkipTestsDict["Validate_tag_3_bpp_terms"]; skip {
4080
+ return []validationutils.ValidationOutput{}, nil
4081
+ }
4082
+ }
4083
+
4084
+ scope := validationutils.GetJsonPath(input.Payload, "$.message.order.tags[?(@.code=='bpp_terms')]", true)
4085
+
4086
+ subResults := make([]validationutils.ValidationOutput, 0)
4087
+ valid := true
4088
+ configureDebugInfo := ""
4089
+ for _, testObjMap := range scope {
4090
+ validationutils.UnusedFunction(testObjMap)
4091
+
4092
+ subTags := validationutils.GetJsonPath(testObjMap, "$.list[*].code", true)
4093
+ validationutils.UnusedFunction(subTags)
4094
+ validValues := validationutils.StringSliceToInterface([]string{`static_terms`})
4095
+ validationutils.UnusedFunction(validValues)
4096
+
4097
+ validate := validationutils.AllIn(subTags, validValues)
4098
+
4099
+ configureDebugInfo = `{"_NAME_":"validate_tag_3_bpp_terms","_SCOPE_":"$.message.order.tags[?(@.code=='bpp_terms')]","subTags":"$.list[*].code","validValues":["static_terms"],"_RETURN_":"subTags all in validValues"}`
4100
+
4101
+ if !validate {
4102
+ result := validationutils.ValidationOutput{
4103
+ TestName: "validate_tag_3_bpp_terms",
4104
+ Valid: false,
4105
+ Code: 30000,
4106
+ Description: `#### **validate_tag_3_bpp_terms**
4107
+
4108
+ - All elements of $.message.order.tags[?(@.code=='bpp_terms')].list[*].code must be in ["static_terms"]`,
4109
+ DebugInfo: &validationutils.DebugInfo{
4110
+ FedConfig: configureDebugInfo,
4111
+ },
4112
+ }
4113
+ return []validationutils.ValidationOutput{result}, nil
4114
+ }
4115
+
4116
+ }
4117
+
4118
+ result := validationutils.ValidationOutput{
4119
+ TestName: "Validate_tag_3_bpp_terms",
4120
+ Valid: valid,
4121
+ Code: 0,
4122
+ DebugInfo: &validationutils.DebugInfo{
4123
+ FedConfig: configureDebugInfo,
4124
+ },
4125
+ }
4126
+
4127
+ if valid {
4128
+ result.Code = 200
4129
+ } else {
4130
+ result.Code = 30000
4131
+ }
4132
+
4133
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
4134
+ results = append(results, result)
4135
+ results = append(results, subResults...)
4136
+
4137
+ return results, nil
4138
+ }
4139
+ var On_init_fulfillment_id_validations = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
4140
+
4141
+ if input.Config.SkipTestsDict != nil {
4142
+ if _, skip := input.Config.SkipTestsDict["On_init_fulfillment_id_validations"]; skip {
4143
+ return []validationutils.ValidationOutput{}, nil
4144
+ }
4145
+ }
4146
+
4147
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
4148
+
4149
+ subResults := make([]validationutils.ValidationOutput, 0)
4150
+ valid := true
4151
+ configureDebugInfo := ""
4152
+ for _, testObjMap := range scope {
4153
+ validationutils.UnusedFunction(testObjMap)
4154
+
4155
+ var Validate_fulfillment_id_in_items = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
4156
+
4157
+ if input.Config.SkipTestsDict != nil {
4158
+ if _, skip := input.Config.SkipTestsDict["Validate_fulfillment_id_in_items"]; skip {
4159
+ return []validationutils.ValidationOutput{}, nil
4160
+ }
4161
+ }
4162
+
4163
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
4164
+
4165
+ subResults := make([]validationutils.ValidationOutput, 0)
4166
+ valid := true
4167
+ configureDebugInfo := ""
4168
+ for _, testObjMap := range scope {
4169
+ validationutils.UnusedFunction(testObjMap)
4170
+
4171
+ fulfillment_id := validationutils.GetJsonPath(testObjMap, "$.message.order.items[*].fulfillment_id", true)
4172
+ validationutils.UnusedFunction(fulfillment_id)
4173
+ fulfillment_ids := validationutils.GetJsonPath(testObjMap, "$.message.order.items[*].fulfillment_ids[*]", true)
4174
+ validationutils.UnusedFunction(fulfillment_ids)
4175
+
4176
+ validate := (validationutils.ArePresent(fulfillment_id)) || (validationutils.ArePresent(fulfillment_ids))
4177
+
4178
+ configureDebugInfo = `{"_NAME_":"validate_fulfillment_id_in_items","_DESCRIPTION_":"fulfillment_id or fulfillment_ids should be present in items","fulfillment_id":"$.message.order.items[*].fulfillment_id","fulfillment_ids":"$.message.order.items[*].fulfillment_ids[*]","_RETURN_":"fulfillment_id are present || fulfillment_ids are present"}`
4179
+
4180
+ if !validate {
4181
+ result := validationutils.ValidationOutput{
4182
+ TestName: "validate_fulfillment_id_in_items",
4183
+ Valid: false,
4184
+ Code: 30000,
4185
+ Description: `#### **validate_fulfillment_id_in_items**
4186
+
4187
+ fulfillment_id or fulfillment_ids should be present in items`,
4188
+ DebugInfo: &validationutils.DebugInfo{
4189
+ FedConfig: configureDebugInfo,
4190
+ },
4191
+ }
4192
+ return []validationutils.ValidationOutput{result}, nil
4193
+ }
4194
+
4195
+ }
4196
+
4197
+ result := validationutils.ValidationOutput{
4198
+ TestName: "Validate_fulfillment_id_in_items",
4199
+ Valid: valid,
4200
+ Code: 0,
4201
+ DebugInfo: &validationutils.DebugInfo{
4202
+ FedConfig: configureDebugInfo,
4203
+ },
4204
+ }
4205
+
4206
+ if valid {
4207
+ result.Code = 200
4208
+ } else {
4209
+ result.Code = 30000
4210
+ }
4211
+
4212
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
4213
+ results = append(results, result)
4214
+ results = append(results, subResults...)
4215
+
4216
+ return results, nil
4217
+ }
4218
+ var Validate_fulfillment_id_in_fulfillments = func(input validationutils.ValidationInput) ([]validationutils.ValidationOutput, error) {
4219
+
4220
+ if input.Config.SkipTestsDict != nil {
4221
+ if _, skip := input.Config.SkipTestsDict["Validate_fulfillment_id_in_fulfillments"]; skip {
4222
+ return []validationutils.ValidationOutput{}, nil
4223
+ }
4224
+ }
4225
+
4226
+ scope := validationutils.GetJsonPath(input.Payload, "$", true)
4227
+
4228
+ subResults := make([]validationutils.ValidationOutput, 0)
4229
+ valid := true
4230
+ configureDebugInfo := ""
4231
+ for _, testObjMap := range scope {
4232
+ validationutils.UnusedFunction(testObjMap)
4233
+
4234
+ fulfillment_id := validationutils.GetJsonPath(testObjMap, "$.message.order.fulfillments[*].id", true)
4235
+ validationutils.UnusedFunction(fulfillment_id)
4236
+ item_fulfillment_id := validationutils.GetJsonPath(testObjMap, "$.message.order.items[*].fulfillment_id", true)
4237
+ validationutils.UnusedFunction(item_fulfillment_id)
4238
+ item_fulfillment_ids := validationutils.GetJsonPath(testObjMap, "$.message.order.items[*].fulfillment_ids[*]", true)
4239
+ validationutils.UnusedFunction(item_fulfillment_ids)
4240
+
4241
+ validate := (validationutils.AllIn(item_fulfillment_id, fulfillment_id)) || (validationutils.AllIn(item_fulfillment_ids, fulfillment_id))
4242
+
4243
+ configureDebugInfo = `{"_NAME_":"validate_fulfillment_id_in_fulfillments","_DESCRIPTION_":"Fulfillment id in items should be mapped correctly in fulfillments array","fulfillment_id":"$.message.order.fulfillments[*].id","item_fulfillment_id":"$.message.order.items[*].fulfillment_id","item_fulfillment_ids":"$.message.order.items[*].fulfillment_ids[*]","_RETURN_":"item_fulfillment_id all in fulfillment_id || item_fulfillment_ids all in fulfillment_id"}`
4244
+
4245
+ if !validate {
4246
+ result := validationutils.ValidationOutput{
4247
+ TestName: "validate_fulfillment_id_in_fulfillments",
4248
+ Valid: false,
4249
+ Code: 30000,
4250
+ Description: `#### **validate_fulfillment_id_in_fulfillments**
4251
+
4252
+ Fulfillment id in items should be mapped correctly in fulfillments array`,
4253
+ DebugInfo: &validationutils.DebugInfo{
4254
+ FedConfig: configureDebugInfo,
4255
+ },
4256
+ }
4257
+ return []validationutils.ValidationOutput{result}, nil
4258
+ }
4259
+
4260
+ }
4261
+
4262
+ result := validationutils.ValidationOutput{
4263
+ TestName: "Validate_fulfillment_id_in_fulfillments",
4264
+ Valid: valid,
4265
+ Code: 0,
4266
+ DebugInfo: &validationutils.DebugInfo{
4267
+ FedConfig: configureDebugInfo,
4268
+ },
4269
+ }
4270
+
4271
+ if valid {
4272
+ result.Code = 200
4273
+ } else {
4274
+ result.Code = 30000
4275
+ }
4276
+
4277
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
4278
+ results = append(results, result)
4279
+ results = append(results, subResults...)
4280
+
4281
+ return results, nil
4282
+ }
4283
+
4284
+ var testFunctions = validationutils.TestFunctionArray{
4285
+ Validate_fulfillment_id_in_items,
4286
+ Validate_fulfillment_id_in_fulfillments,
4287
+ }
4288
+
4289
+ allResults := make([]validationutils.ValidationOutput, 0)
4290
+
4291
+ for _, testFunc := range testFunctions {
4292
+ results, err := testFunc(input)
4293
+ if err != nil {
4294
+ return nil, err
4295
+ }
4296
+ allResults = append(allResults, results...)
4297
+ }
4298
+
4299
+ subResults = allResults
4300
+ // if all subResults are valid, then valid is true
4301
+ valid = true
4302
+ for _, res := range subResults {
4303
+ if !res.Valid {
4304
+ valid = false
4305
+ break
4306
+ }
4307
+ }
4308
+
4309
+ configureDebugInfo = `NESTED_TEST_OBJECT`
4310
+
4311
+ }
4312
+
4313
+ result := validationutils.ValidationOutput{
4314
+ TestName: "On_init_fulfillment_id_validations",
4315
+ Valid: valid,
4316
+ Code: 0,
4317
+ DebugInfo: &validationutils.DebugInfo{
4318
+ FedConfig: configureDebugInfo,
4319
+ },
4320
+ }
4321
+
4322
+ if valid {
4323
+ result.Code = 200
4324
+ } else {
4325
+ result.Code = 30000
4326
+ }
4327
+
4328
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
4329
+ results = append(results, result)
4330
+ results = append(results, subResults...)
4331
+
4332
+ return results, nil
4333
+ }
4334
+
4335
+ var testFunctions = validationutils.TestFunctionArray{
4336
+ REQUIRED_CONTEXT_DOMAIN,
4337
+ REQUIRED_CONTEXT_COUNTRY,
4338
+ REQUIRED_CONTEXT_CITY,
4339
+ REQUIRED_CONTEXT_ACTION,
4340
+ REQUIRED_CONTEXT_CORE_VERSION,
4341
+ REQUIRED_CONTEXT_BAP_ID,
4342
+ REQUIRED_CONTEXT_BAP_URI,
4343
+ REQUIRED_CONTEXT_BPP_ID,
4344
+ REQUIRED_CONTEXT_BPP_URI,
4345
+ REQUIRED_CONTEXT_TRANSACTION_ID,
4346
+ REQUIRED_CONTEXT_MESSAGE_ID,
4347
+ REQUIRED_CONTEXT_TIMESTAMP,
4348
+ REQUIRED_MESSAGE_ID,
4349
+ REQUIRED_MESSAGE_ID_14,
4350
+ REQUIRED_MESSAGE_TYPE,
4351
+ REQUIRED_MESSAGE_ID_16,
4352
+ REQUIRED_MESSAGE_GPS,
4353
+ REQUIRED_MESSAGE_NAME,
4354
+ REQUIRED_MESSAGE_BUILDING,
4355
+ REQUIRED_MESSAGE_LOCALITY,
4356
+ REQUIRED_MESSAGE_CITY,
4357
+ REQUIRED_MESSAGE_STATE,
4358
+ REQUIRED_MESSAGE_COUNTRY,
4359
+ REQUIRED_MESSAGE_AREA_CODE,
4360
+ REQUIRED_MESSAGE_PHONE,
4361
+ REQUIRED_MESSAGE_EMAIL,
4362
+ REQUIRED_MESSAGE_GPS_27,
4363
+ REQUIRED_MESSAGE_NAME_28,
4364
+ REQUIRED_MESSAGE_BUILDING_29,
4365
+ REQUIRED_MESSAGE_LOCALITY_30,
4366
+ REQUIRED_MESSAGE_CITY_31,
4367
+ REQUIRED_MESSAGE_STATE_32,
4368
+ REQUIRED_MESSAGE_COUNTRY_33,
4369
+ REQUIRED_MESSAGE_AREA_CODE_34,
4370
+ REQUIRED_MESSAGE_PHONE_35,
4371
+ REQUIRED_MESSAGE_CURRENCY,
4372
+ REQUIRED_MESSAGE_VALUE,
4373
+ REQUIRED_MESSAGE_BREAKUPONDCORGITEM_ID,
4374
+ REQUIRED_MESSAGE_BREAKUPONDCORGTITLE_TYPE,
4375
+ REQUIRED_MESSAGE_CURRENCY_40,
4376
+ REQUIRED_MESSAGE_VALUE_41,
4377
+ REQUIRED_MESSAGE_TTL,
4378
+ REQUIRED_MESSAGE_TYPE_43,
4379
+ REQUIRED_MESSAGE_COLLECTED_BY,
4380
+ VALID_ENUM_CONTEXT_DOMAIN,
4381
+ VALID_ENUM_MESSAGE_TYPE,
4382
+ VALID_ENUM_MESSAGE_TYPE_3,
4383
+ VALID_ENUM_MESSAGE_SETTLEMENT_COUNTERPARTY,
4384
+ VALID_ENUM_MESSAGE_BREAKUPONDCORGTITLE_TYPE,
4385
+ Validate_tag_0,
4386
+ Validate_tag_0_masked_contact,
4387
+ Validate_tag_1,
4388
+ Validate_tag_1_masked_contact,
4389
+ Validate_tag_2,
4390
+ Validate_tag_2_rider_check,
4391
+ Validate_tag_2_linked_provider,
4392
+ Validate_tag_2_fulfill_request,
4393
+ Validate_tag_2_fulfill_response,
4394
+ Validate_tag_2_linked_order,
4395
+ Validate_tag_2_linked_order_item,
4396
+ Validate_tag_3,
4397
+ Validate_tag_3_bpp_terms,
4398
+ On_init_fulfillment_id_validations,
4399
+ }
4400
+
4401
+ allResults := make([]validationutils.ValidationOutput, 0)
4402
+
4403
+ for _, testFunc := range testFunctions {
4404
+ results, err := testFunc(input)
4405
+ if err != nil {
4406
+ return nil, err
4407
+ }
4408
+ allResults = append(allResults, results...)
4409
+ }
4410
+
4411
+ subResults = allResults
4412
+ // if all subResults are valid, then valid is true
4413
+ valid = true
4414
+ for _, res := range subResults {
4415
+ if !res.Valid {
4416
+ valid = false
4417
+ break
4418
+ }
4419
+ }
4420
+
4421
+ configureDebugInfo = `NESTED_TEST_OBJECT`
4422
+
4423
+ }
4424
+
4425
+ result := validationutils.ValidationOutput{
4426
+ TestName: "On_initValidations",
4427
+ Valid: valid,
4428
+ Code: 0,
4429
+ DebugInfo: &validationutils.DebugInfo{
4430
+ FedConfig: configureDebugInfo,
4431
+ },
4432
+ }
4433
+
4434
+ if valid {
4435
+ result.Code = 200
4436
+ } else {
4437
+ result.Code = 30000
4438
+ }
4439
+
4440
+ results := make([]validationutils.ValidationOutput, 0, len(subResults)+1)
4441
+ results = append(results, result)
4442
+ results = append(results, subResults...)
4443
+
4444
+ return results, nil
4445
+ }