@koloseum/types 0.2.3 → 0.2.4

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.
@@ -2,6 +2,1732 @@ export type Json = string | number | boolean | null | {
2
2
  [key: string]: Json | undefined;
3
3
  } | Json[];
4
4
  export type Database = {
5
+ competitions: {
6
+ Tables: {
7
+ base_matches: {
8
+ Row: {
9
+ created_at: string | null;
10
+ id: string;
11
+ metadata: Json | null;
12
+ set_id: string;
13
+ };
14
+ Insert: {
15
+ created_at?: string | null;
16
+ id?: string;
17
+ metadata?: Json | null;
18
+ set_id: string;
19
+ };
20
+ Update: {
21
+ created_at?: string | null;
22
+ id?: string;
23
+ metadata?: Json | null;
24
+ set_id?: string;
25
+ };
26
+ Relationships: [
27
+ {
28
+ foreignKeyName: "base_matches_set_id_fkey";
29
+ columns: ["set_id"];
30
+ isOneToOne: false;
31
+ referencedRelation: "sets";
32
+ referencedColumns: ["id"];
33
+ }
34
+ ];
35
+ };
36
+ challenges: {
37
+ Row: {
38
+ created_at: string | null;
39
+ created_by: string;
40
+ description: string | null;
41
+ id: string;
42
+ metadata: Json | null;
43
+ name: string;
44
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
45
+ };
46
+ Insert: {
47
+ created_at?: string | null;
48
+ created_by: string;
49
+ description?: string | null;
50
+ id?: string;
51
+ metadata?: Json | null;
52
+ name: string;
53
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
54
+ };
55
+ Update: {
56
+ created_at?: string | null;
57
+ created_by?: string;
58
+ description?: string | null;
59
+ id?: string;
60
+ metadata?: Json | null;
61
+ name?: string;
62
+ participant_type?: Database["competitions"]["Enums"]["event_participant_type"];
63
+ };
64
+ Relationships: [];
65
+ };
66
+ challenges_divisions: {
67
+ Row: {
68
+ created_at: string | null;
69
+ description: string | null;
70
+ folded_at: string | null;
71
+ id: string;
72
+ metadata: Json | null;
73
+ name: string;
74
+ tier_id: string;
75
+ };
76
+ Insert: {
77
+ created_at?: string | null;
78
+ description?: string | null;
79
+ folded_at?: string | null;
80
+ id?: string;
81
+ metadata?: Json | null;
82
+ name: string;
83
+ tier_id: string;
84
+ };
85
+ Update: {
86
+ created_at?: string | null;
87
+ description?: string | null;
88
+ folded_at?: string | null;
89
+ id?: string;
90
+ metadata?: Json | null;
91
+ name?: string;
92
+ tier_id?: string;
93
+ };
94
+ Relationships: [
95
+ {
96
+ foreignKeyName: "challenges_divisions_tier_id_fkey";
97
+ columns: ["tier_id"];
98
+ isOneToOne: false;
99
+ referencedRelation: "challenges_tiers";
100
+ referencedColumns: ["id"];
101
+ }
102
+ ];
103
+ };
104
+ challenges_edition_participants: {
105
+ Row: {
106
+ created_at: string | null;
107
+ disqualification_reason: string | null;
108
+ disqualified_at: string | null;
109
+ edition_id: string;
110
+ id: string;
111
+ metadata: Json | null;
112
+ player_id: string | null;
113
+ team_id: string | null;
114
+ };
115
+ Insert: {
116
+ created_at?: string | null;
117
+ disqualification_reason?: string | null;
118
+ disqualified_at?: string | null;
119
+ edition_id: string;
120
+ id?: string;
121
+ metadata?: Json | null;
122
+ player_id?: string | null;
123
+ team_id?: string | null;
124
+ };
125
+ Update: {
126
+ created_at?: string | null;
127
+ disqualification_reason?: string | null;
128
+ disqualified_at?: string | null;
129
+ edition_id?: string;
130
+ id?: string;
131
+ metadata?: Json | null;
132
+ player_id?: string | null;
133
+ team_id?: string | null;
134
+ };
135
+ Relationships: [
136
+ {
137
+ foreignKeyName: "challenges_edition_participants_edition_id_fkey";
138
+ columns: ["edition_id"];
139
+ isOneToOne: false;
140
+ referencedRelation: "challenges_editions";
141
+ referencedColumns: ["id"];
142
+ }
143
+ ];
144
+ };
145
+ challenges_editions: {
146
+ Row: {
147
+ created_at: string | null;
148
+ description: string | null;
149
+ division_id: string;
150
+ edition_order: number;
151
+ end_time: string | null;
152
+ id: string;
153
+ metadata: Json | null;
154
+ name: string;
155
+ start_time: string | null;
156
+ venue: Json | null;
157
+ };
158
+ Insert: {
159
+ created_at?: string | null;
160
+ description?: string | null;
161
+ division_id: string;
162
+ edition_order: number;
163
+ end_time?: string | null;
164
+ id?: string;
165
+ metadata?: Json | null;
166
+ name: string;
167
+ start_time?: string | null;
168
+ venue?: Json | null;
169
+ };
170
+ Update: {
171
+ created_at?: string | null;
172
+ description?: string | null;
173
+ division_id?: string;
174
+ edition_order?: number;
175
+ end_time?: string | null;
176
+ id?: string;
177
+ metadata?: Json | null;
178
+ name?: string;
179
+ start_time?: string | null;
180
+ venue?: Json | null;
181
+ };
182
+ Relationships: [
183
+ {
184
+ foreignKeyName: "challenges_editions_division_id_fkey";
185
+ columns: ["division_id"];
186
+ isOneToOne: false;
187
+ referencedRelation: "challenges_divisions";
188
+ referencedColumns: ["id"];
189
+ }
190
+ ];
191
+ };
192
+ challenges_organisers: {
193
+ Row: {
194
+ challenges_id: string;
195
+ created_at: string;
196
+ organiser_id: string;
197
+ };
198
+ Insert: {
199
+ challenges_id: string;
200
+ created_at?: string;
201
+ organiser_id: string;
202
+ };
203
+ Update: {
204
+ challenges_id?: string;
205
+ created_at?: string;
206
+ organiser_id?: string;
207
+ };
208
+ Relationships: [
209
+ {
210
+ foreignKeyName: "challenges_organisers_challenges_id_fkey";
211
+ columns: ["challenges_id"];
212
+ isOneToOne: false;
213
+ referencedRelation: "challenges";
214
+ referencedColumns: ["id"];
215
+ }
216
+ ];
217
+ };
218
+ challenges_organisers_staff: {
219
+ Row: {
220
+ challenges_id: string;
221
+ created_at: string;
222
+ organiser_id: string;
223
+ permission: string;
224
+ user_id: string;
225
+ };
226
+ Insert: {
227
+ challenges_id: string;
228
+ created_at?: string;
229
+ organiser_id: string;
230
+ permission: string;
231
+ user_id: string;
232
+ };
233
+ Update: {
234
+ challenges_id?: string;
235
+ created_at?: string;
236
+ organiser_id?: string;
237
+ permission?: string;
238
+ user_id?: string;
239
+ };
240
+ Relationships: [
241
+ {
242
+ foreignKeyName: "challenges_organisers_staff_challenges_id_fkey";
243
+ columns: ["challenges_id"];
244
+ isOneToOne: false;
245
+ referencedRelation: "challenges";
246
+ referencedColumns: ["id"];
247
+ }
248
+ ];
249
+ };
250
+ challenges_phases: {
251
+ Row: {
252
+ created_at: string | null;
253
+ edition_id: string;
254
+ end_time: string | null;
255
+ event_id: string;
256
+ id: string;
257
+ metadata: Json | null;
258
+ name: string;
259
+ phase_order: number | null;
260
+ start_time: string | null;
261
+ };
262
+ Insert: {
263
+ created_at?: string | null;
264
+ edition_id: string;
265
+ end_time?: string | null;
266
+ event_id: string;
267
+ id?: string;
268
+ metadata?: Json | null;
269
+ name: string;
270
+ phase_order?: number | null;
271
+ start_time?: string | null;
272
+ };
273
+ Update: {
274
+ created_at?: string | null;
275
+ edition_id?: string;
276
+ end_time?: string | null;
277
+ event_id?: string;
278
+ id?: string;
279
+ metadata?: Json | null;
280
+ name?: string;
281
+ phase_order?: number | null;
282
+ start_time?: string | null;
283
+ };
284
+ Relationships: [
285
+ {
286
+ foreignKeyName: "challenges_phases_edition_id_fkey";
287
+ columns: ["edition_id"];
288
+ isOneToOne: false;
289
+ referencedRelation: "challenges_editions";
290
+ referencedColumns: ["id"];
291
+ },
292
+ {
293
+ foreignKeyName: "challenges_phases_event_id_fkey";
294
+ columns: ["event_id"];
295
+ isOneToOne: false;
296
+ referencedRelation: "events";
297
+ referencedColumns: ["id"];
298
+ }
299
+ ];
300
+ };
301
+ challenges_rankings: {
302
+ Row: {
303
+ challenges_id: string;
304
+ edition_id: string;
305
+ event_id: string;
306
+ event_participant_id: string;
307
+ ranking: number;
308
+ };
309
+ Insert: {
310
+ challenges_id: string;
311
+ edition_id: string;
312
+ event_id: string;
313
+ event_participant_id: string;
314
+ ranking: number;
315
+ };
316
+ Update: {
317
+ challenges_id?: string;
318
+ edition_id?: string;
319
+ event_id?: string;
320
+ event_participant_id?: string;
321
+ ranking?: number;
322
+ };
323
+ Relationships: [
324
+ {
325
+ foreignKeyName: "challenges_rankings_challenges_id_fkey";
326
+ columns: ["challenges_id"];
327
+ isOneToOne: false;
328
+ referencedRelation: "challenges";
329
+ referencedColumns: ["id"];
330
+ },
331
+ {
332
+ foreignKeyName: "challenges_rankings_edition_id_fkey";
333
+ columns: ["edition_id"];
334
+ isOneToOne: false;
335
+ referencedRelation: "challenges_editions";
336
+ referencedColumns: ["id"];
337
+ },
338
+ {
339
+ foreignKeyName: "challenges_rankings_event_id_fkey";
340
+ columns: ["event_id"];
341
+ isOneToOne: false;
342
+ referencedRelation: "events";
343
+ referencedColumns: ["id"];
344
+ },
345
+ {
346
+ foreignKeyName: "challenges_rankings_event_participant_id_fkey";
347
+ columns: ["event_participant_id"];
348
+ isOneToOne: false;
349
+ referencedRelation: "event_participants";
350
+ referencedColumns: ["id"];
351
+ }
352
+ ];
353
+ };
354
+ challenges_tiers: {
355
+ Row: {
356
+ challenges_id: string;
357
+ created_at: string | null;
358
+ description: string | null;
359
+ folded_at: string | null;
360
+ id: string;
361
+ metadata: Json | null;
362
+ name: string;
363
+ tier_order: number;
364
+ };
365
+ Insert: {
366
+ challenges_id: string;
367
+ created_at?: string | null;
368
+ description?: string | null;
369
+ folded_at?: string | null;
370
+ id?: string;
371
+ metadata?: Json | null;
372
+ name: string;
373
+ tier_order: number;
374
+ };
375
+ Update: {
376
+ challenges_id?: string;
377
+ created_at?: string | null;
378
+ description?: string | null;
379
+ folded_at?: string | null;
380
+ id?: string;
381
+ metadata?: Json | null;
382
+ name?: string;
383
+ tier_order?: number;
384
+ };
385
+ Relationships: [
386
+ {
387
+ foreignKeyName: "challenges_tiers_challenges_id_fkey";
388
+ columns: ["challenges_id"];
389
+ isOneToOne: false;
390
+ referencedRelation: "challenges";
391
+ referencedColumns: ["id"];
392
+ }
393
+ ];
394
+ };
395
+ competition_penalties: {
396
+ Row: {
397
+ applied_at: string;
398
+ applied_by: string;
399
+ challenges_id: string | null;
400
+ created_at: string;
401
+ event_id: string | null;
402
+ event_participant_id: string | null;
403
+ expires_at: string | null;
404
+ id: string;
405
+ league_id: string | null;
406
+ locals_tournament_id: string | null;
407
+ metadata: Json | null;
408
+ penalty_amount: number | null;
409
+ penalty_type: string;
410
+ player_id: string | null;
411
+ reason: string;
412
+ team_id: string | null;
413
+ };
414
+ Insert: {
415
+ applied_at?: string;
416
+ applied_by: string;
417
+ challenges_id?: string | null;
418
+ created_at?: string;
419
+ event_id?: string | null;
420
+ event_participant_id?: string | null;
421
+ expires_at?: string | null;
422
+ id?: string;
423
+ league_id?: string | null;
424
+ locals_tournament_id?: string | null;
425
+ metadata?: Json | null;
426
+ penalty_amount?: number | null;
427
+ penalty_type: string;
428
+ player_id?: string | null;
429
+ reason: string;
430
+ team_id?: string | null;
431
+ };
432
+ Update: {
433
+ applied_at?: string;
434
+ applied_by?: string;
435
+ challenges_id?: string | null;
436
+ created_at?: string;
437
+ event_id?: string | null;
438
+ event_participant_id?: string | null;
439
+ expires_at?: string | null;
440
+ id?: string;
441
+ league_id?: string | null;
442
+ locals_tournament_id?: string | null;
443
+ metadata?: Json | null;
444
+ penalty_amount?: number | null;
445
+ penalty_type?: string;
446
+ player_id?: string | null;
447
+ reason?: string;
448
+ team_id?: string | null;
449
+ };
450
+ Relationships: [
451
+ {
452
+ foreignKeyName: "competition_penalties_challenges_id_fkey";
453
+ columns: ["challenges_id"];
454
+ isOneToOne: false;
455
+ referencedRelation: "challenges";
456
+ referencedColumns: ["id"];
457
+ },
458
+ {
459
+ foreignKeyName: "competition_penalties_event_id_fkey";
460
+ columns: ["event_id"];
461
+ isOneToOne: false;
462
+ referencedRelation: "events";
463
+ referencedColumns: ["id"];
464
+ },
465
+ {
466
+ foreignKeyName: "competition_penalties_event_participant_id_fkey";
467
+ columns: ["event_participant_id"];
468
+ isOneToOne: false;
469
+ referencedRelation: "event_participants";
470
+ referencedColumns: ["id"];
471
+ },
472
+ {
473
+ foreignKeyName: "competition_penalties_league_id_fkey";
474
+ columns: ["league_id"];
475
+ isOneToOne: false;
476
+ referencedRelation: "leagues";
477
+ referencedColumns: ["id"];
478
+ },
479
+ {
480
+ foreignKeyName: "competition_penalties_locals_tournament_id_fkey";
481
+ columns: ["locals_tournament_id"];
482
+ isOneToOne: false;
483
+ referencedRelation: "locals_tournaments";
484
+ referencedColumns: ["id"];
485
+ }
486
+ ];
487
+ };
488
+ event_participants: {
489
+ Row: {
490
+ checked_in_at: string | null;
491
+ created_at: string | null;
492
+ disqualification_reason: string | null;
493
+ disqualified_at: string | null;
494
+ event_id: string;
495
+ id: string;
496
+ metadata: Json | null;
497
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
498
+ player_id: string | null;
499
+ team_id: string | null;
500
+ };
501
+ Insert: {
502
+ checked_in_at?: string | null;
503
+ created_at?: string | null;
504
+ disqualification_reason?: string | null;
505
+ disqualified_at?: string | null;
506
+ event_id: string;
507
+ id?: string;
508
+ metadata?: Json | null;
509
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
510
+ player_id?: string | null;
511
+ team_id?: string | null;
512
+ };
513
+ Update: {
514
+ checked_in_at?: string | null;
515
+ created_at?: string | null;
516
+ disqualification_reason?: string | null;
517
+ disqualified_at?: string | null;
518
+ event_id?: string;
519
+ id?: string;
520
+ metadata?: Json | null;
521
+ participant_type?: Database["competitions"]["Enums"]["event_participant_type"];
522
+ player_id?: string | null;
523
+ team_id?: string | null;
524
+ };
525
+ Relationships: [
526
+ {
527
+ foreignKeyName: "event_participants_event_id_fkey";
528
+ columns: ["event_id"];
529
+ isOneToOne: false;
530
+ referencedRelation: "events";
531
+ referencedColumns: ["id"];
532
+ }
533
+ ];
534
+ };
535
+ events: {
536
+ Row: {
537
+ challenges_edition_id: string | null;
538
+ check_in_buffer: unknown | null;
539
+ check_in_duration: unknown | null;
540
+ console_id: string | null;
541
+ created_at: string | null;
542
+ description: string | null;
543
+ end_time: string | null;
544
+ game_id: string | null;
545
+ game_title: string | null;
546
+ id: string;
547
+ is_online: boolean | null;
548
+ league_tournament_id: string | null;
549
+ locals_tournament_id: string | null;
550
+ lounge_branch_id: string | null;
551
+ metadata: Json | null;
552
+ name: string;
553
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
554
+ start_time: string | null;
555
+ status: Database["competitions"]["Enums"]["event_status"] | null;
556
+ venue: Json | null;
557
+ };
558
+ Insert: {
559
+ challenges_edition_id?: string | null;
560
+ check_in_buffer?: unknown | null;
561
+ check_in_duration?: unknown | null;
562
+ console_id?: string | null;
563
+ created_at?: string | null;
564
+ description?: string | null;
565
+ end_time?: string | null;
566
+ game_id?: string | null;
567
+ game_title?: string | null;
568
+ id?: string;
569
+ is_online?: boolean | null;
570
+ league_tournament_id?: string | null;
571
+ locals_tournament_id?: string | null;
572
+ lounge_branch_id?: string | null;
573
+ metadata?: Json | null;
574
+ name: string;
575
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
576
+ start_time?: string | null;
577
+ status?: Database["competitions"]["Enums"]["event_status"] | null;
578
+ venue?: Json | null;
579
+ };
580
+ Update: {
581
+ challenges_edition_id?: string | null;
582
+ check_in_buffer?: unknown | null;
583
+ check_in_duration?: unknown | null;
584
+ console_id?: string | null;
585
+ created_at?: string | null;
586
+ description?: string | null;
587
+ end_time?: string | null;
588
+ game_id?: string | null;
589
+ game_title?: string | null;
590
+ id?: string;
591
+ is_online?: boolean | null;
592
+ league_tournament_id?: string | null;
593
+ locals_tournament_id?: string | null;
594
+ lounge_branch_id?: string | null;
595
+ metadata?: Json | null;
596
+ name?: string;
597
+ participant_type?: Database["competitions"]["Enums"]["event_participant_type"];
598
+ start_time?: string | null;
599
+ status?: Database["competitions"]["Enums"]["event_status"] | null;
600
+ venue?: Json | null;
601
+ };
602
+ Relationships: [
603
+ {
604
+ foreignKeyName: "events_challenges_edition_id_fkey";
605
+ columns: ["challenges_edition_id"];
606
+ isOneToOne: false;
607
+ referencedRelation: "challenges_editions";
608
+ referencedColumns: ["id"];
609
+ },
610
+ {
611
+ foreignKeyName: "events_league_tournament_id_fkey";
612
+ columns: ["league_tournament_id"];
613
+ isOneToOne: false;
614
+ referencedRelation: "league_tournaments";
615
+ referencedColumns: ["id"];
616
+ },
617
+ {
618
+ foreignKeyName: "events_locals_tournament_id_fkey";
619
+ columns: ["locals_tournament_id"];
620
+ isOneToOne: false;
621
+ referencedRelation: "locals_tournaments";
622
+ referencedColumns: ["id"];
623
+ }
624
+ ];
625
+ };
626
+ external_providers: {
627
+ Row: {
628
+ created_at: string | null;
629
+ metadata: Json | null;
630
+ provider: string;
631
+ provider_id: string;
632
+ user_id: string;
633
+ };
634
+ Insert: {
635
+ created_at?: string | null;
636
+ metadata?: Json | null;
637
+ provider: string;
638
+ provider_id: string;
639
+ user_id: string;
640
+ };
641
+ Update: {
642
+ created_at?: string | null;
643
+ metadata?: Json | null;
644
+ provider?: string;
645
+ provider_id?: string;
646
+ user_id?: string;
647
+ };
648
+ Relationships: [];
649
+ };
650
+ fighting_game_match_rounds: {
651
+ Row: {
652
+ created_at: string | null;
653
+ duration: unknown | null;
654
+ fighting_game_match_id: string;
655
+ metadata: Json | null;
656
+ round_number: number;
657
+ winner_id: string | null;
658
+ };
659
+ Insert: {
660
+ created_at?: string | null;
661
+ duration?: unknown | null;
662
+ fighting_game_match_id: string;
663
+ metadata?: Json | null;
664
+ round_number: number;
665
+ winner_id?: string | null;
666
+ };
667
+ Update: {
668
+ created_at?: string | null;
669
+ duration?: unknown | null;
670
+ fighting_game_match_id?: string;
671
+ metadata?: Json | null;
672
+ round_number?: number;
673
+ winner_id?: string | null;
674
+ };
675
+ Relationships: [
676
+ {
677
+ foreignKeyName: "fighting_game_match_rounds_fighting_game_match_id_fkey";
678
+ columns: ["fighting_game_match_id"];
679
+ isOneToOne: false;
680
+ referencedRelation: "fighting_game_matches";
681
+ referencedColumns: ["id"];
682
+ },
683
+ {
684
+ foreignKeyName: "fighting_game_match_rounds_winner_id_fkey";
685
+ columns: ["winner_id"];
686
+ isOneToOne: false;
687
+ referencedRelation: "event_participants";
688
+ referencedColumns: ["id"];
689
+ }
690
+ ];
691
+ };
692
+ fighting_game_matches: {
693
+ Row: {
694
+ characters1_ids: string[];
695
+ characters2_ids: string[];
696
+ created_at: string | null;
697
+ generic_match_id: string;
698
+ id: string;
699
+ };
700
+ Insert: {
701
+ characters1_ids: string[];
702
+ characters2_ids: string[];
703
+ created_at?: string | null;
704
+ generic_match_id: string;
705
+ id?: string;
706
+ };
707
+ Update: {
708
+ characters1_ids?: string[];
709
+ characters2_ids?: string[];
710
+ created_at?: string | null;
711
+ generic_match_id?: string;
712
+ id?: string;
713
+ };
714
+ Relationships: [
715
+ {
716
+ foreignKeyName: "fighting_game_matches_generic_match_id_fkey";
717
+ columns: ["generic_match_id"];
718
+ isOneToOne: false;
719
+ referencedRelation: "generic_matches";
720
+ referencedColumns: ["id"];
721
+ }
722
+ ];
723
+ };
724
+ football_match_goals: {
725
+ Row: {
726
+ created_at: string | null;
727
+ generic_match_id: string;
728
+ goal_number: number;
729
+ scorer_id: string;
730
+ time_scored: unknown;
731
+ };
732
+ Insert: {
733
+ created_at?: string | null;
734
+ generic_match_id: string;
735
+ goal_number: number;
736
+ scorer_id: string;
737
+ time_scored: unknown;
738
+ };
739
+ Update: {
740
+ created_at?: string | null;
741
+ generic_match_id?: string;
742
+ goal_number?: number;
743
+ scorer_id?: string;
744
+ time_scored?: unknown;
745
+ };
746
+ Relationships: [
747
+ {
748
+ foreignKeyName: "football_match_goals_generic_match_id_fkey";
749
+ columns: ["generic_match_id"];
750
+ isOneToOne: false;
751
+ referencedRelation: "generic_matches";
752
+ referencedColumns: ["id"];
753
+ },
754
+ {
755
+ foreignKeyName: "football_match_goals_scorer_id_fkey";
756
+ columns: ["scorer_id"];
757
+ isOneToOne: false;
758
+ referencedRelation: "event_participants";
759
+ referencedColumns: ["id"];
760
+ }
761
+ ];
762
+ };
763
+ generic_matches: {
764
+ Row: {
765
+ base_match_id: string;
766
+ created_at: string | null;
767
+ id: string;
768
+ participant1_id: string;
769
+ participant2_id: string;
770
+ score1: number;
771
+ score2: number;
772
+ winner_id: string | null;
773
+ };
774
+ Insert: {
775
+ base_match_id: string;
776
+ created_at?: string | null;
777
+ id?: string;
778
+ participant1_id: string;
779
+ participant2_id: string;
780
+ score1: number;
781
+ score2: number;
782
+ winner_id?: string | null;
783
+ };
784
+ Update: {
785
+ base_match_id?: string;
786
+ created_at?: string | null;
787
+ id?: string;
788
+ participant1_id?: string;
789
+ participant2_id?: string;
790
+ score1?: number;
791
+ score2?: number;
792
+ winner_id?: string | null;
793
+ };
794
+ Relationships: [
795
+ {
796
+ foreignKeyName: "generic_matches_base_match_id_fkey";
797
+ columns: ["base_match_id"];
798
+ isOneToOne: false;
799
+ referencedRelation: "base_matches";
800
+ referencedColumns: ["id"];
801
+ },
802
+ {
803
+ foreignKeyName: "generic_matches_participant1_id_fkey";
804
+ columns: ["participant1_id"];
805
+ isOneToOne: false;
806
+ referencedRelation: "event_participants";
807
+ referencedColumns: ["id"];
808
+ },
809
+ {
810
+ foreignKeyName: "generic_matches_participant2_id_fkey";
811
+ columns: ["participant2_id"];
812
+ isOneToOne: false;
813
+ referencedRelation: "event_participants";
814
+ referencedColumns: ["id"];
815
+ },
816
+ {
817
+ foreignKeyName: "generic_matches_winner_id_fkey";
818
+ columns: ["winner_id"];
819
+ isOneToOne: false;
820
+ referencedRelation: "event_participants";
821
+ referencedColumns: ["id"];
822
+ }
823
+ ];
824
+ };
825
+ league_divisions: {
826
+ Row: {
827
+ created_at: string;
828
+ description: string | null;
829
+ folded_at: string | null;
830
+ id: string;
831
+ metadata: Json | null;
832
+ name: string;
833
+ tier_id: string;
834
+ };
835
+ Insert: {
836
+ created_at?: string;
837
+ description?: string | null;
838
+ folded_at?: string | null;
839
+ id?: string;
840
+ metadata?: Json | null;
841
+ name: string;
842
+ tier_id: string;
843
+ };
844
+ Update: {
845
+ created_at?: string;
846
+ description?: string | null;
847
+ folded_at?: string | null;
848
+ id?: string;
849
+ metadata?: Json | null;
850
+ name?: string;
851
+ tier_id?: string;
852
+ };
853
+ Relationships: [
854
+ {
855
+ foreignKeyName: "league_divisions_tier_id_fkey";
856
+ columns: ["tier_id"];
857
+ isOneToOne: false;
858
+ referencedRelation: "league_tiers";
859
+ referencedColumns: ["id"];
860
+ }
861
+ ];
862
+ };
863
+ league_promotion_relegation_rules: {
864
+ Row: {
865
+ conditions: Json | null;
866
+ created_at: string;
867
+ description: string | null;
868
+ id: string;
869
+ league_id: string;
870
+ promotion_count: number | null;
871
+ relegation_count: number | null;
872
+ };
873
+ Insert: {
874
+ conditions?: Json | null;
875
+ created_at?: string;
876
+ description?: string | null;
877
+ id?: string;
878
+ league_id: string;
879
+ promotion_count?: number | null;
880
+ relegation_count?: number | null;
881
+ };
882
+ Update: {
883
+ conditions?: Json | null;
884
+ created_at?: string;
885
+ description?: string | null;
886
+ id?: string;
887
+ league_id?: string;
888
+ promotion_count?: number | null;
889
+ relegation_count?: number | null;
890
+ };
891
+ Relationships: [
892
+ {
893
+ foreignKeyName: "league_promotion_relegation_rules_league_id_fkey";
894
+ columns: ["league_id"];
895
+ isOneToOne: false;
896
+ referencedRelation: "leagues";
897
+ referencedColumns: ["id"];
898
+ }
899
+ ];
900
+ };
901
+ league_rankings: {
902
+ Row: {
903
+ event_id: string;
904
+ event_participant_id: string;
905
+ league_id: string;
906
+ points: number;
907
+ season_id: string;
908
+ };
909
+ Insert: {
910
+ event_id: string;
911
+ event_participant_id: string;
912
+ league_id: string;
913
+ points?: number;
914
+ season_id: string;
915
+ };
916
+ Update: {
917
+ event_id?: string;
918
+ event_participant_id?: string;
919
+ league_id?: string;
920
+ points?: number;
921
+ season_id?: string;
922
+ };
923
+ Relationships: [
924
+ {
925
+ foreignKeyName: "league_rankings_event_id_fkey";
926
+ columns: ["event_id"];
927
+ isOneToOne: false;
928
+ referencedRelation: "events";
929
+ referencedColumns: ["id"];
930
+ },
931
+ {
932
+ foreignKeyName: "league_rankings_event_participant_id_fkey";
933
+ columns: ["event_participant_id"];
934
+ isOneToOne: false;
935
+ referencedRelation: "event_participants";
936
+ referencedColumns: ["id"];
937
+ },
938
+ {
939
+ foreignKeyName: "league_rankings_league_id_fkey";
940
+ columns: ["league_id"];
941
+ isOneToOne: false;
942
+ referencedRelation: "leagues";
943
+ referencedColumns: ["id"];
944
+ },
945
+ {
946
+ foreignKeyName: "league_rankings_season_id_fkey";
947
+ columns: ["season_id"];
948
+ isOneToOne: false;
949
+ referencedRelation: "league_seasons";
950
+ referencedColumns: ["id"];
951
+ }
952
+ ];
953
+ };
954
+ league_season_participants: {
955
+ Row: {
956
+ created_at: string | null;
957
+ disqualification_reason: string | null;
958
+ disqualified_at: string | null;
959
+ id: string;
960
+ metadata: Json | null;
961
+ player_id: string | null;
962
+ season_id: string;
963
+ team_id: string | null;
964
+ };
965
+ Insert: {
966
+ created_at?: string | null;
967
+ disqualification_reason?: string | null;
968
+ disqualified_at?: string | null;
969
+ id?: string;
970
+ metadata?: Json | null;
971
+ player_id?: string | null;
972
+ season_id: string;
973
+ team_id?: string | null;
974
+ };
975
+ Update: {
976
+ created_at?: string | null;
977
+ disqualification_reason?: string | null;
978
+ disqualified_at?: string | null;
979
+ id?: string;
980
+ metadata?: Json | null;
981
+ player_id?: string | null;
982
+ season_id?: string;
983
+ team_id?: string | null;
984
+ };
985
+ Relationships: [
986
+ {
987
+ foreignKeyName: "league_season_participants_season_id_fkey";
988
+ columns: ["season_id"];
989
+ isOneToOne: false;
990
+ referencedRelation: "league_seasons";
991
+ referencedColumns: ["id"];
992
+ }
993
+ ];
994
+ };
995
+ league_seasons: {
996
+ Row: {
997
+ cancelled_at: string | null;
998
+ created_at: string;
999
+ description: string | null;
1000
+ division_id: string;
1001
+ end_date: string | null;
1002
+ id: string;
1003
+ metadata: Json | null;
1004
+ name: string;
1005
+ season_order: number;
1006
+ start_date: string | null;
1007
+ status: Database["competitions"]["Enums"]["event_status"] | null;
1008
+ suspended_at: string | null;
1009
+ };
1010
+ Insert: {
1011
+ cancelled_at?: string | null;
1012
+ created_at?: string;
1013
+ description?: string | null;
1014
+ division_id: string;
1015
+ end_date?: string | null;
1016
+ id?: string;
1017
+ metadata?: Json | null;
1018
+ name: string;
1019
+ season_order: number;
1020
+ start_date?: string | null;
1021
+ status?: Database["competitions"]["Enums"]["event_status"] | null;
1022
+ suspended_at?: string | null;
1023
+ };
1024
+ Update: {
1025
+ cancelled_at?: string | null;
1026
+ created_at?: string;
1027
+ description?: string | null;
1028
+ division_id?: string;
1029
+ end_date?: string | null;
1030
+ id?: string;
1031
+ metadata?: Json | null;
1032
+ name?: string;
1033
+ season_order?: number;
1034
+ start_date?: string | null;
1035
+ status?: Database["competitions"]["Enums"]["event_status"] | null;
1036
+ suspended_at?: string | null;
1037
+ };
1038
+ Relationships: [
1039
+ {
1040
+ foreignKeyName: "league_seasons_division_id_fkey";
1041
+ columns: ["division_id"];
1042
+ isOneToOne: false;
1043
+ referencedRelation: "league_divisions";
1044
+ referencedColumns: ["id"];
1045
+ }
1046
+ ];
1047
+ };
1048
+ league_tiers: {
1049
+ Row: {
1050
+ created_at: string;
1051
+ description: string | null;
1052
+ folded_at: string | null;
1053
+ id: string;
1054
+ league_id: string;
1055
+ metadata: Json | null;
1056
+ name: string;
1057
+ tier_order: number;
1058
+ };
1059
+ Insert: {
1060
+ created_at?: string;
1061
+ description?: string | null;
1062
+ folded_at?: string | null;
1063
+ id?: string;
1064
+ league_id: string;
1065
+ metadata?: Json | null;
1066
+ name: string;
1067
+ tier_order: number;
1068
+ };
1069
+ Update: {
1070
+ created_at?: string;
1071
+ description?: string | null;
1072
+ folded_at?: string | null;
1073
+ id?: string;
1074
+ league_id?: string;
1075
+ metadata?: Json | null;
1076
+ name?: string;
1077
+ tier_order?: number;
1078
+ };
1079
+ Relationships: [
1080
+ {
1081
+ foreignKeyName: "league_tiers_league_id_fkey";
1082
+ columns: ["league_id"];
1083
+ isOneToOne: false;
1084
+ referencedRelation: "leagues";
1085
+ referencedColumns: ["id"];
1086
+ }
1087
+ ];
1088
+ };
1089
+ league_tournaments: {
1090
+ Row: {
1091
+ created_at: string;
1092
+ description: string | null;
1093
+ end_time: string | null;
1094
+ id: string;
1095
+ metadata: Json | null;
1096
+ name: string;
1097
+ season_id: string;
1098
+ start_time: string | null;
1099
+ venue: Json | null;
1100
+ };
1101
+ Insert: {
1102
+ created_at?: string;
1103
+ description?: string | null;
1104
+ end_time?: string | null;
1105
+ id?: string;
1106
+ metadata?: Json | null;
1107
+ name: string;
1108
+ season_id: string;
1109
+ start_time?: string | null;
1110
+ venue?: Json | null;
1111
+ };
1112
+ Update: {
1113
+ created_at?: string;
1114
+ description?: string | null;
1115
+ end_time?: string | null;
1116
+ id?: string;
1117
+ metadata?: Json | null;
1118
+ name?: string;
1119
+ season_id?: string;
1120
+ start_time?: string | null;
1121
+ venue?: Json | null;
1122
+ };
1123
+ Relationships: [
1124
+ {
1125
+ foreignKeyName: "league_tournaments_season_id_fkey";
1126
+ columns: ["season_id"];
1127
+ isOneToOne: false;
1128
+ referencedRelation: "league_seasons";
1129
+ referencedColumns: ["id"];
1130
+ }
1131
+ ];
1132
+ };
1133
+ leagues: {
1134
+ Row: {
1135
+ created_at: string;
1136
+ created_by: string;
1137
+ description: string | null;
1138
+ id: string;
1139
+ metadata: Json | null;
1140
+ name: string;
1141
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1142
+ };
1143
+ Insert: {
1144
+ created_at?: string;
1145
+ created_by: string;
1146
+ description?: string | null;
1147
+ id?: string;
1148
+ metadata?: Json | null;
1149
+ name: string;
1150
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1151
+ };
1152
+ Update: {
1153
+ created_at?: string;
1154
+ created_by?: string;
1155
+ description?: string | null;
1156
+ id?: string;
1157
+ metadata?: Json | null;
1158
+ name?: string;
1159
+ participant_type?: Database["competitions"]["Enums"]["event_participant_type"];
1160
+ };
1161
+ Relationships: [];
1162
+ };
1163
+ leagues_organisers: {
1164
+ Row: {
1165
+ created_at: string;
1166
+ league_id: string;
1167
+ organiser_id: string;
1168
+ };
1169
+ Insert: {
1170
+ created_at?: string;
1171
+ league_id: string;
1172
+ organiser_id: string;
1173
+ };
1174
+ Update: {
1175
+ created_at?: string;
1176
+ league_id?: string;
1177
+ organiser_id?: string;
1178
+ };
1179
+ Relationships: [
1180
+ {
1181
+ foreignKeyName: "leagues_organisers_league_id_fkey";
1182
+ columns: ["league_id"];
1183
+ isOneToOne: false;
1184
+ referencedRelation: "leagues";
1185
+ referencedColumns: ["id"];
1186
+ }
1187
+ ];
1188
+ };
1189
+ leagues_organisers_staff: {
1190
+ Row: {
1191
+ created_at: string;
1192
+ league_id: string;
1193
+ organiser_id: string;
1194
+ permission: string;
1195
+ user_id: string;
1196
+ };
1197
+ Insert: {
1198
+ created_at?: string;
1199
+ league_id: string;
1200
+ organiser_id: string;
1201
+ permission: string;
1202
+ user_id: string;
1203
+ };
1204
+ Update: {
1205
+ created_at?: string;
1206
+ league_id?: string;
1207
+ organiser_id?: string;
1208
+ permission?: string;
1209
+ user_id?: string;
1210
+ };
1211
+ Relationships: [
1212
+ {
1213
+ foreignKeyName: "leagues_organisers_staff_league_id_fkey";
1214
+ columns: ["league_id"];
1215
+ isOneToOne: false;
1216
+ referencedRelation: "leagues";
1217
+ referencedColumns: ["id"];
1218
+ }
1219
+ ];
1220
+ };
1221
+ locals_organisers: {
1222
+ Row: {
1223
+ created_at: string;
1224
+ locals_tournament_id: string;
1225
+ organiser_id: string;
1226
+ };
1227
+ Insert: {
1228
+ created_at?: string;
1229
+ locals_tournament_id: string;
1230
+ organiser_id: string;
1231
+ };
1232
+ Update: {
1233
+ created_at?: string;
1234
+ locals_tournament_id?: string;
1235
+ organiser_id?: string;
1236
+ };
1237
+ Relationships: [
1238
+ {
1239
+ foreignKeyName: "locals_organisers_locals_tournament_id_fkey";
1240
+ columns: ["locals_tournament_id"];
1241
+ isOneToOne: false;
1242
+ referencedRelation: "locals_tournaments";
1243
+ referencedColumns: ["id"];
1244
+ }
1245
+ ];
1246
+ };
1247
+ locals_organisers_staff: {
1248
+ Row: {
1249
+ created_at: string;
1250
+ locals_tournament_id: string;
1251
+ organiser_id: string;
1252
+ permission: string;
1253
+ user_id: string;
1254
+ };
1255
+ Insert: {
1256
+ created_at?: string;
1257
+ locals_tournament_id: string;
1258
+ organiser_id: string;
1259
+ permission: string;
1260
+ user_id: string;
1261
+ };
1262
+ Update: {
1263
+ created_at?: string;
1264
+ locals_tournament_id?: string;
1265
+ organiser_id?: string;
1266
+ permission?: string;
1267
+ user_id?: string;
1268
+ };
1269
+ Relationships: [];
1270
+ };
1271
+ locals_tournaments: {
1272
+ Row: {
1273
+ created_at: string;
1274
+ created_by: string;
1275
+ description: string | null;
1276
+ end_time: string | null;
1277
+ id: string;
1278
+ metadata: Json | null;
1279
+ name: string;
1280
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1281
+ start_time: string | null;
1282
+ venue: Json | null;
1283
+ };
1284
+ Insert: {
1285
+ created_at?: string;
1286
+ created_by: string;
1287
+ description?: string | null;
1288
+ end_time?: string | null;
1289
+ id?: string;
1290
+ metadata?: Json | null;
1291
+ name: string;
1292
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1293
+ start_time?: string | null;
1294
+ venue?: Json | null;
1295
+ };
1296
+ Update: {
1297
+ created_at?: string;
1298
+ created_by?: string;
1299
+ description?: string | null;
1300
+ end_time?: string | null;
1301
+ id?: string;
1302
+ metadata?: Json | null;
1303
+ name?: string;
1304
+ participant_type?: Database["competitions"]["Enums"]["event_participant_type"];
1305
+ start_time?: string | null;
1306
+ venue?: Json | null;
1307
+ };
1308
+ Relationships: [];
1309
+ };
1310
+ phase_entrants: {
1311
+ Row: {
1312
+ created_at: string | null;
1313
+ event_participant_id: string;
1314
+ phase_id: string;
1315
+ registration_status: Database["competitions"]["Enums"]["phase_registration_status"];
1316
+ };
1317
+ Insert: {
1318
+ created_at?: string | null;
1319
+ event_participant_id: string;
1320
+ phase_id: string;
1321
+ registration_status?: Database["competitions"]["Enums"]["phase_registration_status"];
1322
+ };
1323
+ Update: {
1324
+ created_at?: string | null;
1325
+ event_participant_id?: string;
1326
+ phase_id?: string;
1327
+ registration_status?: Database["competitions"]["Enums"]["phase_registration_status"];
1328
+ };
1329
+ Relationships: [
1330
+ {
1331
+ foreignKeyName: "phase_entrants_event_participant_id_fkey";
1332
+ columns: ["event_participant_id"];
1333
+ isOneToOne: false;
1334
+ referencedRelation: "event_participants";
1335
+ referencedColumns: ["id"];
1336
+ },
1337
+ {
1338
+ foreignKeyName: "phase_entrants_phase_id_fkey";
1339
+ columns: ["phase_id"];
1340
+ isOneToOne: false;
1341
+ referencedRelation: "phases";
1342
+ referencedColumns: ["id"];
1343
+ }
1344
+ ];
1345
+ };
1346
+ phase_groups: {
1347
+ Row: {
1348
+ created_at: string | null;
1349
+ display_order: number | null;
1350
+ id: string;
1351
+ name: string;
1352
+ phase_id: string;
1353
+ };
1354
+ Insert: {
1355
+ created_at?: string | null;
1356
+ display_order?: number | null;
1357
+ id?: string;
1358
+ name: string;
1359
+ phase_id: string;
1360
+ };
1361
+ Update: {
1362
+ created_at?: string | null;
1363
+ display_order?: number | null;
1364
+ id?: string;
1365
+ name?: string;
1366
+ phase_id?: string;
1367
+ };
1368
+ Relationships: [
1369
+ {
1370
+ foreignKeyName: "phase_groups_phase_id_fkey";
1371
+ columns: ["phase_id"];
1372
+ isOneToOne: false;
1373
+ referencedRelation: "phases";
1374
+ referencedColumns: ["id"];
1375
+ }
1376
+ ];
1377
+ };
1378
+ phase_seeding_configurations: {
1379
+ Row: {
1380
+ allocation_method: string;
1381
+ configuration: Json | null;
1382
+ created_at: string | null;
1383
+ event_id: string;
1384
+ id: string;
1385
+ number_of_pots: number;
1386
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1387
+ phase_id: string;
1388
+ players_per_pot: number;
1389
+ source_phase_id: string | null;
1390
+ };
1391
+ Insert: {
1392
+ allocation_method: string;
1393
+ configuration?: Json | null;
1394
+ created_at?: string | null;
1395
+ event_id: string;
1396
+ id?: string;
1397
+ number_of_pots: number;
1398
+ participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1399
+ phase_id: string;
1400
+ players_per_pot: number;
1401
+ source_phase_id?: string | null;
1402
+ };
1403
+ Update: {
1404
+ allocation_method?: string;
1405
+ configuration?: Json | null;
1406
+ created_at?: string | null;
1407
+ event_id?: string;
1408
+ id?: string;
1409
+ number_of_pots?: number;
1410
+ participant_type?: Database["competitions"]["Enums"]["event_participant_type"];
1411
+ phase_id?: string;
1412
+ players_per_pot?: number;
1413
+ source_phase_id?: string | null;
1414
+ };
1415
+ Relationships: [
1416
+ {
1417
+ foreignKeyName: "phase_seeding_configurations_event_id_fkey";
1418
+ columns: ["event_id"];
1419
+ isOneToOne: false;
1420
+ referencedRelation: "events";
1421
+ referencedColumns: ["id"];
1422
+ },
1423
+ {
1424
+ foreignKeyName: "phase_seeding_configurations_phase_id_fkey";
1425
+ columns: ["phase_id"];
1426
+ isOneToOne: false;
1427
+ referencedRelation: "phases";
1428
+ referencedColumns: ["id"];
1429
+ },
1430
+ {
1431
+ foreignKeyName: "phase_seeding_configurations_source_phase_id_fkey";
1432
+ columns: ["source_phase_id"];
1433
+ isOneToOne: false;
1434
+ referencedRelation: "phases";
1435
+ referencedColumns: ["id"];
1436
+ }
1437
+ ];
1438
+ };
1439
+ phase_seeds: {
1440
+ Row: {
1441
+ created_at: string | null;
1442
+ event_participant_id: string;
1443
+ id: string;
1444
+ phase_group_id: string;
1445
+ pot_number: number;
1446
+ seed_number: number;
1447
+ };
1448
+ Insert: {
1449
+ created_at?: string | null;
1450
+ event_participant_id: string;
1451
+ id?: string;
1452
+ phase_group_id: string;
1453
+ pot_number: number;
1454
+ seed_number: number;
1455
+ };
1456
+ Update: {
1457
+ created_at?: string | null;
1458
+ event_participant_id?: string;
1459
+ id?: string;
1460
+ phase_group_id?: string;
1461
+ pot_number?: number;
1462
+ seed_number?: number;
1463
+ };
1464
+ Relationships: [
1465
+ {
1466
+ foreignKeyName: "phase_seeds_event_participant_id_fkey";
1467
+ columns: ["event_participant_id"];
1468
+ isOneToOne: false;
1469
+ referencedRelation: "event_participants";
1470
+ referencedColumns: ["id"];
1471
+ },
1472
+ {
1473
+ foreignKeyName: "phase_seeds_phase_group_id_fkey";
1474
+ columns: ["phase_group_id"];
1475
+ isOneToOne: false;
1476
+ referencedRelation: "phase_groups";
1477
+ referencedColumns: ["id"];
1478
+ }
1479
+ ];
1480
+ };
1481
+ phases: {
1482
+ Row: {
1483
+ created_at: string | null;
1484
+ end_time: string | null;
1485
+ event_id: string;
1486
+ id: string;
1487
+ metadata: Json | null;
1488
+ name: string;
1489
+ phase_order: number | null;
1490
+ phase_type: Database["competitions"]["Enums"]["phase_type"];
1491
+ start_time: string | null;
1492
+ };
1493
+ Insert: {
1494
+ created_at?: string | null;
1495
+ end_time?: string | null;
1496
+ event_id: string;
1497
+ id?: string;
1498
+ metadata?: Json | null;
1499
+ name: string;
1500
+ phase_order?: number | null;
1501
+ phase_type: Database["competitions"]["Enums"]["phase_type"];
1502
+ start_time?: string | null;
1503
+ };
1504
+ Update: {
1505
+ created_at?: string | null;
1506
+ end_time?: string | null;
1507
+ event_id?: string;
1508
+ id?: string;
1509
+ metadata?: Json | null;
1510
+ name?: string;
1511
+ phase_order?: number | null;
1512
+ phase_type?: Database["competitions"]["Enums"]["phase_type"];
1513
+ start_time?: string | null;
1514
+ };
1515
+ Relationships: [
1516
+ {
1517
+ foreignKeyName: "phases_event_id_fkey";
1518
+ columns: ["event_id"];
1519
+ isOneToOne: false;
1520
+ referencedRelation: "events";
1521
+ referencedColumns: ["id"];
1522
+ }
1523
+ ];
1524
+ };
1525
+ sets: {
1526
+ Row: {
1527
+ challenges_phase_id: string | null;
1528
+ created_at: string | null;
1529
+ id: string;
1530
+ length: number;
1531
+ length_type: Database["competitions"]["Enums"]["set_length_type"];
1532
+ metadata: Json | null;
1533
+ phase_group_id: string | null;
1534
+ scoring_type: Database["competitions"]["Enums"]["set_scoring_type"];
1535
+ };
1536
+ Insert: {
1537
+ challenges_phase_id?: string | null;
1538
+ created_at?: string | null;
1539
+ id?: string;
1540
+ length: number;
1541
+ length_type?: Database["competitions"]["Enums"]["set_length_type"];
1542
+ metadata?: Json | null;
1543
+ phase_group_id?: string | null;
1544
+ scoring_type?: Database["competitions"]["Enums"]["set_scoring_type"];
1545
+ };
1546
+ Update: {
1547
+ challenges_phase_id?: string | null;
1548
+ created_at?: string | null;
1549
+ id?: string;
1550
+ length?: number;
1551
+ length_type?: Database["competitions"]["Enums"]["set_length_type"];
1552
+ metadata?: Json | null;
1553
+ phase_group_id?: string | null;
1554
+ scoring_type?: Database["competitions"]["Enums"]["set_scoring_type"];
1555
+ };
1556
+ Relationships: [
1557
+ {
1558
+ foreignKeyName: "sets_challenges_phase_id_fkey";
1559
+ columns: ["challenges_phase_id"];
1560
+ isOneToOne: false;
1561
+ referencedRelation: "challenges_phases";
1562
+ referencedColumns: ["id"];
1563
+ },
1564
+ {
1565
+ foreignKeyName: "sets_phase_group_id_fkey";
1566
+ columns: ["phase_group_id"];
1567
+ isOneToOne: false;
1568
+ referencedRelation: "phase_groups";
1569
+ referencedColumns: ["id"];
1570
+ }
1571
+ ];
1572
+ };
1573
+ tournament_phase_progressions: {
1574
+ Row: {
1575
+ configuration: Json | null;
1576
+ created_at: string | null;
1577
+ destination_phase_id: string;
1578
+ id: string;
1579
+ players_progressing: number;
1580
+ source_phase_id: string;
1581
+ };
1582
+ Insert: {
1583
+ configuration?: Json | null;
1584
+ created_at?: string | null;
1585
+ destination_phase_id: string;
1586
+ id?: string;
1587
+ players_progressing: number;
1588
+ source_phase_id: string;
1589
+ };
1590
+ Update: {
1591
+ configuration?: Json | null;
1592
+ created_at?: string | null;
1593
+ destination_phase_id?: string;
1594
+ id?: string;
1595
+ players_progressing?: number;
1596
+ source_phase_id?: string;
1597
+ };
1598
+ Relationships: [
1599
+ {
1600
+ foreignKeyName: "tournament_phase_progressions_destination_phase_id_fkey";
1601
+ columns: ["destination_phase_id"];
1602
+ isOneToOne: false;
1603
+ referencedRelation: "phases";
1604
+ referencedColumns: ["id"];
1605
+ },
1606
+ {
1607
+ foreignKeyName: "tournament_phase_progressions_source_phase_id_fkey";
1608
+ columns: ["source_phase_id"];
1609
+ isOneToOne: false;
1610
+ referencedRelation: "phases";
1611
+ referencedColumns: ["id"];
1612
+ }
1613
+ ];
1614
+ };
1615
+ };
1616
+ Views: {
1617
+ [_ in never]: never;
1618
+ };
1619
+ Functions: {
1620
+ authorise_competition: {
1621
+ Args: {
1622
+ p_challenges_id?: string;
1623
+ p_locals_tournament_id?: string;
1624
+ p_league_id?: string;
1625
+ p_permission: string;
1626
+ };
1627
+ Returns: boolean;
1628
+ };
1629
+ get_challenges_id: {
1630
+ Args: {
1631
+ search: string;
1632
+ source_level?: string;
1633
+ };
1634
+ Returns: string;
1635
+ };
1636
+ get_league_id: {
1637
+ Args: {
1638
+ search: string;
1639
+ source_level?: string;
1640
+ };
1641
+ Returns: string;
1642
+ };
1643
+ get_locals_tournament_id: {
1644
+ Args: {
1645
+ search: string;
1646
+ source_level?: string;
1647
+ };
1648
+ Returns: string;
1649
+ };
1650
+ has_competition_access: {
1651
+ Args: {
1652
+ p_locals_tournament_id?: string;
1653
+ p_user_id?: string;
1654
+ p_challenges_id?: string;
1655
+ p_league_id?: string;
1656
+ };
1657
+ Returns: boolean;
1658
+ };
1659
+ is_challenges_organiser: {
1660
+ Args: {
1661
+ p_user_id?: string;
1662
+ p_challenges_id: string;
1663
+ };
1664
+ Returns: boolean;
1665
+ };
1666
+ is_challenges_staff: {
1667
+ Args: {
1668
+ p_permission: string;
1669
+ p_user_id?: string;
1670
+ p_challenges_id: string;
1671
+ };
1672
+ Returns: boolean;
1673
+ };
1674
+ is_league_organiser: {
1675
+ Args: {
1676
+ p_user_id?: string;
1677
+ p_league_id: string;
1678
+ };
1679
+ Returns: boolean;
1680
+ };
1681
+ is_league_staff: {
1682
+ Args: {
1683
+ p_user_id?: string;
1684
+ p_permission: string;
1685
+ p_league_id: string;
1686
+ };
1687
+ Returns: boolean;
1688
+ };
1689
+ is_locals_organiser: {
1690
+ Args: {
1691
+ p_locals_tournament_id: string;
1692
+ p_user_id?: string;
1693
+ };
1694
+ Returns: boolean;
1695
+ };
1696
+ is_locals_staff: {
1697
+ Args: {
1698
+ p_permission: string;
1699
+ p_locals_tournament_id: string;
1700
+ p_user_id?: string;
1701
+ };
1702
+ Returns: boolean;
1703
+ };
1704
+ is_penalty_active: {
1705
+ Args: {
1706
+ p_expires_at?: string;
1707
+ p_applied_at: string;
1708
+ };
1709
+ Returns: boolean;
1710
+ };
1711
+ perform_phase_seeding: {
1712
+ Args: {
1713
+ p_participant_type: Database["competitions"]["Enums"]["event_participant_type"];
1714
+ p_config_id: string;
1715
+ };
1716
+ Returns: undefined;
1717
+ };
1718
+ };
1719
+ Enums: {
1720
+ event_participant_type: "player" | "team";
1721
+ event_status: "scheduled" | "active" | "completed" | "suspended" | "cancelled";
1722
+ phase_registration_status: "pending" | "active" | "withdrawn" | "disqualified";
1723
+ phase_type: "progression" | "playoff";
1724
+ set_length_type: "first_to" | "best_of" | "fixed";
1725
+ set_scoring_type: "aggregate_score" | "match_wins";
1726
+ };
1727
+ CompositeTypes: {
1728
+ [_ in never]: never;
1729
+ };
1730
+ };
5
1731
  compliance: {
6
1732
  Tables: {
7
1733
  active_registrations: {
@@ -41,7 +1767,22 @@ export type Database = {
41
1767
  permission?: string;
42
1768
  role?: string;
43
1769
  };
44
- Relationships: [];
1770
+ Relationships: [
1771
+ {
1772
+ foreignKeyName: "compliance_app_role_permissions_permission_fkey";
1773
+ columns: ["permission"];
1774
+ isOneToOne: false;
1775
+ referencedRelation: "apps";
1776
+ referencedColumns: ["app"];
1777
+ },
1778
+ {
1779
+ foreignKeyName: "compliance_app_role_permissions_role_fkey";
1780
+ columns: ["role"];
1781
+ isOneToOne: false;
1782
+ referencedRelation: "app_roles";
1783
+ referencedColumns: ["role"];
1784
+ }
1785
+ ];
45
1786
  };
46
1787
  app_roles: {
47
1788
  Row: {
@@ -61,11 +1802,93 @@ export type Database = {
61
1802
  };
62
1803
  Relationships: [];
63
1804
  };
1805
+ apps: {
1806
+ Row: {
1807
+ app: string;
1808
+ };
1809
+ Insert: {
1810
+ app: string;
1811
+ };
1812
+ Update: {
1813
+ app?: string;
1814
+ };
1815
+ Relationships: [];
1816
+ };
1817
+ competition_organisers: {
1818
+ Row: {
1819
+ created_at: string;
1820
+ description: string | null;
1821
+ email: string | null;
1822
+ id: string;
1823
+ name: string;
1824
+ phone: string;
1825
+ user_id: string;
1826
+ website: string | null;
1827
+ };
1828
+ Insert: {
1829
+ created_at?: string;
1830
+ description?: string | null;
1831
+ email?: string | null;
1832
+ id?: string;
1833
+ name: string;
1834
+ phone?: string;
1835
+ user_id?: string;
1836
+ website?: string | null;
1837
+ };
1838
+ Update: {
1839
+ created_at?: string;
1840
+ description?: string | null;
1841
+ email?: string | null;
1842
+ id?: string;
1843
+ name?: string;
1844
+ phone?: string;
1845
+ user_id?: string;
1846
+ website?: string | null;
1847
+ };
1848
+ Relationships: [];
1849
+ };
1850
+ competition_organisers_staff: {
1851
+ Row: {
1852
+ created_at: string;
1853
+ organiser_id: string;
1854
+ player_id: string;
1855
+ user_id: string;
1856
+ };
1857
+ Insert: {
1858
+ created_at?: string;
1859
+ organiser_id: string;
1860
+ player_id: string;
1861
+ user_id: string;
1862
+ };
1863
+ Update: {
1864
+ created_at?: string;
1865
+ organiser_id?: string;
1866
+ player_id?: string;
1867
+ user_id?: string;
1868
+ };
1869
+ Relationships: [
1870
+ {
1871
+ foreignKeyName: "competition_organisers_staff_organiser_id_fkey";
1872
+ columns: ["organiser_id"];
1873
+ isOneToOne: false;
1874
+ referencedRelation: "competition_organisers";
1875
+ referencedColumns: ["id"];
1876
+ },
1877
+ {
1878
+ foreignKeyName: "competition_organisers_staff_player_id_fkey";
1879
+ columns: ["player_id"];
1880
+ isOneToOne: false;
1881
+ referencedRelation: "players";
1882
+ referencedColumns: ["id"];
1883
+ }
1884
+ ];
1885
+ };
64
1886
  data_update_requests: {
65
1887
  Row: {
66
1888
  account_type: Database["compliance"]["Enums"]["account_type"];
67
1889
  created_at: string;
68
1890
  id: string;
1891
+ rejected_by: string | null;
69
1892
  rejection_reason: string | null;
70
1893
  status: Database["compliance"]["Enums"]["data_update_request_status"];
71
1894
  updated_at: string | null;
@@ -76,6 +1899,7 @@ export type Database = {
76
1899
  account_type: Database["compliance"]["Enums"]["account_type"];
77
1900
  created_at?: string;
78
1901
  id?: string;
1902
+ rejected_by?: string | null;
79
1903
  rejection_reason?: string | null;
80
1904
  status?: Database["compliance"]["Enums"]["data_update_request_status"];
81
1905
  updated_at?: string | null;
@@ -86,6 +1910,7 @@ export type Database = {
86
1910
  account_type?: Database["compliance"]["Enums"]["account_type"];
87
1911
  created_at?: string;
88
1912
  id?: string;
1913
+ rejected_by?: string | null;
89
1914
  rejection_reason?: string | null;
90
1915
  status?: Database["compliance"]["Enums"]["data_update_request_status"];
91
1916
  updated_at?: string | null;
@@ -134,8 +1959,8 @@ export type Database = {
134
1959
  branch_id: string;
135
1960
  created_at: string;
136
1961
  end_time: string | null;
137
- external_metadata: Json | null;
138
1962
  id: string;
1963
+ metadata: Json | null;
139
1964
  reason: string;
140
1965
  start_time: string;
141
1966
  user_id: string | null;
@@ -144,8 +1969,8 @@ export type Database = {
144
1969
  branch_id: string;
145
1970
  created_at?: string;
146
1971
  end_time?: string | null;
147
- external_metadata?: Json | null;
148
1972
  id?: string;
1973
+ metadata?: Json | null;
149
1974
  reason: string;
150
1975
  start_time?: string;
151
1976
  user_id?: string | null;
@@ -154,8 +1979,8 @@ export type Database = {
154
1979
  branch_id?: string;
155
1980
  created_at?: string;
156
1981
  end_time?: string | null;
157
- external_metadata?: Json | null;
158
1982
  id?: string;
1983
+ metadata?: Json | null;
159
1984
  reason?: string;
160
1985
  start_time?: string;
161
1986
  user_id?: string | null;
@@ -236,54 +2061,35 @@ export type Database = {
236
2061
  lounge_credits_transactions: {
237
2062
  Row: {
238
2063
  amount: number;
239
- branch_id: string | null;
240
2064
  created_at: string;
241
2065
  description: string;
242
- external_metadata: Json | null;
243
- feature: string | null;
244
2066
  id: string;
245
2067
  lounge_id: string | null;
246
- microservice: string | null;
247
- microservice_group: string | null;
248
- staff_id: string | null;
2068
+ metadata: Json | null;
2069
+ source_event_id: string | null;
249
2070
  user_id: string | null;
250
2071
  };
251
2072
  Insert: {
252
2073
  amount: number;
253
- branch_id?: string | null;
254
2074
  created_at?: string;
255
2075
  description: string;
256
- external_metadata?: Json | null;
257
- feature?: string | null;
258
2076
  id?: string;
259
2077
  lounge_id?: string | null;
260
- microservice?: string | null;
261
- microservice_group?: string | null;
262
- staff_id?: string | null;
2078
+ metadata?: Json | null;
2079
+ source_event_id?: string | null;
263
2080
  user_id?: string | null;
264
2081
  };
265
2082
  Update: {
266
2083
  amount?: number;
267
- branch_id?: string | null;
268
2084
  created_at?: string;
269
2085
  description?: string;
270
- external_metadata?: Json | null;
271
- feature?: string | null;
272
2086
  id?: string;
273
2087
  lounge_id?: string | null;
274
- microservice?: string | null;
275
- microservice_group?: string | null;
276
- staff_id?: string | null;
2088
+ metadata?: Json | null;
2089
+ source_event_id?: string | null;
277
2090
  user_id?: string | null;
278
2091
  };
279
2092
  Relationships: [
280
- {
281
- foreignKeyName: "lounge_credits_transactions_branch_id_fkey";
282
- columns: ["branch_id"];
283
- isOneToOne: false;
284
- referencedRelation: "lounge_branches";
285
- referencedColumns: ["id"];
286
- },
287
2093
  {
288
2094
  foreignKeyName: "lounge_credits_transactions_lounge_id_fkey";
289
2095
  columns: ["lounge_id"];
@@ -292,10 +2098,10 @@ export type Database = {
292
2098
  referencedColumns: ["id"];
293
2099
  },
294
2100
  {
295
- foreignKeyName: "lounge_credits_transactions_staff_id_fkey";
296
- columns: ["staff_id"];
2101
+ foreignKeyName: "lounge_credits_transactions_source_event_id_fkey";
2102
+ columns: ["source_event_id"];
297
2103
  isOneToOne: false;
298
- referencedRelation: "players";
2104
+ referencedRelation: "system_events";
299
2105
  referencedColumns: ["id"];
300
2106
  }
301
2107
  ];
@@ -304,9 +2110,9 @@ export type Database = {
304
2110
  Row: {
305
2111
  created_at: string;
306
2112
  end_time: string | null;
307
- external_metadata: Json | null;
308
2113
  id: string;
309
2114
  lounge_id: string;
2115
+ metadata: Json | null;
310
2116
  reason: string;
311
2117
  start_time: string;
312
2118
  user_id: string | null;
@@ -314,9 +2120,9 @@ export type Database = {
314
2120
  Insert: {
315
2121
  created_at?: string;
316
2122
  end_time?: string | null;
317
- external_metadata?: Json | null;
318
2123
  id?: string;
319
2124
  lounge_id: string;
2125
+ metadata?: Json | null;
320
2126
  reason: string;
321
2127
  start_time?: string;
322
2128
  user_id?: string | null;
@@ -324,9 +2130,9 @@ export type Database = {
324
2130
  Update: {
325
2131
  created_at?: string;
326
2132
  end_time?: string | null;
327
- external_metadata?: Json | null;
328
2133
  id?: string;
329
2134
  lounge_id?: string;
2135
+ metadata?: Json | null;
330
2136
  reason?: string;
331
2137
  start_time?: string;
332
2138
  user_id?: string | null;
@@ -546,44 +2352,45 @@ export type Database = {
546
2352
  amount: number;
547
2353
  created_at: string;
548
2354
  description: string;
549
- external_metadata: Json | null;
550
- feature: string | null;
551
2355
  id: string;
552
- microservice: string | null;
553
- microservice_group: string | null;
2356
+ metadata: Json | null;
554
2357
  player_id: string;
2358
+ source_event_id: string | null;
555
2359
  user_id: string | null;
556
2360
  };
557
2361
  Insert: {
558
2362
  amount: number;
559
2363
  created_at?: string;
560
2364
  description: string;
561
- external_metadata?: Json | null;
562
- feature?: string | null;
563
2365
  id?: string;
564
- microservice?: string | null;
565
- microservice_group?: string | null;
2366
+ metadata?: Json | null;
566
2367
  player_id?: string;
2368
+ source_event_id?: string | null;
567
2369
  user_id?: string | null;
568
2370
  };
569
2371
  Update: {
570
2372
  amount?: number;
571
2373
  created_at?: string;
572
2374
  description?: string;
573
- external_metadata?: Json | null;
574
- feature?: string | null;
575
2375
  id?: string;
576
- microservice?: string | null;
577
- microservice_group?: string | null;
2376
+ metadata?: Json | null;
578
2377
  player_id?: string;
2378
+ source_event_id?: string | null;
579
2379
  user_id?: string | null;
580
2380
  };
581
2381
  Relationships: [
582
2382
  {
583
- foreignKeyName: "player_credits_transactions_player_id_fkey";
584
- columns: ["player_id"];
2383
+ foreignKeyName: "player_credits_transactions_player_id_fkey";
2384
+ columns: ["player_id"];
2385
+ isOneToOne: false;
2386
+ referencedRelation: "players";
2387
+ referencedColumns: ["id"];
2388
+ },
2389
+ {
2390
+ foreignKeyName: "player_credits_transactions_source_event_id_fkey";
2391
+ columns: ["source_event_id"];
585
2392
  isOneToOne: false;
586
- referencedRelation: "players";
2393
+ referencedRelation: "system_events";
587
2394
  referencedColumns: ["id"];
588
2395
  }
589
2396
  ];
@@ -835,8 +2642,8 @@ export type Database = {
835
2642
  Row: {
836
2643
  created_at: string;
837
2644
  end_time: string | null;
838
- external_metadata: Json | null;
839
2645
  id: string;
2646
+ metadata: Json | null;
840
2647
  player_id: string;
841
2648
  reason: string;
842
2649
  start_time: string;
@@ -845,8 +2652,8 @@ export type Database = {
845
2652
  Insert: {
846
2653
  created_at?: string;
847
2654
  end_time?: string | null;
848
- external_metadata?: Json | null;
849
2655
  id?: string;
2656
+ metadata?: Json | null;
850
2657
  player_id: string;
851
2658
  reason: string;
852
2659
  start_time?: string;
@@ -855,8 +2662,8 @@ export type Database = {
855
2662
  Update: {
856
2663
  created_at?: string;
857
2664
  end_time?: string | null;
858
- external_metadata?: Json | null;
859
2665
  id?: string;
2666
+ metadata?: Json | null;
860
2667
  player_id?: string;
861
2668
  reason?: string;
862
2669
  start_time?: string;
@@ -975,36 +2782,30 @@ export type Database = {
975
2782
  amount: number;
976
2783
  created_at: string;
977
2784
  description: string;
978
- external_metadata: Json | null;
979
- feature: string | null;
980
2785
  id: string;
981
- microservice: string | null;
982
- microservice_group: string | null;
2786
+ metadata: Json | null;
983
2787
  player_id: string;
2788
+ source_event_id: string | null;
984
2789
  user_id: string | null;
985
2790
  };
986
2791
  Insert: {
987
2792
  amount: number;
988
2793
  created_at?: string;
989
2794
  description: string;
990
- external_metadata?: Json | null;
991
- feature?: string | null;
992
2795
  id?: string;
993
- microservice?: string | null;
994
- microservice_group?: string | null;
2796
+ metadata?: Json | null;
995
2797
  player_id?: string;
2798
+ source_event_id?: string | null;
996
2799
  user_id?: string | null;
997
2800
  };
998
2801
  Update: {
999
2802
  amount?: number;
1000
2803
  created_at?: string;
1001
2804
  description?: string;
1002
- external_metadata?: Json | null;
1003
- feature?: string | null;
1004
2805
  id?: string;
1005
- microservice?: string | null;
1006
- microservice_group?: string | null;
2806
+ metadata?: Json | null;
1007
2807
  player_id?: string;
2808
+ source_event_id?: string | null;
1008
2809
  user_id?: string | null;
1009
2810
  };
1010
2811
  Relationships: [
@@ -1014,6 +2815,13 @@ export type Database = {
1014
2815
  isOneToOne: false;
1015
2816
  referencedRelation: "players";
1016
2817
  referencedColumns: ["id"];
2818
+ },
2819
+ {
2820
+ foreignKeyName: "player_xp_transactions_source_event_id_fkey";
2821
+ columns: ["source_event_id"];
2822
+ isOneToOne: false;
2823
+ referencedRelation: "system_events";
2824
+ referencedColumns: ["id"];
1017
2825
  }
1018
2826
  ];
1019
2827
  };
@@ -1077,6 +2885,193 @@ export type Database = {
1077
2885
  };
1078
2886
  Relationships: [];
1079
2887
  };
2888
+ system_event_types: {
2889
+ Row: {
2890
+ description: string;
2891
+ event_type: string;
2892
+ };
2893
+ Insert: {
2894
+ description: string;
2895
+ event_type: string;
2896
+ };
2897
+ Update: {
2898
+ description?: string;
2899
+ event_type?: string;
2900
+ };
2901
+ Relationships: [];
2902
+ };
2903
+ system_events: {
2904
+ Row: {
2905
+ created_at: string;
2906
+ event_name: string | null;
2907
+ event_payload: Json | null;
2908
+ id: string;
2909
+ invalidated_at: string | null;
2910
+ invalidated_by: string | null;
2911
+ invalidation_reason: string | null;
2912
+ player_id: string;
2913
+ source_app: string;
2914
+ source_identifier: string;
2915
+ source_type: string;
2916
+ user_id: string;
2917
+ };
2918
+ Insert: {
2919
+ created_at?: string;
2920
+ event_name?: string | null;
2921
+ event_payload?: Json | null;
2922
+ id?: string;
2923
+ invalidated_at?: string | null;
2924
+ invalidated_by?: string | null;
2925
+ invalidation_reason?: string | null;
2926
+ player_id?: string;
2927
+ source_app: string;
2928
+ source_identifier: string;
2929
+ source_type: string;
2930
+ user_id?: string;
2931
+ };
2932
+ Update: {
2933
+ created_at?: string;
2934
+ event_name?: string | null;
2935
+ event_payload?: Json | null;
2936
+ id?: string;
2937
+ invalidated_at?: string | null;
2938
+ invalidated_by?: string | null;
2939
+ invalidation_reason?: string | null;
2940
+ player_id?: string;
2941
+ source_app?: string;
2942
+ source_identifier?: string;
2943
+ source_type?: string;
2944
+ user_id?: string;
2945
+ };
2946
+ Relationships: [
2947
+ {
2948
+ foreignKeyName: "system_events_player_id_fkey";
2949
+ columns: ["player_id"];
2950
+ isOneToOne: false;
2951
+ referencedRelation: "players";
2952
+ referencedColumns: ["id"];
2953
+ },
2954
+ {
2955
+ foreignKeyName: "system_events_source_app_fkey";
2956
+ columns: ["source_app"];
2957
+ isOneToOne: false;
2958
+ referencedRelation: "apps";
2959
+ referencedColumns: ["app"];
2960
+ },
2961
+ {
2962
+ foreignKeyName: "system_events_source_type_fkey";
2963
+ columns: ["source_type"];
2964
+ isOneToOne: false;
2965
+ referencedRelation: "system_event_types";
2966
+ referencedColumns: ["event_type"];
2967
+ }
2968
+ ];
2969
+ };
2970
+ teams: {
2971
+ Row: {
2972
+ abbreviation: string;
2973
+ created_at: string;
2974
+ email: string | null;
2975
+ id: string;
2976
+ name: string;
2977
+ phone: string;
2978
+ user_id: string | null;
2979
+ website: string | null;
2980
+ };
2981
+ Insert: {
2982
+ abbreviation: string;
2983
+ created_at?: string;
2984
+ email?: string | null;
2985
+ id?: string;
2986
+ name: string;
2987
+ phone?: string;
2988
+ user_id?: string | null;
2989
+ website?: string | null;
2990
+ };
2991
+ Update: {
2992
+ abbreviation?: string;
2993
+ created_at?: string;
2994
+ email?: string | null;
2995
+ id?: string;
2996
+ name?: string;
2997
+ phone?: string;
2998
+ user_id?: string | null;
2999
+ website?: string | null;
3000
+ };
3001
+ Relationships: [];
3002
+ };
3003
+ teams_lounges: {
3004
+ Row: {
3005
+ created_at: string;
3006
+ lounge_id: string;
3007
+ team_id: string;
3008
+ terminated_at: string | null;
3009
+ };
3010
+ Insert: {
3011
+ created_at?: string;
3012
+ lounge_id: string;
3013
+ team_id: string;
3014
+ terminated_at?: string | null;
3015
+ };
3016
+ Update: {
3017
+ created_at?: string;
3018
+ lounge_id?: string;
3019
+ team_id?: string;
3020
+ terminated_at?: string | null;
3021
+ };
3022
+ Relationships: [
3023
+ {
3024
+ foreignKeyName: "teams_lounges_lounge_id_fkey";
3025
+ columns: ["lounge_id"];
3026
+ isOneToOne: false;
3027
+ referencedRelation: "lounges";
3028
+ referencedColumns: ["id"];
3029
+ },
3030
+ {
3031
+ foreignKeyName: "teams_lounges_team_id_fkey";
3032
+ columns: ["team_id"];
3033
+ isOneToOne: false;
3034
+ referencedRelation: "teams";
3035
+ referencedColumns: ["id"];
3036
+ }
3037
+ ];
3038
+ };
3039
+ teams_players: {
3040
+ Row: {
3041
+ created_at: string;
3042
+ player_id: string;
3043
+ team_id: string;
3044
+ terminated_at: string | null;
3045
+ };
3046
+ Insert: {
3047
+ created_at?: string;
3048
+ player_id: string;
3049
+ team_id: string;
3050
+ terminated_at?: string | null;
3051
+ };
3052
+ Update: {
3053
+ created_at?: string;
3054
+ player_id?: string;
3055
+ team_id?: string;
3056
+ terminated_at?: string | null;
3057
+ };
3058
+ Relationships: [
3059
+ {
3060
+ foreignKeyName: "teams_players_player_id_fkey";
3061
+ columns: ["player_id"];
3062
+ isOneToOne: false;
3063
+ referencedRelation: "players";
3064
+ referencedColumns: ["id"];
3065
+ },
3066
+ {
3067
+ foreignKeyName: "teams_players_team_id_fkey";
3068
+ columns: ["team_id"];
3069
+ isOneToOne: false;
3070
+ referencedRelation: "teams";
3071
+ referencedColumns: ["id"];
3072
+ }
3073
+ ];
3074
+ };
1080
3075
  temporary_player_xp_transactions: {
1081
3076
  Row: {
1082
3077
  amount: number;
@@ -1084,6 +3079,7 @@ export type Database = {
1084
3079
  description: string;
1085
3080
  id: string;
1086
3081
  player_id: string | null;
3082
+ source_event_id: string | null;
1087
3083
  user_id: string | null;
1088
3084
  };
1089
3085
  Insert: {
@@ -1092,6 +3088,7 @@ export type Database = {
1092
3088
  description: string;
1093
3089
  id?: string;
1094
3090
  player_id?: string | null;
3091
+ source_event_id?: string | null;
1095
3092
  user_id?: string | null;
1096
3093
  };
1097
3094
  Update: {
@@ -1100,6 +3097,7 @@ export type Database = {
1100
3097
  description?: string;
1101
3098
  id?: string;
1102
3099
  player_id?: string | null;
3100
+ source_event_id?: string | null;
1103
3101
  user_id?: string | null;
1104
3102
  };
1105
3103
  Relationships: [
@@ -1110,6 +3108,13 @@ export type Database = {
1110
3108
  referencedRelation: "temporary_players";
1111
3109
  referencedColumns: ["id"];
1112
3110
  },
3111
+ {
3112
+ foreignKeyName: "temporary_player_xp_transactions_source_event_id_fkey";
3113
+ columns: ["source_event_id"];
3114
+ isOneToOne: false;
3115
+ referencedRelation: "system_events";
3116
+ referencedColumns: ["id"];
3117
+ },
1113
3118
  {
1114
3119
  foreignKeyName: "temporary_player_xp_transactions_user_id_fkey";
1115
3120
  columns: ["user_id"];
@@ -1197,54 +3202,54 @@ export type Database = {
1197
3202
  };
1198
3203
  create_lounge: {
1199
3204
  Args: {
3205
+ p_company_name: string;
1200
3206
  p_email?: string;
3207
+ p_trade_name?: string;
1201
3208
  p_phone?: string;
1202
3209
  p_website?: string;
1203
- p_trade_name?: string;
1204
3210
  p_registration_date: string;
1205
- p_company_name: string;
1206
3211
  };
1207
3212
  Returns: string;
1208
3213
  };
1209
3214
  create_player: {
1210
3215
  Args: {
3216
+ p_birth_date: string;
3217
+ p_sex: Database["compliance"]["Enums"]["sex"];
1211
3218
  p_nationality: string;
1212
- p_middle_names?: string;
1213
- p_show_pronouns?: boolean;
1214
- p_pronouns?: Database["compliance"]["Enums"]["pronouns"][];
3219
+ p_last_name: string;
3220
+ p_first_name: string;
1215
3221
  p_gender_identity?: Database["compliance"]["Enums"]["gender_identity"];
3222
+ p_pronouns?: Database["compliance"]["Enums"]["pronouns"][];
3223
+ p_show_pronouns?: boolean;
1216
3224
  p_show_birth_date?: boolean;
1217
3225
  p_pseudonym?: string;
1218
- p_first_name: string;
1219
- p_last_name: string;
1220
- p_birth_date: string;
1221
- p_sex: Database["compliance"]["Enums"]["sex"];
3226
+ p_middle_names?: string;
1222
3227
  };
1223
3228
  Returns: string;
1224
3229
  };
1225
3230
  create_player_minor_rep: {
1226
3231
  Args: {
3232
+ p_pronouns?: Database["compliance"]["Enums"]["pronouns"][];
3233
+ p_first_name: string;
3234
+ p_phone: string;
3235
+ p_relation: Database["compliance"]["Enums"]["minor_relation"];
3236
+ p_middle_names?: string;
1227
3237
  p_gender_identity?: Database["compliance"]["Enums"]["gender_identity"];
1228
3238
  p_other_relation?: string;
1229
3239
  p_nationality: string;
3240
+ p_birth_date: string;
1230
3241
  p_sex: Database["compliance"]["Enums"]["sex"];
1231
- p_relation: Database["compliance"]["Enums"]["minor_relation"];
1232
- p_middle_names?: string;
1233
- p_pronouns?: Database["compliance"]["Enums"]["pronouns"][];
1234
- p_phone: string;
1235
- p_first_name: string;
1236
3242
  p_last_name: string;
1237
- p_birth_date: string;
1238
3243
  };
1239
3244
  Returns: string;
1240
3245
  };
1241
3246
  create_varsity_stint: {
1242
3247
  Args: {
3248
+ p_formatted_institution_name?: string;
1243
3249
  p_institution_code: string;
1244
3250
  p_enrollment_year: number;
1245
3251
  p_exit_year: number;
1246
3252
  p_institution_name_issue?: Database["compliance"]["Enums"]["institution_name_issue"];
1247
- p_formatted_institution_name?: string;
1248
3253
  };
1249
3254
  Returns: string;
1250
3255
  };
@@ -1266,9 +3271,9 @@ export type Database = {
1266
3271
  };
1267
3272
  generate_platform_id: {
1268
3273
  Args: {
1269
- is_for_staff?: boolean;
1270
- account_type: Database["compliance"]["Enums"]["account_type"];
1271
3274
  is_for_branch?: boolean;
3275
+ account_type: Database["compliance"]["Enums"]["account_type"];
3276
+ is_for_staff?: boolean;
1272
3277
  };
1273
3278
  Returns: string;
1274
3279
  };
@@ -1276,19 +3281,26 @@ export type Database = {
1276
3281
  Args: Record<PropertyKey, never>;
1277
3282
  Returns: Json;
1278
3283
  };
3284
+ get_competition_organiser_ids: {
3285
+ Args: {
3286
+ search?: string;
3287
+ include_staff?: boolean;
3288
+ };
3289
+ Returns: Json;
3290
+ };
1279
3291
  get_data_update_requests: {
1280
3292
  Args: {
1281
3293
  search?: string;
1282
3294
  is_for_minor_rep?: boolean;
1283
3295
  };
1284
3296
  Returns: {
1285
- account_type: Database["compliance"]["Enums"]["account_type"];
1286
3297
  status: Database["compliance"]["Enums"]["data_update_request_status"];
3298
+ id: string;
3299
+ account_type: Database["compliance"]["Enums"]["account_type"];
1287
3300
  updates: Json;
1288
3301
  rejection_reason: string;
1289
3302
  created_at: string;
1290
3303
  updated_at: string;
1291
- id: string;
1292
3304
  }[];
1293
3305
  };
1294
3306
  get_data_updates: {
@@ -1297,9 +3309,9 @@ export type Database = {
1297
3309
  is_for_minor_rep?: boolean;
1298
3310
  };
1299
3311
  Returns: {
1300
- account_type: Database["compliance"]["Enums"]["account_type"];
1301
- created_at: string;
1302
3312
  id: string;
3313
+ created_at: string;
3314
+ account_type: Database["compliance"]["Enums"]["account_type"];
1303
3315
  updates: Json;
1304
3316
  }[];
1305
3317
  };
@@ -1359,41 +3371,53 @@ export type Database = {
1359
3371
  };
1360
3372
  is_current_user_permanent: {
1361
3373
  Args: {
1362
- user_is_anonymous?: boolean;
1363
3374
  user_id: string;
3375
+ user_is_anonymous?: boolean;
1364
3376
  };
1365
3377
  Returns: boolean;
1366
3378
  };
1367
3379
  link_existing_minor_rep: {
1368
3380
  Args: {
1369
3381
  p_minor_relation: Database["compliance"]["Enums"]["minor_relation"];
1370
- p_user_id: string;
1371
3382
  p_other_relation: string;
3383
+ p_user_id: string;
1372
3384
  };
1373
3385
  Returns: undefined;
1374
3386
  };
1375
3387
  log_phone_verification: {
1376
3388
  Args: {
1377
- p_updated_at: string;
1378
- p_send_code_attempts?: Json;
1379
- p_created_at?: string;
3389
+ p_phone?: string;
1380
3390
  p_twilio_sid: string;
1381
3391
  p_status: Database["compliance"]["Enums"]["twilio_verification_status"];
1382
- p_phone?: string;
3392
+ p_updated_at: string;
3393
+ p_created_at?: string;
3394
+ p_send_code_attempts?: Json;
1383
3395
  };
1384
3396
  Returns: undefined;
1385
3397
  };
3398
+ log_system_event: {
3399
+ Args: {
3400
+ p_source_identifier: string;
3401
+ p_source_type: string;
3402
+ p_source_app: string;
3403
+ p_player_id: string;
3404
+ p_user_id: string;
3405
+ p_event_payload?: Json;
3406
+ p_event_name?: string;
3407
+ };
3408
+ Returns: string;
3409
+ };
1386
3410
  search_lounges: {
1387
3411
  Args: {
1388
3412
  search_term: string;
1389
3413
  search_type?: string;
1390
3414
  };
1391
3415
  Returns: {
1392
- company_name: string;
3416
+ trade_name: string;
1393
3417
  id: string;
1394
3418
  user_id: string;
3419
+ company_name: string;
1395
3420
  registration_date: string;
1396
- trade_name: string;
1397
3421
  website: string;
1398
3422
  created_at: string;
1399
3423
  }[];
@@ -1405,34 +3429,34 @@ export type Database = {
1405
3429
  enforce_preferences?: boolean;
1406
3430
  };
1407
3431
  Returns: {
1408
- created_at: string;
3432
+ middle_names: string;
3433
+ last_name: string;
3434
+ birth_date: string;
1409
3435
  nationality: string;
1410
3436
  pseudonym: string;
1411
3437
  pronouns: Database["compliance"]["Enums"]["pronouns"][];
3438
+ created_at: string;
1412
3439
  id: string;
1413
3440
  user_id: string;
1414
3441
  first_name: string;
1415
- middle_names: string;
1416
- last_name: string;
1417
- birth_date: string;
1418
3442
  }[];
1419
3443
  };
1420
3444
  submit_gaming_and_socials_data: {
1421
3445
  Args: {
1422
- p_socials: Json[];
1423
3446
  p_consoles: Json[];
1424
3447
  p_primary_platform: Json;
3448
+ p_socials: Json[];
1425
3449
  };
1426
3450
  Returns: undefined;
1427
3451
  };
1428
3452
  validate_data_update_log_fields: {
1429
3453
  Args: {
1430
- p_new_record?: Record<string, unknown>;
1431
- p_account_type: Database["compliance"]["Enums"]["account_type"];
1432
3454
  p_is_for_minor_rep: boolean;
3455
+ p_account_type: Database["compliance"]["Enums"]["account_type"];
1433
3456
  p_is_for_branch: boolean;
1434
- p_user_id?: string;
1435
3457
  p_old_record?: Record<string, unknown>;
3458
+ p_new_record?: Record<string, unknown>;
3459
+ p_user_id?: string;
1436
3460
  };
1437
3461
  Returns: undefined;
1438
3462
  };
@@ -1444,42 +3468,17 @@ export type Database = {
1444
3468
  };
1445
3469
  };
1446
3470
  Enums: {
1447
- account_type: "player" | "lounge";
1448
- data_update_request_status: "pending" | "approved" | "rejected" | "cancelled";
1449
- gender_identity: "cisgender" | "transgender" | "nonbinary";
1450
- id_type: "national" | "alien" | "passport" | "driver_licence";
1451
- institution_name_issue: "not_listed" | "has_error";
1452
- luggage_deposit_type: "shelf" | "locker";
1453
- minor_relation: "sibling" | "parent" | "guardian" | "grandparent" | "cousin" | "uncle/aunt" | "other";
1454
- pronouns: "he/him/his/himself" | "she/her/hers/herself" | "they/them/their/themself" | "name_only";
1455
- registration_step: "1" | "2" | "3" | "4" | "0";
1456
- sex: "male" | "female" | "intersex_man" | "intersex_woman";
1457
- twilio_verification_status: "pending" | "approved" | "canceled";
1458
- };
1459
- CompositeTypes: {
1460
- [_ in never]: never;
1461
- };
1462
- };
1463
- graphql_public: {
1464
- Tables: {
1465
- [_ in never]: never;
1466
- };
1467
- Views: {
1468
- [_ in never]: never;
1469
- };
1470
- Functions: {
1471
- graphql: {
1472
- Args: {
1473
- variables?: Json;
1474
- operationName?: string;
1475
- extensions?: Json;
1476
- query?: string;
1477
- };
1478
- Returns: Json;
1479
- };
1480
- };
1481
- Enums: {
1482
- [_ in never]: never;
3471
+ account_type: "player" | "lounge";
3472
+ data_update_request_status: "pending" | "approved" | "rejected" | "cancelled";
3473
+ gender_identity: "cisgender" | "transgender" | "nonbinary";
3474
+ id_type: "national" | "alien" | "passport" | "driver_licence";
3475
+ institution_name_issue: "not_listed" | "has_error";
3476
+ luggage_deposit_type: "shelf" | "locker";
3477
+ minor_relation: "sibling" | "parent" | "guardian" | "grandparent" | "cousin" | "uncle/aunt" | "other";
3478
+ pronouns: "he/him/his/himself" | "she/her/hers/herself" | "they/them/their/themself" | "name_only";
3479
+ registration_step: "1" | "2" | "3" | "4" | "0";
3480
+ sex: "male" | "female" | "intersex_man" | "intersex_woman";
3481
+ twilio_verification_status: "pending" | "approved" | "canceled";
1483
3482
  };
1484
3483
  CompositeTypes: {
1485
3484
  [_ in never]: never;
@@ -1487,7 +3486,85 @@ export type Database = {
1487
3486
  };
1488
3487
  public: {
1489
3488
  Tables: {
1490
- consoles: {
3489
+ countries: {
3490
+ Row: {
3491
+ code: string;
3492
+ name: string;
3493
+ };
3494
+ Insert: {
3495
+ code: string;
3496
+ name: string;
3497
+ };
3498
+ Update: {
3499
+ code?: string;
3500
+ name?: string;
3501
+ };
3502
+ Relationships: [];
3503
+ };
3504
+ game_character_games: {
3505
+ Row: {
3506
+ character_id: string;
3507
+ created_at: string | null;
3508
+ game_id: string;
3509
+ };
3510
+ Insert: {
3511
+ character_id: string;
3512
+ created_at?: string | null;
3513
+ game_id: string;
3514
+ };
3515
+ Update: {
3516
+ character_id?: string;
3517
+ created_at?: string | null;
3518
+ game_id?: string;
3519
+ };
3520
+ Relationships: [
3521
+ {
3522
+ foreignKeyName: "public_game_character_games_character_id_fkey";
3523
+ columns: ["character_id"];
3524
+ isOneToOne: false;
3525
+ referencedRelation: "game_characters";
3526
+ referencedColumns: ["id"];
3527
+ },
3528
+ {
3529
+ foreignKeyName: "public_game_character_games_game_id_fkey";
3530
+ columns: ["game_id"];
3531
+ isOneToOne: false;
3532
+ referencedRelation: "games";
3533
+ referencedColumns: ["id"];
3534
+ }
3535
+ ];
3536
+ };
3537
+ game_characters: {
3538
+ Row: {
3539
+ created_at: string | null;
3540
+ display_name: string | null;
3541
+ first_name: string;
3542
+ id: string;
3543
+ last_name: string | null;
3544
+ middle_names: string | null;
3545
+ slug: string;
3546
+ };
3547
+ Insert: {
3548
+ created_at?: string | null;
3549
+ display_name?: string | null;
3550
+ first_name: string;
3551
+ id?: string;
3552
+ last_name?: string | null;
3553
+ middle_names?: string | null;
3554
+ slug: string;
3555
+ };
3556
+ Update: {
3557
+ created_at?: string | null;
3558
+ display_name?: string | null;
3559
+ first_name?: string;
3560
+ id?: string;
3561
+ last_name?: string | null;
3562
+ middle_names?: string | null;
3563
+ slug?: string;
3564
+ };
3565
+ Relationships: [];
3566
+ };
3567
+ game_consoles: {
1491
3568
  Row: {
1492
3569
  abbreviation: string | null;
1493
3570
  generation: number;
@@ -1514,50 +3591,53 @@ export type Database = {
1514
3591
  };
1515
3592
  Relationships: [
1516
3593
  {
1517
- foreignKeyName: "public_consoles_platform_shorthand_fkey";
3594
+ foreignKeyName: "public_game_consoles_platform_shorthand_fkey";
1518
3595
  columns: ["platform_shorthand"];
1519
3596
  isOneToOne: false;
1520
- referencedRelation: "platforms";
3597
+ referencedRelation: "game_platforms";
1521
3598
  referencedColumns: ["shorthand"];
1522
3599
  }
1523
3600
  ];
1524
3601
  };
1525
- countries: {
3602
+ game_platforms: {
1526
3603
  Row: {
1527
- code: string;
1528
3604
  name: string;
3605
+ online_name: string | null;
3606
+ shorthand: string;
1529
3607
  };
1530
3608
  Insert: {
1531
- code: string;
1532
3609
  name: string;
3610
+ online_name?: string | null;
3611
+ shorthand: string;
1533
3612
  };
1534
3613
  Update: {
1535
- code?: string;
1536
3614
  name?: string;
3615
+ online_name?: string | null;
3616
+ shorthand?: string;
1537
3617
  };
1538
3618
  Relationships: [];
1539
3619
  };
1540
3620
  games: {
1541
3621
  Row: {
3622
+ cover_url: string | null;
1542
3623
  genres: string[];
1543
3624
  id: string;
3625
+ initial_release_date: string;
1544
3626
  name: string;
1545
- release_date: string;
1546
- supported: boolean;
1547
3627
  };
1548
3628
  Insert: {
3629
+ cover_url?: string | null;
1549
3630
  genres: string[];
1550
3631
  id?: string;
3632
+ initial_release_date: string;
1551
3633
  name: string;
1552
- release_date: string;
1553
- supported: boolean;
1554
3634
  };
1555
3635
  Update: {
3636
+ cover_url?: string | null;
1556
3637
  genres?: string[];
1557
3638
  id?: string;
3639
+ initial_release_date?: string;
1558
3640
  name?: string;
1559
- release_date?: string;
1560
- supported?: boolean;
1561
3641
  };
1562
3642
  Relationships: [];
1563
3643
  };
@@ -1579,7 +3659,7 @@ export type Database = {
1579
3659
  foreignKeyName: "public_games_consoles_console_id_fkey";
1580
3660
  columns: ["console_id"];
1581
3661
  isOneToOne: false;
1582
- referencedRelation: "consoles";
3662
+ referencedRelation: "game_consoles";
1583
3663
  referencedColumns: ["id"];
1584
3664
  },
1585
3665
  {
@@ -1606,24 +3686,6 @@ export type Database = {
1606
3686
  };
1607
3687
  Relationships: [];
1608
3688
  };
1609
- platforms: {
1610
- Row: {
1611
- name: string;
1612
- online_name: string | null;
1613
- shorthand: string;
1614
- };
1615
- Insert: {
1616
- name: string;
1617
- online_name?: string | null;
1618
- shorthand: string;
1619
- };
1620
- Update: {
1621
- name?: string;
1622
- online_name?: string | null;
1623
- shorthand?: string;
1624
- };
1625
- Relationships: [];
1626
- };
1627
3689
  varsity_institutions: {
1628
3690
  Row: {
1629
3691
  code: string;
@@ -1691,10 +3753,10 @@ export type Database = {
1691
3753
  search_type?: string;
1692
3754
  };
1693
3755
  Returns: {
1694
- created_at: string;
1695
3756
  id: string;
1696
3757
  name: string;
1697
3758
  registration_date: string;
3759
+ created_at: string;
1698
3760
  }[];
1699
3761
  };
1700
3762
  search_active_players: {
@@ -1703,15 +3765,15 @@ export type Database = {
1703
3765
  search_type?: string;
1704
3766
  };
1705
3767
  Returns: {
1706
- birth_date: string;
1707
- pseudonym: string;
1708
- created_at: string;
1709
3768
  id: string;
3769
+ birth_date: string;
3770
+ last_name: string;
3771
+ middle_names: string;
1710
3772
  first_name: string;
3773
+ created_at: string;
1711
3774
  pronouns: Database["compliance"]["Enums"]["pronouns"][];
3775
+ pseudonym: string;
1712
3776
  nationality: string;
1713
- middle_names: string;
1714
- last_name: string;
1715
3777
  }[];
1716
3778
  };
1717
3779
  };
@@ -1722,312 +3784,51 @@ export type Database = {
1722
3784
  [_ in never]: never;
1723
3785
  };
1724
3786
  };
1725
- storage: {
3787
+ utilities: {
1726
3788
  Tables: {
1727
- buckets: {
1728
- Row: {
1729
- allowed_mime_types: string[] | null;
1730
- avif_autodetection: boolean | null;
1731
- created_at: string | null;
1732
- file_size_limit: number | null;
1733
- id: string;
1734
- name: string;
1735
- owner: string | null;
1736
- owner_id: string | null;
1737
- public: boolean | null;
1738
- updated_at: string | null;
1739
- };
1740
- Insert: {
1741
- allowed_mime_types?: string[] | null;
1742
- avif_autodetection?: boolean | null;
1743
- created_at?: string | null;
1744
- file_size_limit?: number | null;
1745
- id: string;
1746
- name: string;
1747
- owner?: string | null;
1748
- owner_id?: string | null;
1749
- public?: boolean | null;
1750
- updated_at?: string | null;
1751
- };
1752
- Update: {
1753
- allowed_mime_types?: string[] | null;
1754
- avif_autodetection?: boolean | null;
1755
- created_at?: string | null;
1756
- file_size_limit?: number | null;
1757
- id?: string;
1758
- name?: string;
1759
- owner?: string | null;
1760
- owner_id?: string | null;
1761
- public?: boolean | null;
1762
- updated_at?: string | null;
1763
- };
1764
- Relationships: [];
1765
- };
1766
- migrations: {
1767
- Row: {
1768
- executed_at: string | null;
1769
- hash: string;
1770
- id: number;
1771
- name: string;
1772
- };
1773
- Insert: {
1774
- executed_at?: string | null;
1775
- hash: string;
1776
- id: number;
1777
- name: string;
1778
- };
1779
- Update: {
1780
- executed_at?: string | null;
1781
- hash?: string;
1782
- id?: number;
1783
- name?: string;
1784
- };
1785
- Relationships: [];
1786
- };
1787
- objects: {
1788
- Row: {
1789
- bucket_id: string | null;
1790
- created_at: string | null;
1791
- id: string;
1792
- last_accessed_at: string | null;
1793
- metadata: Json | null;
1794
- name: string | null;
1795
- owner: string | null;
1796
- owner_id: string | null;
1797
- path_tokens: string[] | null;
1798
- updated_at: string | null;
1799
- user_metadata: Json | null;
1800
- version: string | null;
1801
- };
1802
- Insert: {
1803
- bucket_id?: string | null;
1804
- created_at?: string | null;
1805
- id?: string;
1806
- last_accessed_at?: string | null;
1807
- metadata?: Json | null;
1808
- name?: string | null;
1809
- owner?: string | null;
1810
- owner_id?: string | null;
1811
- path_tokens?: string[] | null;
1812
- updated_at?: string | null;
1813
- user_metadata?: Json | null;
1814
- version?: string | null;
1815
- };
1816
- Update: {
1817
- bucket_id?: string | null;
1818
- created_at?: string | null;
1819
- id?: string;
1820
- last_accessed_at?: string | null;
1821
- metadata?: Json | null;
1822
- name?: string | null;
1823
- owner?: string | null;
1824
- owner_id?: string | null;
1825
- path_tokens?: string[] | null;
1826
- updated_at?: string | null;
1827
- user_metadata?: Json | null;
1828
- version?: string | null;
1829
- };
1830
- Relationships: [
1831
- {
1832
- foreignKeyName: "objects_bucketId_fkey";
1833
- columns: ["bucket_id"];
1834
- isOneToOne: false;
1835
- referencedRelation: "buckets";
1836
- referencedColumns: ["id"];
1837
- }
1838
- ];
1839
- };
1840
- s3_multipart_uploads: {
1841
- Row: {
1842
- bucket_id: string;
1843
- created_at: string;
1844
- id: string;
1845
- in_progress_size: number;
1846
- key: string;
1847
- owner_id: string | null;
1848
- upload_signature: string;
1849
- user_metadata: Json | null;
1850
- version: string;
1851
- };
1852
- Insert: {
1853
- bucket_id: string;
1854
- created_at?: string;
1855
- id: string;
1856
- in_progress_size?: number;
1857
- key: string;
1858
- owner_id?: string | null;
1859
- upload_signature: string;
1860
- user_metadata?: Json | null;
1861
- version: string;
1862
- };
1863
- Update: {
1864
- bucket_id?: string;
1865
- created_at?: string;
1866
- id?: string;
1867
- in_progress_size?: number;
1868
- key?: string;
1869
- owner_id?: string | null;
1870
- upload_signature?: string;
1871
- user_metadata?: Json | null;
1872
- version?: string;
1873
- };
1874
- Relationships: [
1875
- {
1876
- foreignKeyName: "s3_multipart_uploads_bucket_id_fkey";
1877
- columns: ["bucket_id"];
1878
- isOneToOne: false;
1879
- referencedRelation: "buckets";
1880
- referencedColumns: ["id"];
1881
- }
1882
- ];
1883
- };
1884
- s3_multipart_uploads_parts: {
1885
- Row: {
1886
- bucket_id: string;
1887
- created_at: string;
1888
- etag: string;
1889
- id: string;
1890
- key: string;
1891
- owner_id: string | null;
1892
- part_number: number;
1893
- size: number;
1894
- upload_id: string;
1895
- version: string;
1896
- };
1897
- Insert: {
1898
- bucket_id: string;
1899
- created_at?: string;
1900
- etag: string;
1901
- id?: string;
1902
- key: string;
1903
- owner_id?: string | null;
1904
- part_number: number;
1905
- size?: number;
1906
- upload_id: string;
1907
- version: string;
1908
- };
1909
- Update: {
1910
- bucket_id?: string;
1911
- created_at?: string;
1912
- etag?: string;
1913
- id?: string;
1914
- key?: string;
1915
- owner_id?: string | null;
1916
- part_number?: number;
1917
- size?: number;
1918
- upload_id?: string;
1919
- version?: string;
1920
- };
1921
- Relationships: [
1922
- {
1923
- foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey";
1924
- columns: ["bucket_id"];
1925
- isOneToOne: false;
1926
- referencedRelation: "buckets";
1927
- referencedColumns: ["id"];
1928
- },
1929
- {
1930
- foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey";
1931
- columns: ["upload_id"];
1932
- isOneToOne: false;
1933
- referencedRelation: "s3_multipart_uploads";
1934
- referencedColumns: ["id"];
1935
- }
1936
- ];
1937
- };
3789
+ [_ in never]: never;
1938
3790
  };
1939
3791
  Views: {
1940
3792
  [_ in never]: never;
1941
3793
  };
1942
3794
  Functions: {
1943
- can_insert_object: {
1944
- Args: {
1945
- bucketid: string;
1946
- name: string;
1947
- owner: string;
1948
- metadata: Json;
1949
- };
1950
- Returns: undefined;
1951
- };
1952
- extension: {
3795
+ format_phone: {
1953
3796
  Args: {
1954
- name: string;
3797
+ p_phone: string;
1955
3798
  };
1956
3799
  Returns: string;
1957
3800
  };
1958
- filename: {
3801
+ to_date: {
1959
3802
  Args: {
1960
- name: string;
3803
+ p_date: string;
3804
+ p_format: string;
1961
3805
  };
1962
3806
  Returns: string;
1963
3807
  };
1964
- foldername: {
3808
+ validate_country_code: {
1965
3809
  Args: {
1966
- name: string;
3810
+ p_country_code: string;
1967
3811
  };
1968
- Returns: string[];
1969
- };
1970
- get_size_by_bucket: {
1971
- Args: Record<PropertyKey, never>;
1972
- Returns: {
1973
- size: number;
1974
- bucket_id: string;
1975
- }[];
3812
+ Returns: boolean;
1976
3813
  };
1977
- list_multipart_uploads_with_delimiter: {
3814
+ validate_date_not_future: {
1978
3815
  Args: {
1979
- bucket_id: string;
1980
- prefix_param: string;
1981
- delimiter_param: string;
1982
- max_keys?: number;
1983
- next_key_token?: string;
1984
- next_upload_token?: string;
3816
+ p_date: string;
1985
3817
  };
1986
- Returns: {
1987
- id: string;
1988
- key: string;
1989
- created_at: string;
1990
- }[];
3818
+ Returns: boolean;
1991
3819
  };
1992
- list_objects_with_delimiter: {
3820
+ validate_required_json_fields: {
1993
3821
  Args: {
1994
- bucket_id: string;
1995
- prefix_param: string;
1996
- delimiter_param: string;
1997
- max_keys?: number;
1998
- start_after?: string;
1999
- next_token?: string;
3822
+ p_json: Json;
3823
+ p_fields: string[];
2000
3824
  };
2001
- Returns: {
2002
- name: string;
2003
- id: string;
2004
- metadata: Json;
2005
- updated_at: string;
2006
- }[];
2007
- };
2008
- operation: {
2009
- Args: Record<PropertyKey, never>;
2010
- Returns: string;
3825
+ Returns: boolean;
2011
3826
  };
2012
- search: {
3827
+ validate_website_url: {
2013
3828
  Args: {
2014
- sortorder?: string;
2015
- prefix: string;
2016
- sortcolumn?: string;
2017
- search?: string;
2018
- offsets?: number;
2019
- levels?: number;
2020
- limits?: number;
2021
- bucketname: string;
3829
+ p_url: string;
2022
3830
  };
2023
- Returns: {
2024
- created_at: string;
2025
- updated_at: string;
2026
- id: string;
2027
- name: string;
2028
- metadata: Json;
2029
- last_accessed_at: string;
2030
- }[];
3831
+ Returns: boolean;
2031
3832
  };
2032
3833
  };
2033
3834
  Enums: {
@@ -2038,55 +3839,66 @@ export type Database = {
2038
3839
  };
2039
3840
  };
2040
3841
  };
2041
- type DefaultSchema = Database[Extract<keyof Database, "public">];
3842
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
3843
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
2042
3844
  export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
2043
- schema: keyof Database;
3845
+ schema: keyof DatabaseWithoutInternals;
2044
3846
  }, TableName extends DefaultSchemaTableNameOrOptions extends {
2045
- schema: keyof Database;
2046
- } ? keyof (Database[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & Database[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
2047
- schema: keyof Database;
2048
- } ? (Database[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & Database[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
3847
+ schema: keyof DatabaseWithoutInternals;
3848
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
3849
+ schema: keyof DatabaseWithoutInternals;
3850
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2049
3851
  Row: infer R;
2050
3852
  } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
2051
3853
  Row: infer R;
2052
3854
  } ? R : never : never;
2053
3855
  export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
2054
- schema: keyof Database;
3856
+ schema: keyof DatabaseWithoutInternals;
2055
3857
  }, TableName extends DefaultSchemaTableNameOrOptions extends {
2056
- schema: keyof Database;
2057
- } ? keyof Database[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
2058
- schema: keyof Database;
2059
- } ? Database[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
3858
+ schema: keyof DatabaseWithoutInternals;
3859
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
3860
+ schema: keyof DatabaseWithoutInternals;
3861
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2060
3862
  Insert: infer I;
2061
3863
  } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
2062
3864
  Insert: infer I;
2063
3865
  } ? I : never : never;
2064
3866
  export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
2065
- schema: keyof Database;
3867
+ schema: keyof DatabaseWithoutInternals;
2066
3868
  }, TableName extends DefaultSchemaTableNameOrOptions extends {
2067
- schema: keyof Database;
2068
- } ? keyof Database[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
2069
- schema: keyof Database;
2070
- } ? Database[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
3869
+ schema: keyof DatabaseWithoutInternals;
3870
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
3871
+ schema: keyof DatabaseWithoutInternals;
3872
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
2071
3873
  Update: infer U;
2072
3874
  } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
2073
3875
  Update: infer U;
2074
3876
  } ? U : never : never;
2075
3877
  export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
2076
- schema: keyof Database;
3878
+ schema: keyof DatabaseWithoutInternals;
2077
3879
  }, EnumName extends DefaultSchemaEnumNameOrOptions extends {
2078
- schema: keyof Database;
2079
- } ? keyof Database[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
2080
- schema: keyof Database;
2081
- } ? Database[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
3880
+ schema: keyof DatabaseWithoutInternals;
3881
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
3882
+ schema: keyof DatabaseWithoutInternals;
3883
+ } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
2082
3884
  export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
2083
- schema: keyof Database;
3885
+ schema: keyof DatabaseWithoutInternals;
2084
3886
  }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
2085
- schema: keyof Database;
2086
- } ? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
2087
- schema: keyof Database;
2088
- } ? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
3887
+ schema: keyof DatabaseWithoutInternals;
3888
+ } ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
3889
+ schema: keyof DatabaseWithoutInternals;
3890
+ } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
2089
3891
  export declare const Constants: {
3892
+ readonly competitions: {
3893
+ readonly Enums: {
3894
+ readonly event_participant_type: readonly ["player", "team"];
3895
+ readonly event_status: readonly ["scheduled", "active", "completed", "suspended", "cancelled"];
3896
+ readonly phase_registration_status: readonly ["pending", "active", "withdrawn", "disqualified"];
3897
+ readonly phase_type: readonly ["progression", "playoff"];
3898
+ readonly set_length_type: readonly ["first_to", "best_of", "fixed"];
3899
+ readonly set_scoring_type: readonly ["aggregate_score", "match_wins"];
3900
+ };
3901
+ };
2090
3902
  readonly compliance: {
2091
3903
  readonly Enums: {
2092
3904
  readonly account_type: readonly ["player", "lounge"];
@@ -2102,15 +3914,12 @@ export declare const Constants: {
2102
3914
  readonly twilio_verification_status: readonly ["pending", "approved", "canceled"];
2103
3915
  };
2104
3916
  };
2105
- readonly graphql_public: {
2106
- readonly Enums: {};
2107
- };
2108
3917
  readonly public: {
2109
3918
  readonly Enums: {
2110
3919
  readonly social_media_platform: readonly ["facebook", "instagram", "kick", "tiktok", "twitch", "twitter", "youtube"];
2111
3920
  };
2112
3921
  };
2113
- readonly storage: {
3922
+ readonly utilities: {
2114
3923
  readonly Enums: {};
2115
3924
  };
2116
3925
  };