@simonarcher/fika-types 1.0.92 → 1.1.0

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.
@@ -0,0 +1,3914 @@
1
+ /**
2
+ * Supabase Database Types
3
+ *
4
+ * Auto-generated from Supabase schema using `mcp__supabase__generate_typescript_types`
5
+ * Generated: 2026-01-18
6
+ * Project: FIKA - Dev (oteybpkhtggfxoqlcast)
7
+ *
8
+ * Usage:
9
+ * import { Database } from '@fika/schema/supabase';
10
+ * import { createClient } from '@supabase/supabase-js';
11
+ * const supabase = createClient<Database>(url, key);
12
+ *
13
+ * To regenerate: Run the Supabase MCP generate_typescript_types tool
14
+ */
15
+ export type Json = string | number | boolean | null | {
16
+ [key: string]: Json | undefined;
17
+ } | Json[];
18
+ export type Database = {
19
+ __InternalSupabase: {
20
+ PostgrestVersion: "14.1";
21
+ };
22
+ public: {
23
+ Tables: {
24
+ actions: {
25
+ Row: {
26
+ action: string;
27
+ created_at: string | null;
28
+ id: string;
29
+ metadata: Json | null;
30
+ shop_id: string | null;
31
+ user_id: string | null;
32
+ };
33
+ Insert: {
34
+ action: string;
35
+ created_at?: string | null;
36
+ id: string;
37
+ metadata?: Json | null;
38
+ shop_id?: string | null;
39
+ user_id?: string | null;
40
+ };
41
+ Update: {
42
+ action?: string;
43
+ created_at?: string | null;
44
+ id?: string;
45
+ metadata?: Json | null;
46
+ shop_id?: string | null;
47
+ user_id?: string | null;
48
+ };
49
+ Relationships: [
50
+ {
51
+ foreignKeyName: "actions_shop_id_fkey";
52
+ columns: ["shop_id"];
53
+ isOneToOne: false;
54
+ referencedRelation: "shop_stats";
55
+ referencedColumns: ["id"];
56
+ },
57
+ {
58
+ foreignKeyName: "actions_shop_id_fkey";
59
+ columns: ["shop_id"];
60
+ isOneToOne: false;
61
+ referencedRelation: "shops";
62
+ referencedColumns: ["id"];
63
+ },
64
+ {
65
+ foreignKeyName: "actions_user_id_fkey";
66
+ columns: ["user_id"];
67
+ isOneToOne: false;
68
+ referencedRelation: "leaderboard";
69
+ referencedColumns: ["id"];
70
+ },
71
+ {
72
+ foreignKeyName: "actions_user_id_fkey";
73
+ columns: ["user_id"];
74
+ isOneToOne: false;
75
+ referencedRelation: "user_activity_summary";
76
+ referencedColumns: ["id"];
77
+ },
78
+ {
79
+ foreignKeyName: "actions_user_id_fkey";
80
+ columns: ["user_id"];
81
+ isOneToOne: false;
82
+ referencedRelation: "users";
83
+ referencedColumns: ["id"];
84
+ }
85
+ ];
86
+ };
87
+ app_settings: {
88
+ Row: {
89
+ category: string | null;
90
+ created_at: string;
91
+ description: string | null;
92
+ id: string;
93
+ is_public: boolean | null;
94
+ updated_at: string;
95
+ updated_by: string | null;
96
+ value: Json;
97
+ };
98
+ Insert: {
99
+ category?: string | null;
100
+ created_at?: string;
101
+ description?: string | null;
102
+ id: string;
103
+ is_public?: boolean | null;
104
+ updated_at?: string;
105
+ updated_by?: string | null;
106
+ value: Json;
107
+ };
108
+ Update: {
109
+ category?: string | null;
110
+ created_at?: string;
111
+ description?: string | null;
112
+ id?: string;
113
+ is_public?: boolean | null;
114
+ updated_at?: string;
115
+ updated_by?: string | null;
116
+ value?: Json;
117
+ };
118
+ Relationships: [
119
+ {
120
+ foreignKeyName: "app_settings_updated_by_fkey";
121
+ columns: ["updated_by"];
122
+ isOneToOne: false;
123
+ referencedRelation: "leaderboard";
124
+ referencedColumns: ["id"];
125
+ },
126
+ {
127
+ foreignKeyName: "app_settings_updated_by_fkey";
128
+ columns: ["updated_by"];
129
+ isOneToOne: false;
130
+ referencedRelation: "user_activity_summary";
131
+ referencedColumns: ["id"];
132
+ },
133
+ {
134
+ foreignKeyName: "app_settings_updated_by_fkey";
135
+ columns: ["updated_by"];
136
+ isOneToOne: false;
137
+ referencedRelation: "users";
138
+ referencedColumns: ["id"];
139
+ }
140
+ ];
141
+ };
142
+ assertions: {
143
+ Row: {
144
+ assertion_type: string;
145
+ created_at: string | null;
146
+ display_name: string | null;
147
+ id: string;
148
+ last_updated_at: string | null;
149
+ shop_id: string | null;
150
+ status: string | null;
151
+ subject_id: string;
152
+ threshold: number | null;
153
+ unique_voters: number | null;
154
+ };
155
+ Insert: {
156
+ assertion_type: string;
157
+ created_at?: string | null;
158
+ display_name?: string | null;
159
+ id: string;
160
+ last_updated_at?: string | null;
161
+ shop_id?: string | null;
162
+ status?: string | null;
163
+ subject_id: string;
164
+ threshold?: number | null;
165
+ unique_voters?: number | null;
166
+ };
167
+ Update: {
168
+ assertion_type?: string;
169
+ created_at?: string | null;
170
+ display_name?: string | null;
171
+ id?: string;
172
+ last_updated_at?: string | null;
173
+ shop_id?: string | null;
174
+ status?: string | null;
175
+ subject_id?: string;
176
+ threshold?: number | null;
177
+ unique_voters?: number | null;
178
+ };
179
+ Relationships: [
180
+ {
181
+ foreignKeyName: "assertions_shop_id_fkey";
182
+ columns: ["shop_id"];
183
+ isOneToOne: false;
184
+ referencedRelation: "shop_stats";
185
+ referencedColumns: ["id"];
186
+ },
187
+ {
188
+ foreignKeyName: "assertions_shop_id_fkey";
189
+ columns: ["shop_id"];
190
+ isOneToOne: false;
191
+ referencedRelation: "shops";
192
+ referencedColumns: ["id"];
193
+ }
194
+ ];
195
+ };
196
+ audit_logs: {
197
+ Row: {
198
+ action: string;
199
+ created_at: string;
200
+ entity_id: string | null;
201
+ entity_type: string | null;
202
+ id: string;
203
+ ip_address: string | null;
204
+ new_value: Json | null;
205
+ old_value: Json | null;
206
+ user_agent: string | null;
207
+ user_id: string | null;
208
+ };
209
+ Insert: {
210
+ action: string;
211
+ created_at?: string;
212
+ entity_id?: string | null;
213
+ entity_type?: string | null;
214
+ id?: string;
215
+ ip_address?: string | null;
216
+ new_value?: Json | null;
217
+ old_value?: Json | null;
218
+ user_agent?: string | null;
219
+ user_id?: string | null;
220
+ };
221
+ Update: {
222
+ action?: string;
223
+ created_at?: string;
224
+ entity_id?: string | null;
225
+ entity_type?: string | null;
226
+ id?: string;
227
+ ip_address?: string | null;
228
+ new_value?: Json | null;
229
+ old_value?: Json | null;
230
+ user_agent?: string | null;
231
+ user_id?: string | null;
232
+ };
233
+ Relationships: [
234
+ {
235
+ foreignKeyName: "audit_logs_user_id_fkey";
236
+ columns: ["user_id"];
237
+ isOneToOne: false;
238
+ referencedRelation: "leaderboard";
239
+ referencedColumns: ["id"];
240
+ },
241
+ {
242
+ foreignKeyName: "audit_logs_user_id_fkey";
243
+ columns: ["user_id"];
244
+ isOneToOne: false;
245
+ referencedRelation: "user_activity_summary";
246
+ referencedColumns: ["id"];
247
+ },
248
+ {
249
+ foreignKeyName: "audit_logs_user_id_fkey";
250
+ columns: ["user_id"];
251
+ isOneToOne: false;
252
+ referencedRelation: "users";
253
+ referencedColumns: ["id"];
254
+ }
255
+ ];
256
+ };
257
+ coffee_bean_submissions: {
258
+ Row: {
259
+ approved_bean_id: string | null;
260
+ bean_name: string;
261
+ created_at: string;
262
+ id: string;
263
+ image_url: string | null;
264
+ origin: string | null;
265
+ process: string | null;
266
+ review_notes: string | null;
267
+ reviewed_at: string | null;
268
+ reviewed_by: string | null;
269
+ roast_level: string | null;
270
+ roaster_id: string | null;
271
+ shop_id: string | null;
272
+ status: string;
273
+ tasting_notes: string[] | null;
274
+ updated_at: string;
275
+ user_id: string;
276
+ };
277
+ Insert: {
278
+ approved_bean_id?: string | null;
279
+ bean_name: string;
280
+ created_at?: string;
281
+ id?: string;
282
+ image_url?: string | null;
283
+ origin?: string | null;
284
+ process?: string | null;
285
+ review_notes?: string | null;
286
+ reviewed_at?: string | null;
287
+ reviewed_by?: string | null;
288
+ roast_level?: string | null;
289
+ roaster_id?: string | null;
290
+ shop_id?: string | null;
291
+ status?: string;
292
+ tasting_notes?: string[] | null;
293
+ updated_at?: string;
294
+ user_id: string;
295
+ };
296
+ Update: {
297
+ approved_bean_id?: string | null;
298
+ bean_name?: string;
299
+ created_at?: string;
300
+ id?: string;
301
+ image_url?: string | null;
302
+ origin?: string | null;
303
+ process?: string | null;
304
+ review_notes?: string | null;
305
+ reviewed_at?: string | null;
306
+ reviewed_by?: string | null;
307
+ roast_level?: string | null;
308
+ roaster_id?: string | null;
309
+ shop_id?: string | null;
310
+ status?: string;
311
+ tasting_notes?: string[] | null;
312
+ updated_at?: string;
313
+ user_id?: string;
314
+ };
315
+ Relationships: [
316
+ {
317
+ foreignKeyName: "coffee_bean_submissions_approved_bean_id_fkey";
318
+ columns: ["approved_bean_id"];
319
+ isOneToOne: false;
320
+ referencedRelation: "coffee_beans";
321
+ referencedColumns: ["id"];
322
+ },
323
+ {
324
+ foreignKeyName: "coffee_bean_submissions_reviewed_by_fkey";
325
+ columns: ["reviewed_by"];
326
+ isOneToOne: false;
327
+ referencedRelation: "leaderboard";
328
+ referencedColumns: ["id"];
329
+ },
330
+ {
331
+ foreignKeyName: "coffee_bean_submissions_reviewed_by_fkey";
332
+ columns: ["reviewed_by"];
333
+ isOneToOne: false;
334
+ referencedRelation: "user_activity_summary";
335
+ referencedColumns: ["id"];
336
+ },
337
+ {
338
+ foreignKeyName: "coffee_bean_submissions_reviewed_by_fkey";
339
+ columns: ["reviewed_by"];
340
+ isOneToOne: false;
341
+ referencedRelation: "users";
342
+ referencedColumns: ["id"];
343
+ },
344
+ {
345
+ foreignKeyName: "coffee_bean_submissions_roaster_id_fkey";
346
+ columns: ["roaster_id"];
347
+ isOneToOne: false;
348
+ referencedRelation: "roasters";
349
+ referencedColumns: ["id"];
350
+ },
351
+ {
352
+ foreignKeyName: "coffee_bean_submissions_shop_id_fkey";
353
+ columns: ["shop_id"];
354
+ isOneToOne: false;
355
+ referencedRelation: "shop_stats";
356
+ referencedColumns: ["id"];
357
+ },
358
+ {
359
+ foreignKeyName: "coffee_bean_submissions_shop_id_fkey";
360
+ columns: ["shop_id"];
361
+ isOneToOne: false;
362
+ referencedRelation: "shops";
363
+ referencedColumns: ["id"];
364
+ },
365
+ {
366
+ foreignKeyName: "coffee_bean_submissions_user_id_fkey";
367
+ columns: ["user_id"];
368
+ isOneToOne: false;
369
+ referencedRelation: "leaderboard";
370
+ referencedColumns: ["id"];
371
+ },
372
+ {
373
+ foreignKeyName: "coffee_bean_submissions_user_id_fkey";
374
+ columns: ["user_id"];
375
+ isOneToOne: false;
376
+ referencedRelation: "user_activity_summary";
377
+ referencedColumns: ["id"];
378
+ },
379
+ {
380
+ foreignKeyName: "coffee_bean_submissions_user_id_fkey";
381
+ columns: ["user_id"];
382
+ isOneToOne: false;
383
+ referencedRelation: "users";
384
+ referencedColumns: ["id"];
385
+ }
386
+ ];
387
+ };
388
+ coffee_beans: {
389
+ Row: {
390
+ active: boolean | null;
391
+ country: string | null;
392
+ created_at: string | null;
393
+ decaf_method: string | null;
394
+ description: string | null;
395
+ elevation: number | null;
396
+ farm_id: string | null;
397
+ id: string;
398
+ image: string | null;
399
+ is_decaf: boolean | null;
400
+ limited_edition: boolean | null;
401
+ name: string | null;
402
+ origin: string | null;
403
+ origins: Json | null;
404
+ processing: string | null;
405
+ region: string | null;
406
+ roaster_id: string | null;
407
+ tasting_notes: string[] | null;
408
+ updated_at: string | null;
409
+ };
410
+ Insert: {
411
+ active?: boolean | null;
412
+ country?: string | null;
413
+ created_at?: string | null;
414
+ decaf_method?: string | null;
415
+ description?: string | null;
416
+ elevation?: number | null;
417
+ farm_id?: string | null;
418
+ id: string;
419
+ image?: string | null;
420
+ is_decaf?: boolean | null;
421
+ limited_edition?: boolean | null;
422
+ name?: string | null;
423
+ origin?: string | null;
424
+ origins?: Json | null;
425
+ processing?: string | null;
426
+ region?: string | null;
427
+ roaster_id?: string | null;
428
+ tasting_notes?: string[] | null;
429
+ updated_at?: string | null;
430
+ };
431
+ Update: {
432
+ active?: boolean | null;
433
+ country?: string | null;
434
+ created_at?: string | null;
435
+ decaf_method?: string | null;
436
+ description?: string | null;
437
+ elevation?: number | null;
438
+ farm_id?: string | null;
439
+ id?: string;
440
+ image?: string | null;
441
+ is_decaf?: boolean | null;
442
+ limited_edition?: boolean | null;
443
+ name?: string | null;
444
+ origin?: string | null;
445
+ origins?: Json | null;
446
+ processing?: string | null;
447
+ region?: string | null;
448
+ roaster_id?: string | null;
449
+ tasting_notes?: string[] | null;
450
+ updated_at?: string | null;
451
+ };
452
+ Relationships: [
453
+ {
454
+ foreignKeyName: "coffee_beans_farm_id_fkey";
455
+ columns: ["farm_id"];
456
+ isOneToOne: false;
457
+ referencedRelation: "farms";
458
+ referencedColumns: ["id"];
459
+ },
460
+ {
461
+ foreignKeyName: "coffee_beans_roaster_id_fkey";
462
+ columns: ["roaster_id"];
463
+ isOneToOne: false;
464
+ referencedRelation: "roasters";
465
+ referencedColumns: ["id"];
466
+ }
467
+ ];
468
+ };
469
+ event_attendees: {
470
+ Row: {
471
+ event_id: string;
472
+ registered_at: string | null;
473
+ status: string | null;
474
+ user_id: string;
475
+ };
476
+ Insert: {
477
+ event_id: string;
478
+ registered_at?: string | null;
479
+ status?: string | null;
480
+ user_id: string;
481
+ };
482
+ Update: {
483
+ event_id?: string;
484
+ registered_at?: string | null;
485
+ status?: string | null;
486
+ user_id?: string;
487
+ };
488
+ Relationships: [
489
+ {
490
+ foreignKeyName: "event_attendees_event_id_fkey";
491
+ columns: ["event_id"];
492
+ isOneToOne: false;
493
+ referencedRelation: "events";
494
+ referencedColumns: ["id"];
495
+ },
496
+ {
497
+ foreignKeyName: "event_attendees_user_id_fkey";
498
+ columns: ["user_id"];
499
+ isOneToOne: false;
500
+ referencedRelation: "leaderboard";
501
+ referencedColumns: ["id"];
502
+ },
503
+ {
504
+ foreignKeyName: "event_attendees_user_id_fkey";
505
+ columns: ["user_id"];
506
+ isOneToOne: false;
507
+ referencedRelation: "user_activity_summary";
508
+ referencedColumns: ["id"];
509
+ },
510
+ {
511
+ foreignKeyName: "event_attendees_user_id_fkey";
512
+ columns: ["user_id"];
513
+ isOneToOne: false;
514
+ referencedRelation: "users";
515
+ referencedColumns: ["id"];
516
+ }
517
+ ];
518
+ };
519
+ event_updates: {
520
+ Row: {
521
+ event_id: string | null;
522
+ id: string;
523
+ message: string | null;
524
+ notification_ids: string[] | null;
525
+ recipient_count: number | null;
526
+ sent_at: string | null;
527
+ sent_by: string | null;
528
+ shop_id: string | null;
529
+ title: string | null;
530
+ };
531
+ Insert: {
532
+ event_id?: string | null;
533
+ id: string;
534
+ message?: string | null;
535
+ notification_ids?: string[] | null;
536
+ recipient_count?: number | null;
537
+ sent_at?: string | null;
538
+ sent_by?: string | null;
539
+ shop_id?: string | null;
540
+ title?: string | null;
541
+ };
542
+ Update: {
543
+ event_id?: string | null;
544
+ id?: string;
545
+ message?: string | null;
546
+ notification_ids?: string[] | null;
547
+ recipient_count?: number | null;
548
+ sent_at?: string | null;
549
+ sent_by?: string | null;
550
+ shop_id?: string | null;
551
+ title?: string | null;
552
+ };
553
+ Relationships: [
554
+ {
555
+ foreignKeyName: "event_updates_event_id_fkey";
556
+ columns: ["event_id"];
557
+ isOneToOne: false;
558
+ referencedRelation: "events";
559
+ referencedColumns: ["id"];
560
+ },
561
+ {
562
+ foreignKeyName: "event_updates_shop_id_fkey";
563
+ columns: ["shop_id"];
564
+ isOneToOne: false;
565
+ referencedRelation: "shop_stats";
566
+ referencedColumns: ["id"];
567
+ },
568
+ {
569
+ foreignKeyName: "event_updates_shop_id_fkey";
570
+ columns: ["shop_id"];
571
+ isOneToOne: false;
572
+ referencedRelation: "shops";
573
+ referencedColumns: ["id"];
574
+ }
575
+ ];
576
+ };
577
+ events: {
578
+ Row: {
579
+ active: boolean | null;
580
+ city: string | null;
581
+ coordinates: Json | null;
582
+ country_code: string | null;
583
+ created_at: string | null;
584
+ cta: string | null;
585
+ date: string | null;
586
+ description: string | null;
587
+ event_url: string | null;
588
+ host_id: string | null;
589
+ id: string;
590
+ image_url: string | null;
591
+ latitude: number | null;
592
+ location_name: string | null;
593
+ longitude: number | null;
594
+ name: string | null;
595
+ spaces: number | null;
596
+ updated_at: string | null;
597
+ url: string | null;
598
+ };
599
+ Insert: {
600
+ active?: boolean | null;
601
+ city?: string | null;
602
+ coordinates?: Json | null;
603
+ country_code?: string | null;
604
+ created_at?: string | null;
605
+ cta?: string | null;
606
+ date?: string | null;
607
+ description?: string | null;
608
+ event_url?: string | null;
609
+ host_id?: string | null;
610
+ id: string;
611
+ image_url?: string | null;
612
+ latitude?: number | null;
613
+ location_name?: string | null;
614
+ longitude?: number | null;
615
+ name?: string | null;
616
+ spaces?: number | null;
617
+ updated_at?: string | null;
618
+ url?: string | null;
619
+ };
620
+ Update: {
621
+ active?: boolean | null;
622
+ city?: string | null;
623
+ coordinates?: Json | null;
624
+ country_code?: string | null;
625
+ created_at?: string | null;
626
+ cta?: string | null;
627
+ date?: string | null;
628
+ description?: string | null;
629
+ event_url?: string | null;
630
+ host_id?: string | null;
631
+ id?: string;
632
+ image_url?: string | null;
633
+ latitude?: number | null;
634
+ location_name?: string | null;
635
+ longitude?: number | null;
636
+ name?: string | null;
637
+ spaces?: number | null;
638
+ updated_at?: string | null;
639
+ url?: string | null;
640
+ };
641
+ Relationships: [
642
+ {
643
+ foreignKeyName: "events_host_id_fkey";
644
+ columns: ["host_id"];
645
+ isOneToOne: false;
646
+ referencedRelation: "shop_stats";
647
+ referencedColumns: ["id"];
648
+ },
649
+ {
650
+ foreignKeyName: "events_host_id_fkey";
651
+ columns: ["host_id"];
652
+ isOneToOne: false;
653
+ referencedRelation: "shops";
654
+ referencedColumns: ["id"];
655
+ }
656
+ ];
657
+ };
658
+ farms: {
659
+ Row: {
660
+ aliases: string[] | null;
661
+ altitude_max: number | null;
662
+ altitude_min: number | null;
663
+ certifications: string[] | null;
664
+ climate_notes: string | null;
665
+ coordinates: Json | null;
666
+ country: string | null;
667
+ created_at: string | null;
668
+ id: string;
669
+ known_for: string | null;
670
+ logo: string | null;
671
+ manager: string | null;
672
+ name: string;
673
+ notes: string | null;
674
+ owner: string | null;
675
+ photos: string[] | null;
676
+ processing_facilities: string[] | null;
677
+ processing_methods: string[] | null;
678
+ region: string | null;
679
+ social_media: Json | null;
680
+ soil_type: string | null;
681
+ subregion: string | null;
682
+ sustainability_practices: string[] | null;
683
+ updated_at: string | null;
684
+ varieties: string[] | null;
685
+ website: string | null;
686
+ };
687
+ Insert: {
688
+ aliases?: string[] | null;
689
+ altitude_max?: number | null;
690
+ altitude_min?: number | null;
691
+ certifications?: string[] | null;
692
+ climate_notes?: string | null;
693
+ coordinates?: Json | null;
694
+ country?: string | null;
695
+ created_at?: string | null;
696
+ id: string;
697
+ known_for?: string | null;
698
+ logo?: string | null;
699
+ manager?: string | null;
700
+ name: string;
701
+ notes?: string | null;
702
+ owner?: string | null;
703
+ photos?: string[] | null;
704
+ processing_facilities?: string[] | null;
705
+ processing_methods?: string[] | null;
706
+ region?: string | null;
707
+ social_media?: Json | null;
708
+ soil_type?: string | null;
709
+ subregion?: string | null;
710
+ sustainability_practices?: string[] | null;
711
+ updated_at?: string | null;
712
+ varieties?: string[] | null;
713
+ website?: string | null;
714
+ };
715
+ Update: {
716
+ aliases?: string[] | null;
717
+ altitude_max?: number | null;
718
+ altitude_min?: number | null;
719
+ certifications?: string[] | null;
720
+ climate_notes?: string | null;
721
+ coordinates?: Json | null;
722
+ country?: string | null;
723
+ created_at?: string | null;
724
+ id?: string;
725
+ known_for?: string | null;
726
+ logo?: string | null;
727
+ manager?: string | null;
728
+ name?: string;
729
+ notes?: string | null;
730
+ owner?: string | null;
731
+ photos?: string[] | null;
732
+ processing_facilities?: string[] | null;
733
+ processing_methods?: string[] | null;
734
+ region?: string | null;
735
+ social_media?: Json | null;
736
+ soil_type?: string | null;
737
+ subregion?: string | null;
738
+ sustainability_practices?: string[] | null;
739
+ updated_at?: string | null;
740
+ varieties?: string[] | null;
741
+ website?: string | null;
742
+ };
743
+ Relationships: [];
744
+ };
745
+ fcm_tokens: {
746
+ Row: {
747
+ created_at: string;
748
+ device_id: string | null;
749
+ device_type: string | null;
750
+ id: string;
751
+ is_active: boolean | null;
752
+ last_used_at: string | null;
753
+ token: string;
754
+ updated_at: string;
755
+ user_id: string;
756
+ };
757
+ Insert: {
758
+ created_at?: string;
759
+ device_id?: string | null;
760
+ device_type?: string | null;
761
+ id?: string;
762
+ is_active?: boolean | null;
763
+ last_used_at?: string | null;
764
+ token: string;
765
+ updated_at?: string;
766
+ user_id: string;
767
+ };
768
+ Update: {
769
+ created_at?: string;
770
+ device_id?: string | null;
771
+ device_type?: string | null;
772
+ id?: string;
773
+ is_active?: boolean | null;
774
+ last_used_at?: string | null;
775
+ token?: string;
776
+ updated_at?: string;
777
+ user_id?: string;
778
+ };
779
+ Relationships: [
780
+ {
781
+ foreignKeyName: "fcm_tokens_user_id_fkey";
782
+ columns: ["user_id"];
783
+ isOneToOne: false;
784
+ referencedRelation: "leaderboard";
785
+ referencedColumns: ["id"];
786
+ },
787
+ {
788
+ foreignKeyName: "fcm_tokens_user_id_fkey";
789
+ columns: ["user_id"];
790
+ isOneToOne: false;
791
+ referencedRelation: "user_activity_summary";
792
+ referencedColumns: ["id"];
793
+ },
794
+ {
795
+ foreignKeyName: "fcm_tokens_user_id_fkey";
796
+ columns: ["user_id"];
797
+ isOneToOne: false;
798
+ referencedRelation: "users";
799
+ referencedColumns: ["id"];
800
+ }
801
+ ];
802
+ };
803
+ franchise_roasters: {
804
+ Row: {
805
+ franchise_id: string;
806
+ roaster_id: string;
807
+ };
808
+ Insert: {
809
+ franchise_id: string;
810
+ roaster_id: string;
811
+ };
812
+ Update: {
813
+ franchise_id?: string;
814
+ roaster_id?: string;
815
+ };
816
+ Relationships: [
817
+ {
818
+ foreignKeyName: "franchise_roasters_franchise_id_fkey";
819
+ columns: ["franchise_id"];
820
+ isOneToOne: false;
821
+ referencedRelation: "franchises";
822
+ referencedColumns: ["id"];
823
+ },
824
+ {
825
+ foreignKeyName: "franchise_roasters_roaster_id_fkey";
826
+ columns: ["roaster_id"];
827
+ isOneToOne: false;
828
+ referencedRelation: "roasters";
829
+ referencedColumns: ["id"];
830
+ }
831
+ ];
832
+ };
833
+ franchises: {
834
+ Row: {
835
+ country_code: string | null;
836
+ cover_image: string | null;
837
+ created_at: string | null;
838
+ description: string | null;
839
+ id: string;
840
+ logo_image: string | null;
841
+ menu: Json | null;
842
+ name: string;
843
+ total_locations: number | null;
844
+ updated_at: string | null;
845
+ website: string | null;
846
+ };
847
+ Insert: {
848
+ country_code?: string | null;
849
+ cover_image?: string | null;
850
+ created_at?: string | null;
851
+ description?: string | null;
852
+ id: string;
853
+ logo_image?: string | null;
854
+ menu?: Json | null;
855
+ name: string;
856
+ total_locations?: number | null;
857
+ updated_at?: string | null;
858
+ website?: string | null;
859
+ };
860
+ Update: {
861
+ country_code?: string | null;
862
+ cover_image?: string | null;
863
+ created_at?: string | null;
864
+ description?: string | null;
865
+ id?: string;
866
+ logo_image?: string | null;
867
+ menu?: Json | null;
868
+ name?: string;
869
+ total_locations?: number | null;
870
+ updated_at?: string | null;
871
+ website?: string | null;
872
+ };
873
+ Relationships: [];
874
+ };
875
+ loyalty_audit_logs: {
876
+ Row: {
877
+ description: string | null;
878
+ event_details: Json | null;
879
+ event_type: string;
880
+ id: string;
881
+ outcome: string | null;
882
+ request_metadata: Json | null;
883
+ severity: string | null;
884
+ shop_id: string | null;
885
+ source: string | null;
886
+ staff_id: string | null;
887
+ timestamp: string | null;
888
+ };
889
+ Insert: {
890
+ description?: string | null;
891
+ event_details?: Json | null;
892
+ event_type: string;
893
+ id: string;
894
+ outcome?: string | null;
895
+ request_metadata?: Json | null;
896
+ severity?: string | null;
897
+ shop_id?: string | null;
898
+ source?: string | null;
899
+ staff_id?: string | null;
900
+ timestamp?: string | null;
901
+ };
902
+ Update: {
903
+ description?: string | null;
904
+ event_details?: Json | null;
905
+ event_type?: string;
906
+ id?: string;
907
+ outcome?: string | null;
908
+ request_metadata?: Json | null;
909
+ severity?: string | null;
910
+ shop_id?: string | null;
911
+ source?: string | null;
912
+ staff_id?: string | null;
913
+ timestamp?: string | null;
914
+ };
915
+ Relationships: [
916
+ {
917
+ foreignKeyName: "loyalty_audit_logs_shop_id_fkey";
918
+ columns: ["shop_id"];
919
+ isOneToOne: false;
920
+ referencedRelation: "shop_stats";
921
+ referencedColumns: ["id"];
922
+ },
923
+ {
924
+ foreignKeyName: "loyalty_audit_logs_shop_id_fkey";
925
+ columns: ["shop_id"];
926
+ isOneToOne: false;
927
+ referencedRelation: "shops";
928
+ referencedColumns: ["id"];
929
+ }
930
+ ];
931
+ };
932
+ loyalty_stamps: {
933
+ Row: {
934
+ created_at: string | null;
935
+ id: string;
936
+ issue_method: string | null;
937
+ issuer_id: string | null;
938
+ redeemed: boolean | null;
939
+ redeemed_at: string | null;
940
+ shop_id: string | null;
941
+ type: string | null;
942
+ updated_at: string | null;
943
+ user_id: string | null;
944
+ valid: boolean | null;
945
+ voucher_id: string | null;
946
+ };
947
+ Insert: {
948
+ created_at?: string | null;
949
+ id: string;
950
+ issue_method?: string | null;
951
+ issuer_id?: string | null;
952
+ redeemed?: boolean | null;
953
+ redeemed_at?: string | null;
954
+ shop_id?: string | null;
955
+ type?: string | null;
956
+ updated_at?: string | null;
957
+ user_id?: string | null;
958
+ valid?: boolean | null;
959
+ voucher_id?: string | null;
960
+ };
961
+ Update: {
962
+ created_at?: string | null;
963
+ id?: string;
964
+ issue_method?: string | null;
965
+ issuer_id?: string | null;
966
+ redeemed?: boolean | null;
967
+ redeemed_at?: string | null;
968
+ shop_id?: string | null;
969
+ type?: string | null;
970
+ updated_at?: string | null;
971
+ user_id?: string | null;
972
+ valid?: boolean | null;
973
+ voucher_id?: string | null;
974
+ };
975
+ Relationships: [
976
+ {
977
+ foreignKeyName: "loyalty_stamps_shop_id_fkey";
978
+ columns: ["shop_id"];
979
+ isOneToOne: false;
980
+ referencedRelation: "shop_stats";
981
+ referencedColumns: ["id"];
982
+ },
983
+ {
984
+ foreignKeyName: "loyalty_stamps_shop_id_fkey";
985
+ columns: ["shop_id"];
986
+ isOneToOne: false;
987
+ referencedRelation: "shops";
988
+ referencedColumns: ["id"];
989
+ },
990
+ {
991
+ foreignKeyName: "loyalty_stamps_user_id_fkey";
992
+ columns: ["user_id"];
993
+ isOneToOne: false;
994
+ referencedRelation: "leaderboard";
995
+ referencedColumns: ["id"];
996
+ },
997
+ {
998
+ foreignKeyName: "loyalty_stamps_user_id_fkey";
999
+ columns: ["user_id"];
1000
+ isOneToOne: false;
1001
+ referencedRelation: "user_activity_summary";
1002
+ referencedColumns: ["id"];
1003
+ },
1004
+ {
1005
+ foreignKeyName: "loyalty_stamps_user_id_fkey";
1006
+ columns: ["user_id"];
1007
+ isOneToOne: false;
1008
+ referencedRelation: "users";
1009
+ referencedColumns: ["id"];
1010
+ }
1011
+ ];
1012
+ };
1013
+ loyalty_vouchers: {
1014
+ Row: {
1015
+ claim_token: string | null;
1016
+ claim_token_expires_at: string | null;
1017
+ created_at: string | null;
1018
+ id: string;
1019
+ is_open_voucher: boolean | null;
1020
+ platform_reward: Json | null;
1021
+ redeemed: boolean | null;
1022
+ redeemed_at: string | null;
1023
+ redeemed_by: string | null;
1024
+ redemption_location: string | null;
1025
+ reward_description: string | null;
1026
+ reward_type: string | null;
1027
+ security_code: string | null;
1028
+ shop_id: string | null;
1029
+ source: Json | null;
1030
+ stamps: string[] | null;
1031
+ updated_at: string | null;
1032
+ user_id: string | null;
1033
+ valid: boolean | null;
1034
+ voucher_type: string | null;
1035
+ };
1036
+ Insert: {
1037
+ claim_token?: string | null;
1038
+ claim_token_expires_at?: string | null;
1039
+ created_at?: string | null;
1040
+ id: string;
1041
+ is_open_voucher?: boolean | null;
1042
+ platform_reward?: Json | null;
1043
+ redeemed?: boolean | null;
1044
+ redeemed_at?: string | null;
1045
+ redeemed_by?: string | null;
1046
+ redemption_location?: string | null;
1047
+ reward_description?: string | null;
1048
+ reward_type?: string | null;
1049
+ security_code?: string | null;
1050
+ shop_id?: string | null;
1051
+ source?: Json | null;
1052
+ stamps?: string[] | null;
1053
+ updated_at?: string | null;
1054
+ user_id?: string | null;
1055
+ valid?: boolean | null;
1056
+ voucher_type?: string | null;
1057
+ };
1058
+ Update: {
1059
+ claim_token?: string | null;
1060
+ claim_token_expires_at?: string | null;
1061
+ created_at?: string | null;
1062
+ id?: string;
1063
+ is_open_voucher?: boolean | null;
1064
+ platform_reward?: Json | null;
1065
+ redeemed?: boolean | null;
1066
+ redeemed_at?: string | null;
1067
+ redeemed_by?: string | null;
1068
+ redemption_location?: string | null;
1069
+ reward_description?: string | null;
1070
+ reward_type?: string | null;
1071
+ security_code?: string | null;
1072
+ shop_id?: string | null;
1073
+ source?: Json | null;
1074
+ stamps?: string[] | null;
1075
+ updated_at?: string | null;
1076
+ user_id?: string | null;
1077
+ valid?: boolean | null;
1078
+ voucher_type?: string | null;
1079
+ };
1080
+ Relationships: [
1081
+ {
1082
+ foreignKeyName: "loyalty_vouchers_shop_id_fkey";
1083
+ columns: ["shop_id"];
1084
+ isOneToOne: false;
1085
+ referencedRelation: "shop_stats";
1086
+ referencedColumns: ["id"];
1087
+ },
1088
+ {
1089
+ foreignKeyName: "loyalty_vouchers_shop_id_fkey";
1090
+ columns: ["shop_id"];
1091
+ isOneToOne: false;
1092
+ referencedRelation: "shops";
1093
+ referencedColumns: ["id"];
1094
+ },
1095
+ {
1096
+ foreignKeyName: "loyalty_vouchers_user_id_fkey";
1097
+ columns: ["user_id"];
1098
+ isOneToOne: false;
1099
+ referencedRelation: "leaderboard";
1100
+ referencedColumns: ["id"];
1101
+ },
1102
+ {
1103
+ foreignKeyName: "loyalty_vouchers_user_id_fkey";
1104
+ columns: ["user_id"];
1105
+ isOneToOne: false;
1106
+ referencedRelation: "user_activity_summary";
1107
+ referencedColumns: ["id"];
1108
+ },
1109
+ {
1110
+ foreignKeyName: "loyalty_vouchers_user_id_fkey";
1111
+ columns: ["user_id"];
1112
+ isOneToOne: false;
1113
+ referencedRelation: "users";
1114
+ referencedColumns: ["id"];
1115
+ }
1116
+ ];
1117
+ };
1118
+ memberships: {
1119
+ Row: {
1120
+ created_at: string | null;
1121
+ id: string;
1122
+ role: string | null;
1123
+ shop_id: string | null;
1124
+ status: string | null;
1125
+ updated_at: string | null;
1126
+ user_id: string | null;
1127
+ };
1128
+ Insert: {
1129
+ created_at?: string | null;
1130
+ id: string;
1131
+ role?: string | null;
1132
+ shop_id?: string | null;
1133
+ status?: string | null;
1134
+ updated_at?: string | null;
1135
+ user_id?: string | null;
1136
+ };
1137
+ Update: {
1138
+ created_at?: string | null;
1139
+ id?: string;
1140
+ role?: string | null;
1141
+ shop_id?: string | null;
1142
+ status?: string | null;
1143
+ updated_at?: string | null;
1144
+ user_id?: string | null;
1145
+ };
1146
+ Relationships: [
1147
+ {
1148
+ foreignKeyName: "memberships_shop_id_fkey";
1149
+ columns: ["shop_id"];
1150
+ isOneToOne: false;
1151
+ referencedRelation: "shop_stats";
1152
+ referencedColumns: ["id"];
1153
+ },
1154
+ {
1155
+ foreignKeyName: "memberships_shop_id_fkey";
1156
+ columns: ["shop_id"];
1157
+ isOneToOne: false;
1158
+ referencedRelation: "shops";
1159
+ referencedColumns: ["id"];
1160
+ },
1161
+ {
1162
+ foreignKeyName: "memberships_user_id_fkey";
1163
+ columns: ["user_id"];
1164
+ isOneToOne: false;
1165
+ referencedRelation: "leaderboard";
1166
+ referencedColumns: ["id"];
1167
+ },
1168
+ {
1169
+ foreignKeyName: "memberships_user_id_fkey";
1170
+ columns: ["user_id"];
1171
+ isOneToOne: false;
1172
+ referencedRelation: "user_activity_summary";
1173
+ referencedColumns: ["id"];
1174
+ },
1175
+ {
1176
+ foreignKeyName: "memberships_user_id_fkey";
1177
+ columns: ["user_id"];
1178
+ isOneToOne: false;
1179
+ referencedRelation: "users";
1180
+ referencedColumns: ["id"];
1181
+ }
1182
+ ];
1183
+ };
1184
+ news: {
1185
+ Row: {
1186
+ author_id: string | null;
1187
+ category: string | null;
1188
+ content: string;
1189
+ cover_image_url: string | null;
1190
+ created_at: string;
1191
+ featured: boolean | null;
1192
+ id: string;
1193
+ is_published: boolean | null;
1194
+ published_at: string | null;
1195
+ slug: string | null;
1196
+ summary: string | null;
1197
+ tags: string[] | null;
1198
+ title: string;
1199
+ updated_at: string;
1200
+ view_count: number | null;
1201
+ };
1202
+ Insert: {
1203
+ author_id?: string | null;
1204
+ category?: string | null;
1205
+ content: string;
1206
+ cover_image_url?: string | null;
1207
+ created_at?: string;
1208
+ featured?: boolean | null;
1209
+ id?: string;
1210
+ is_published?: boolean | null;
1211
+ published_at?: string | null;
1212
+ slug?: string | null;
1213
+ summary?: string | null;
1214
+ tags?: string[] | null;
1215
+ title: string;
1216
+ updated_at?: string;
1217
+ view_count?: number | null;
1218
+ };
1219
+ Update: {
1220
+ author_id?: string | null;
1221
+ category?: string | null;
1222
+ content?: string;
1223
+ cover_image_url?: string | null;
1224
+ created_at?: string;
1225
+ featured?: boolean | null;
1226
+ id?: string;
1227
+ is_published?: boolean | null;
1228
+ published_at?: string | null;
1229
+ slug?: string | null;
1230
+ summary?: string | null;
1231
+ tags?: string[] | null;
1232
+ title?: string;
1233
+ updated_at?: string;
1234
+ view_count?: number | null;
1235
+ };
1236
+ Relationships: [
1237
+ {
1238
+ foreignKeyName: "news_author_id_fkey";
1239
+ columns: ["author_id"];
1240
+ isOneToOne: false;
1241
+ referencedRelation: "leaderboard";
1242
+ referencedColumns: ["id"];
1243
+ },
1244
+ {
1245
+ foreignKeyName: "news_author_id_fkey";
1246
+ columns: ["author_id"];
1247
+ isOneToOne: false;
1248
+ referencedRelation: "user_activity_summary";
1249
+ referencedColumns: ["id"];
1250
+ },
1251
+ {
1252
+ foreignKeyName: "news_author_id_fkey";
1253
+ columns: ["author_id"];
1254
+ isOneToOne: false;
1255
+ referencedRelation: "users";
1256
+ referencedColumns: ["id"];
1257
+ }
1258
+ ];
1259
+ };
1260
+ notification_templates: {
1261
+ Row: {
1262
+ body_template: string;
1263
+ created_at: string;
1264
+ default_data: Json | null;
1265
+ id: string;
1266
+ is_active: boolean | null;
1267
+ name: string;
1268
+ title_template: string;
1269
+ updated_at: string;
1270
+ };
1271
+ Insert: {
1272
+ body_template: string;
1273
+ created_at?: string;
1274
+ default_data?: Json | null;
1275
+ id: string;
1276
+ is_active?: boolean | null;
1277
+ name: string;
1278
+ title_template: string;
1279
+ updated_at?: string;
1280
+ };
1281
+ Update: {
1282
+ body_template?: string;
1283
+ created_at?: string;
1284
+ default_data?: Json | null;
1285
+ id?: string;
1286
+ is_active?: boolean | null;
1287
+ name?: string;
1288
+ title_template?: string;
1289
+ updated_at?: string;
1290
+ };
1291
+ Relationships: [];
1292
+ };
1293
+ notifications: {
1294
+ Row: {
1295
+ action_url: string | null;
1296
+ body: string | null;
1297
+ created_at: string;
1298
+ data: Json | null;
1299
+ id: string;
1300
+ image_url: string | null;
1301
+ read: boolean | null;
1302
+ read_at: string | null;
1303
+ title: string;
1304
+ type: string;
1305
+ user_id: string;
1306
+ };
1307
+ Insert: {
1308
+ action_url?: string | null;
1309
+ body?: string | null;
1310
+ created_at?: string;
1311
+ data?: Json | null;
1312
+ id?: string;
1313
+ image_url?: string | null;
1314
+ read?: boolean | null;
1315
+ read_at?: string | null;
1316
+ title: string;
1317
+ type: string;
1318
+ user_id: string;
1319
+ };
1320
+ Update: {
1321
+ action_url?: string | null;
1322
+ body?: string | null;
1323
+ created_at?: string;
1324
+ data?: Json | null;
1325
+ id?: string;
1326
+ image_url?: string | null;
1327
+ read?: boolean | null;
1328
+ read_at?: string | null;
1329
+ title?: string;
1330
+ type?: string;
1331
+ user_id?: string;
1332
+ };
1333
+ Relationships: [
1334
+ {
1335
+ foreignKeyName: "notifications_user_id_fkey";
1336
+ columns: ["user_id"];
1337
+ isOneToOne: false;
1338
+ referencedRelation: "leaderboard";
1339
+ referencedColumns: ["id"];
1340
+ },
1341
+ {
1342
+ foreignKeyName: "notifications_user_id_fkey";
1343
+ columns: ["user_id"];
1344
+ isOneToOne: false;
1345
+ referencedRelation: "user_activity_summary";
1346
+ referencedColumns: ["id"];
1347
+ },
1348
+ {
1349
+ foreignKeyName: "notifications_user_id_fkey";
1350
+ columns: ["user_id"];
1351
+ isOneToOne: false;
1352
+ referencedRelation: "users";
1353
+ referencedColumns: ["id"];
1354
+ }
1355
+ ];
1356
+ };
1357
+ points: {
1358
+ Row: {
1359
+ action: string;
1360
+ created_at: string | null;
1361
+ id: string;
1362
+ metadata: Json | null;
1363
+ points: number;
1364
+ user_id: string | null;
1365
+ };
1366
+ Insert: {
1367
+ action: string;
1368
+ created_at?: string | null;
1369
+ id: string;
1370
+ metadata?: Json | null;
1371
+ points: number;
1372
+ user_id?: string | null;
1373
+ };
1374
+ Update: {
1375
+ action?: string;
1376
+ created_at?: string | null;
1377
+ id?: string;
1378
+ metadata?: Json | null;
1379
+ points?: number;
1380
+ user_id?: string | null;
1381
+ };
1382
+ Relationships: [
1383
+ {
1384
+ foreignKeyName: "points_user_id_fkey";
1385
+ columns: ["user_id"];
1386
+ isOneToOne: false;
1387
+ referencedRelation: "leaderboard";
1388
+ referencedColumns: ["id"];
1389
+ },
1390
+ {
1391
+ foreignKeyName: "points_user_id_fkey";
1392
+ columns: ["user_id"];
1393
+ isOneToOne: false;
1394
+ referencedRelation: "user_activity_summary";
1395
+ referencedColumns: ["id"];
1396
+ },
1397
+ {
1398
+ foreignKeyName: "points_user_id_fkey";
1399
+ columns: ["user_id"];
1400
+ isOneToOne: false;
1401
+ referencedRelation: "users";
1402
+ referencedColumns: ["id"];
1403
+ }
1404
+ ];
1405
+ };
1406
+ quest_participants: {
1407
+ Row: {
1408
+ completed: boolean | null;
1409
+ completed_at: string | null;
1410
+ joined_at: string | null;
1411
+ progress: Json | null;
1412
+ quest_id: string;
1413
+ user_id: string;
1414
+ };
1415
+ Insert: {
1416
+ completed?: boolean | null;
1417
+ completed_at?: string | null;
1418
+ joined_at?: string | null;
1419
+ progress?: Json | null;
1420
+ quest_id: string;
1421
+ user_id: string;
1422
+ };
1423
+ Update: {
1424
+ completed?: boolean | null;
1425
+ completed_at?: string | null;
1426
+ joined_at?: string | null;
1427
+ progress?: Json | null;
1428
+ quest_id?: string;
1429
+ user_id?: string;
1430
+ };
1431
+ Relationships: [
1432
+ {
1433
+ foreignKeyName: "quest_participants_quest_id_fkey";
1434
+ columns: ["quest_id"];
1435
+ isOneToOne: false;
1436
+ referencedRelation: "quests";
1437
+ referencedColumns: ["id"];
1438
+ },
1439
+ {
1440
+ foreignKeyName: "quest_participants_user_id_fkey";
1441
+ columns: ["user_id"];
1442
+ isOneToOne: false;
1443
+ referencedRelation: "leaderboard";
1444
+ referencedColumns: ["id"];
1445
+ },
1446
+ {
1447
+ foreignKeyName: "quest_participants_user_id_fkey";
1448
+ columns: ["user_id"];
1449
+ isOneToOne: false;
1450
+ referencedRelation: "user_activity_summary";
1451
+ referencedColumns: ["id"];
1452
+ },
1453
+ {
1454
+ foreignKeyName: "quest_participants_user_id_fkey";
1455
+ columns: ["user_id"];
1456
+ isOneToOne: false;
1457
+ referencedRelation: "users";
1458
+ referencedColumns: ["id"];
1459
+ }
1460
+ ];
1461
+ };
1462
+ quests: {
1463
+ Row: {
1464
+ city: string | null;
1465
+ completion_bonus_points: number | null;
1466
+ country_code: string | null;
1467
+ cover_image: string | null;
1468
+ created_at: string | null;
1469
+ created_by: string | null;
1470
+ description: string | null;
1471
+ difficulty: string | null;
1472
+ end_date: string | null;
1473
+ estimated_duration: number | null;
1474
+ geographic_scope: string | null;
1475
+ id: string;
1476
+ requirements: Json | null;
1477
+ rewards: Json | null;
1478
+ shop_actions: Json | null;
1479
+ start_date: string | null;
1480
+ status: string | null;
1481
+ tags: string[] | null;
1482
+ title: string | null;
1483
+ total_completions: number | null;
1484
+ total_participants: number | null;
1485
+ type: string | null;
1486
+ updated_at: string | null;
1487
+ };
1488
+ Insert: {
1489
+ city?: string | null;
1490
+ completion_bonus_points?: number | null;
1491
+ country_code?: string | null;
1492
+ cover_image?: string | null;
1493
+ created_at?: string | null;
1494
+ created_by?: string | null;
1495
+ description?: string | null;
1496
+ difficulty?: string | null;
1497
+ end_date?: string | null;
1498
+ estimated_duration?: number | null;
1499
+ geographic_scope?: string | null;
1500
+ id: string;
1501
+ requirements?: Json | null;
1502
+ rewards?: Json | null;
1503
+ shop_actions?: Json | null;
1504
+ start_date?: string | null;
1505
+ status?: string | null;
1506
+ tags?: string[] | null;
1507
+ title?: string | null;
1508
+ total_completions?: number | null;
1509
+ total_participants?: number | null;
1510
+ type?: string | null;
1511
+ updated_at?: string | null;
1512
+ };
1513
+ Update: {
1514
+ city?: string | null;
1515
+ completion_bonus_points?: number | null;
1516
+ country_code?: string | null;
1517
+ cover_image?: string | null;
1518
+ created_at?: string | null;
1519
+ created_by?: string | null;
1520
+ description?: string | null;
1521
+ difficulty?: string | null;
1522
+ end_date?: string | null;
1523
+ estimated_duration?: number | null;
1524
+ geographic_scope?: string | null;
1525
+ id?: string;
1526
+ requirements?: Json | null;
1527
+ rewards?: Json | null;
1528
+ shop_actions?: Json | null;
1529
+ start_date?: string | null;
1530
+ status?: string | null;
1531
+ tags?: string[] | null;
1532
+ title?: string | null;
1533
+ total_completions?: number | null;
1534
+ total_participants?: number | null;
1535
+ type?: string | null;
1536
+ updated_at?: string | null;
1537
+ };
1538
+ Relationships: [];
1539
+ };
1540
+ quiz_results: {
1541
+ Row: {
1542
+ answers: Json;
1543
+ completed_at: string;
1544
+ created_at: string;
1545
+ id: string;
1546
+ quiz_type: string;
1547
+ result: Json;
1548
+ score: number | null;
1549
+ user_id: string;
1550
+ };
1551
+ Insert: {
1552
+ answers: Json;
1553
+ completed_at?: string;
1554
+ created_at?: string;
1555
+ id?: string;
1556
+ quiz_type: string;
1557
+ result: Json;
1558
+ score?: number | null;
1559
+ user_id: string;
1560
+ };
1561
+ Update: {
1562
+ answers?: Json;
1563
+ completed_at?: string;
1564
+ created_at?: string;
1565
+ id?: string;
1566
+ quiz_type?: string;
1567
+ result?: Json;
1568
+ score?: number | null;
1569
+ user_id?: string;
1570
+ };
1571
+ Relationships: [
1572
+ {
1573
+ foreignKeyName: "quiz_results_user_id_fkey";
1574
+ columns: ["user_id"];
1575
+ isOneToOne: false;
1576
+ referencedRelation: "leaderboard";
1577
+ referencedColumns: ["id"];
1578
+ },
1579
+ {
1580
+ foreignKeyName: "quiz_results_user_id_fkey";
1581
+ columns: ["user_id"];
1582
+ isOneToOne: false;
1583
+ referencedRelation: "user_activity_summary";
1584
+ referencedColumns: ["id"];
1585
+ },
1586
+ {
1587
+ foreignKeyName: "quiz_results_user_id_fkey";
1588
+ columns: ["user_id"];
1589
+ isOneToOne: false;
1590
+ referencedRelation: "users";
1591
+ referencedColumns: ["id"];
1592
+ }
1593
+ ];
1594
+ };
1595
+ report_actions: {
1596
+ Row: {
1597
+ action_by: string;
1598
+ action_type: string;
1599
+ case_id: string | null;
1600
+ created_at: string;
1601
+ id: string;
1602
+ notes: string | null;
1603
+ report_id: string | null;
1604
+ };
1605
+ Insert: {
1606
+ action_by: string;
1607
+ action_type: string;
1608
+ case_id?: string | null;
1609
+ created_at?: string;
1610
+ id?: string;
1611
+ notes?: string | null;
1612
+ report_id?: string | null;
1613
+ };
1614
+ Update: {
1615
+ action_by?: string;
1616
+ action_type?: string;
1617
+ case_id?: string | null;
1618
+ created_at?: string;
1619
+ id?: string;
1620
+ notes?: string | null;
1621
+ report_id?: string | null;
1622
+ };
1623
+ Relationships: [
1624
+ {
1625
+ foreignKeyName: "report_actions_action_by_fkey";
1626
+ columns: ["action_by"];
1627
+ isOneToOne: false;
1628
+ referencedRelation: "leaderboard";
1629
+ referencedColumns: ["id"];
1630
+ },
1631
+ {
1632
+ foreignKeyName: "report_actions_action_by_fkey";
1633
+ columns: ["action_by"];
1634
+ isOneToOne: false;
1635
+ referencedRelation: "user_activity_summary";
1636
+ referencedColumns: ["id"];
1637
+ },
1638
+ {
1639
+ foreignKeyName: "report_actions_action_by_fkey";
1640
+ columns: ["action_by"];
1641
+ isOneToOne: false;
1642
+ referencedRelation: "users";
1643
+ referencedColumns: ["id"];
1644
+ },
1645
+ {
1646
+ foreignKeyName: "report_actions_case_id_fkey";
1647
+ columns: ["case_id"];
1648
+ isOneToOne: false;
1649
+ referencedRelation: "report_cases";
1650
+ referencedColumns: ["id"];
1651
+ },
1652
+ {
1653
+ foreignKeyName: "report_actions_report_id_fkey";
1654
+ columns: ["report_id"];
1655
+ isOneToOne: false;
1656
+ referencedRelation: "reports";
1657
+ referencedColumns: ["id"];
1658
+ }
1659
+ ];
1660
+ };
1661
+ report_cases: {
1662
+ Row: {
1663
+ assigned_to: string | null;
1664
+ created_at: string;
1665
+ description: string | null;
1666
+ entity_id: string;
1667
+ entity_type: string;
1668
+ id: string;
1669
+ priority: string | null;
1670
+ resolution: string | null;
1671
+ resolved_at: string | null;
1672
+ resolved_by: string | null;
1673
+ status: string;
1674
+ title: string;
1675
+ updated_at: string;
1676
+ };
1677
+ Insert: {
1678
+ assigned_to?: string | null;
1679
+ created_at?: string;
1680
+ description?: string | null;
1681
+ entity_id: string;
1682
+ entity_type: string;
1683
+ id?: string;
1684
+ priority?: string | null;
1685
+ resolution?: string | null;
1686
+ resolved_at?: string | null;
1687
+ resolved_by?: string | null;
1688
+ status?: string;
1689
+ title: string;
1690
+ updated_at?: string;
1691
+ };
1692
+ Update: {
1693
+ assigned_to?: string | null;
1694
+ created_at?: string;
1695
+ description?: string | null;
1696
+ entity_id?: string;
1697
+ entity_type?: string;
1698
+ id?: string;
1699
+ priority?: string | null;
1700
+ resolution?: string | null;
1701
+ resolved_at?: string | null;
1702
+ resolved_by?: string | null;
1703
+ status?: string;
1704
+ title?: string;
1705
+ updated_at?: string;
1706
+ };
1707
+ Relationships: [
1708
+ {
1709
+ foreignKeyName: "report_cases_assigned_to_fkey";
1710
+ columns: ["assigned_to"];
1711
+ isOneToOne: false;
1712
+ referencedRelation: "leaderboard";
1713
+ referencedColumns: ["id"];
1714
+ },
1715
+ {
1716
+ foreignKeyName: "report_cases_assigned_to_fkey";
1717
+ columns: ["assigned_to"];
1718
+ isOneToOne: false;
1719
+ referencedRelation: "user_activity_summary";
1720
+ referencedColumns: ["id"];
1721
+ },
1722
+ {
1723
+ foreignKeyName: "report_cases_assigned_to_fkey";
1724
+ columns: ["assigned_to"];
1725
+ isOneToOne: false;
1726
+ referencedRelation: "users";
1727
+ referencedColumns: ["id"];
1728
+ },
1729
+ {
1730
+ foreignKeyName: "report_cases_resolved_by_fkey";
1731
+ columns: ["resolved_by"];
1732
+ isOneToOne: false;
1733
+ referencedRelation: "leaderboard";
1734
+ referencedColumns: ["id"];
1735
+ },
1736
+ {
1737
+ foreignKeyName: "report_cases_resolved_by_fkey";
1738
+ columns: ["resolved_by"];
1739
+ isOneToOne: false;
1740
+ referencedRelation: "user_activity_summary";
1741
+ referencedColumns: ["id"];
1742
+ },
1743
+ {
1744
+ foreignKeyName: "report_cases_resolved_by_fkey";
1745
+ columns: ["resolved_by"];
1746
+ isOneToOne: false;
1747
+ referencedRelation: "users";
1748
+ referencedColumns: ["id"];
1749
+ }
1750
+ ];
1751
+ };
1752
+ reports: {
1753
+ Row: {
1754
+ assigned_to: string | null;
1755
+ case_id: string | null;
1756
+ created_at: string;
1757
+ description: string | null;
1758
+ entity_id: string;
1759
+ entity_type: string;
1760
+ evidence_urls: string[] | null;
1761
+ id: string;
1762
+ priority: string | null;
1763
+ reason: string;
1764
+ reporter_id: string;
1765
+ status: string;
1766
+ updated_at: string;
1767
+ };
1768
+ Insert: {
1769
+ assigned_to?: string | null;
1770
+ case_id?: string | null;
1771
+ created_at?: string;
1772
+ description?: string | null;
1773
+ entity_id: string;
1774
+ entity_type: string;
1775
+ evidence_urls?: string[] | null;
1776
+ id?: string;
1777
+ priority?: string | null;
1778
+ reason: string;
1779
+ reporter_id: string;
1780
+ status?: string;
1781
+ updated_at?: string;
1782
+ };
1783
+ Update: {
1784
+ assigned_to?: string | null;
1785
+ case_id?: string | null;
1786
+ created_at?: string;
1787
+ description?: string | null;
1788
+ entity_id?: string;
1789
+ entity_type?: string;
1790
+ evidence_urls?: string[] | null;
1791
+ id?: string;
1792
+ priority?: string | null;
1793
+ reason?: string;
1794
+ reporter_id?: string;
1795
+ status?: string;
1796
+ updated_at?: string;
1797
+ };
1798
+ Relationships: [
1799
+ {
1800
+ foreignKeyName: "reports_assigned_to_fkey";
1801
+ columns: ["assigned_to"];
1802
+ isOneToOne: false;
1803
+ referencedRelation: "leaderboard";
1804
+ referencedColumns: ["id"];
1805
+ },
1806
+ {
1807
+ foreignKeyName: "reports_assigned_to_fkey";
1808
+ columns: ["assigned_to"];
1809
+ isOneToOne: false;
1810
+ referencedRelation: "user_activity_summary";
1811
+ referencedColumns: ["id"];
1812
+ },
1813
+ {
1814
+ foreignKeyName: "reports_assigned_to_fkey";
1815
+ columns: ["assigned_to"];
1816
+ isOneToOne: false;
1817
+ referencedRelation: "users";
1818
+ referencedColumns: ["id"];
1819
+ },
1820
+ {
1821
+ foreignKeyName: "reports_case_id_fkey";
1822
+ columns: ["case_id"];
1823
+ isOneToOne: false;
1824
+ referencedRelation: "report_cases";
1825
+ referencedColumns: ["id"];
1826
+ },
1827
+ {
1828
+ foreignKeyName: "reports_reporter_id_fkey";
1829
+ columns: ["reporter_id"];
1830
+ isOneToOne: false;
1831
+ referencedRelation: "leaderboard";
1832
+ referencedColumns: ["id"];
1833
+ },
1834
+ {
1835
+ foreignKeyName: "reports_reporter_id_fkey";
1836
+ columns: ["reporter_id"];
1837
+ isOneToOne: false;
1838
+ referencedRelation: "user_activity_summary";
1839
+ referencedColumns: ["id"];
1840
+ },
1841
+ {
1842
+ foreignKeyName: "reports_reporter_id_fkey";
1843
+ columns: ["reporter_id"];
1844
+ isOneToOne: false;
1845
+ referencedRelation: "users";
1846
+ referencedColumns: ["id"];
1847
+ }
1848
+ ];
1849
+ };
1850
+ reviews: {
1851
+ Row: {
1852
+ brew_sightings: string[] | null;
1853
+ craft_perception: number | null;
1854
+ craft_rating: number | null;
1855
+ created_at: string | null;
1856
+ evidence: Json | null;
1857
+ id: string;
1858
+ image_url: string | null;
1859
+ ratings: Json | null;
1860
+ reported: boolean | null;
1861
+ reported_by: string | null;
1862
+ review_text: string | null;
1863
+ roaster_sightings: string[] | null;
1864
+ shop_id: string | null;
1865
+ user_id: string | null;
1866
+ };
1867
+ Insert: {
1868
+ brew_sightings?: string[] | null;
1869
+ craft_perception?: number | null;
1870
+ craft_rating?: number | null;
1871
+ created_at?: string | null;
1872
+ evidence?: Json | null;
1873
+ id: string;
1874
+ image_url?: string | null;
1875
+ ratings?: Json | null;
1876
+ reported?: boolean | null;
1877
+ reported_by?: string | null;
1878
+ review_text?: string | null;
1879
+ roaster_sightings?: string[] | null;
1880
+ shop_id?: string | null;
1881
+ user_id?: string | null;
1882
+ };
1883
+ Update: {
1884
+ brew_sightings?: string[] | null;
1885
+ craft_perception?: number | null;
1886
+ craft_rating?: number | null;
1887
+ created_at?: string | null;
1888
+ evidence?: Json | null;
1889
+ id?: string;
1890
+ image_url?: string | null;
1891
+ ratings?: Json | null;
1892
+ reported?: boolean | null;
1893
+ reported_by?: string | null;
1894
+ review_text?: string | null;
1895
+ roaster_sightings?: string[] | null;
1896
+ shop_id?: string | null;
1897
+ user_id?: string | null;
1898
+ };
1899
+ Relationships: [
1900
+ {
1901
+ foreignKeyName: "reviews_shop_id_fkey";
1902
+ columns: ["shop_id"];
1903
+ isOneToOne: false;
1904
+ referencedRelation: "shop_stats";
1905
+ referencedColumns: ["id"];
1906
+ },
1907
+ {
1908
+ foreignKeyName: "reviews_shop_id_fkey";
1909
+ columns: ["shop_id"];
1910
+ isOneToOne: false;
1911
+ referencedRelation: "shops";
1912
+ referencedColumns: ["id"];
1913
+ },
1914
+ {
1915
+ foreignKeyName: "reviews_user_id_fkey";
1916
+ columns: ["user_id"];
1917
+ isOneToOne: false;
1918
+ referencedRelation: "leaderboard";
1919
+ referencedColumns: ["id"];
1920
+ },
1921
+ {
1922
+ foreignKeyName: "reviews_user_id_fkey";
1923
+ columns: ["user_id"];
1924
+ isOneToOne: false;
1925
+ referencedRelation: "user_activity_summary";
1926
+ referencedColumns: ["id"];
1927
+ },
1928
+ {
1929
+ foreignKeyName: "reviews_user_id_fkey";
1930
+ columns: ["user_id"];
1931
+ isOneToOne: false;
1932
+ referencedRelation: "users";
1933
+ referencedColumns: ["id"];
1934
+ }
1935
+ ];
1936
+ };
1937
+ rewards: {
1938
+ Row: {
1939
+ created_at: string | null;
1940
+ id: string;
1941
+ metadata: Json | null;
1942
+ reward_action: string;
1943
+ reward_category: string | null;
1944
+ user_id: string | null;
1945
+ };
1946
+ Insert: {
1947
+ created_at?: string | null;
1948
+ id: string;
1949
+ metadata?: Json | null;
1950
+ reward_action: string;
1951
+ reward_category?: string | null;
1952
+ user_id?: string | null;
1953
+ };
1954
+ Update: {
1955
+ created_at?: string | null;
1956
+ id?: string;
1957
+ metadata?: Json | null;
1958
+ reward_action?: string;
1959
+ reward_category?: string | null;
1960
+ user_id?: string | null;
1961
+ };
1962
+ Relationships: [
1963
+ {
1964
+ foreignKeyName: "rewards_user_id_fkey";
1965
+ columns: ["user_id"];
1966
+ isOneToOne: false;
1967
+ referencedRelation: "leaderboard";
1968
+ referencedColumns: ["id"];
1969
+ },
1970
+ {
1971
+ foreignKeyName: "rewards_user_id_fkey";
1972
+ columns: ["user_id"];
1973
+ isOneToOne: false;
1974
+ referencedRelation: "user_activity_summary";
1975
+ referencedColumns: ["id"];
1976
+ },
1977
+ {
1978
+ foreignKeyName: "rewards_user_id_fkey";
1979
+ columns: ["user_id"];
1980
+ isOneToOne: false;
1981
+ referencedRelation: "users";
1982
+ referencedColumns: ["id"];
1983
+ }
1984
+ ];
1985
+ };
1986
+ roaster_farms: {
1987
+ Row: {
1988
+ farm_id: string;
1989
+ roaster_id: string;
1990
+ };
1991
+ Insert: {
1992
+ farm_id: string;
1993
+ roaster_id: string;
1994
+ };
1995
+ Update: {
1996
+ farm_id?: string;
1997
+ roaster_id?: string;
1998
+ };
1999
+ Relationships: [
2000
+ {
2001
+ foreignKeyName: "roaster_farms_farm_id_fkey";
2002
+ columns: ["farm_id"];
2003
+ isOneToOne: false;
2004
+ referencedRelation: "farms";
2005
+ referencedColumns: ["id"];
2006
+ },
2007
+ {
2008
+ foreignKeyName: "roaster_farms_roaster_id_fkey";
2009
+ columns: ["roaster_id"];
2010
+ isOneToOne: false;
2011
+ referencedRelation: "roasters";
2012
+ referencedColumns: ["id"];
2013
+ }
2014
+ ];
2015
+ };
2016
+ roaster_submissions: {
2017
+ Row: {
2018
+ approved_roaster_id: string | null;
2019
+ created_at: string;
2020
+ description: string | null;
2021
+ id: string;
2022
+ image_url: string | null;
2023
+ instagram: string | null;
2024
+ location: Json | null;
2025
+ name: string;
2026
+ review_notes: string | null;
2027
+ reviewed_at: string | null;
2028
+ reviewed_by: string | null;
2029
+ status: string;
2030
+ updated_at: string;
2031
+ user_id: string;
2032
+ website: string | null;
2033
+ };
2034
+ Insert: {
2035
+ approved_roaster_id?: string | null;
2036
+ created_at?: string;
2037
+ description?: string | null;
2038
+ id?: string;
2039
+ image_url?: string | null;
2040
+ instagram?: string | null;
2041
+ location?: Json | null;
2042
+ name: string;
2043
+ review_notes?: string | null;
2044
+ reviewed_at?: string | null;
2045
+ reviewed_by?: string | null;
2046
+ status?: string;
2047
+ updated_at?: string;
2048
+ user_id: string;
2049
+ website?: string | null;
2050
+ };
2051
+ Update: {
2052
+ approved_roaster_id?: string | null;
2053
+ created_at?: string;
2054
+ description?: string | null;
2055
+ id?: string;
2056
+ image_url?: string | null;
2057
+ instagram?: string | null;
2058
+ location?: Json | null;
2059
+ name?: string;
2060
+ review_notes?: string | null;
2061
+ reviewed_at?: string | null;
2062
+ reviewed_by?: string | null;
2063
+ status?: string;
2064
+ updated_at?: string;
2065
+ user_id?: string;
2066
+ website?: string | null;
2067
+ };
2068
+ Relationships: [
2069
+ {
2070
+ foreignKeyName: "roaster_submissions_approved_roaster_id_fkey";
2071
+ columns: ["approved_roaster_id"];
2072
+ isOneToOne: false;
2073
+ referencedRelation: "roasters";
2074
+ referencedColumns: ["id"];
2075
+ },
2076
+ {
2077
+ foreignKeyName: "roaster_submissions_reviewed_by_fkey";
2078
+ columns: ["reviewed_by"];
2079
+ isOneToOne: false;
2080
+ referencedRelation: "leaderboard";
2081
+ referencedColumns: ["id"];
2082
+ },
2083
+ {
2084
+ foreignKeyName: "roaster_submissions_reviewed_by_fkey";
2085
+ columns: ["reviewed_by"];
2086
+ isOneToOne: false;
2087
+ referencedRelation: "user_activity_summary";
2088
+ referencedColumns: ["id"];
2089
+ },
2090
+ {
2091
+ foreignKeyName: "roaster_submissions_reviewed_by_fkey";
2092
+ columns: ["reviewed_by"];
2093
+ isOneToOne: false;
2094
+ referencedRelation: "users";
2095
+ referencedColumns: ["id"];
2096
+ },
2097
+ {
2098
+ foreignKeyName: "roaster_submissions_user_id_fkey";
2099
+ columns: ["user_id"];
2100
+ isOneToOne: false;
2101
+ referencedRelation: "leaderboard";
2102
+ referencedColumns: ["id"];
2103
+ },
2104
+ {
2105
+ foreignKeyName: "roaster_submissions_user_id_fkey";
2106
+ columns: ["user_id"];
2107
+ isOneToOne: false;
2108
+ referencedRelation: "user_activity_summary";
2109
+ referencedColumns: ["id"];
2110
+ },
2111
+ {
2112
+ foreignKeyName: "roaster_submissions_user_id_fkey";
2113
+ columns: ["user_id"];
2114
+ isOneToOne: false;
2115
+ referencedRelation: "users";
2116
+ referencedColumns: ["id"];
2117
+ }
2118
+ ];
2119
+ };
2120
+ roasters: {
2121
+ Row: {
2122
+ about: string | null;
2123
+ active: boolean | null;
2124
+ city: string | null;
2125
+ contact_details: Json | null;
2126
+ country: string | null;
2127
+ country_code: string | null;
2128
+ created_at: string | null;
2129
+ geo_point: Json | null;
2130
+ id: string;
2131
+ logo_image: string | null;
2132
+ name: string;
2133
+ sourcing: Json | null;
2134
+ specialty: Json | null;
2135
+ status: string | null;
2136
+ updated_at: string | null;
2137
+ user_id: string | null;
2138
+ };
2139
+ Insert: {
2140
+ about?: string | null;
2141
+ active?: boolean | null;
2142
+ city?: string | null;
2143
+ contact_details?: Json | null;
2144
+ country?: string | null;
2145
+ country_code?: string | null;
2146
+ created_at?: string | null;
2147
+ geo_point?: Json | null;
2148
+ id: string;
2149
+ logo_image?: string | null;
2150
+ name: string;
2151
+ sourcing?: Json | null;
2152
+ specialty?: Json | null;
2153
+ status?: string | null;
2154
+ updated_at?: string | null;
2155
+ user_id?: string | null;
2156
+ };
2157
+ Update: {
2158
+ about?: string | null;
2159
+ active?: boolean | null;
2160
+ city?: string | null;
2161
+ contact_details?: Json | null;
2162
+ country?: string | null;
2163
+ country_code?: string | null;
2164
+ created_at?: string | null;
2165
+ geo_point?: Json | null;
2166
+ id?: string;
2167
+ logo_image?: string | null;
2168
+ name?: string;
2169
+ sourcing?: Json | null;
2170
+ specialty?: Json | null;
2171
+ status?: string | null;
2172
+ updated_at?: string | null;
2173
+ user_id?: string | null;
2174
+ };
2175
+ Relationships: [];
2176
+ };
2177
+ shop_beans: {
2178
+ Row: {
2179
+ bean_id: string;
2180
+ shop_id: string;
2181
+ };
2182
+ Insert: {
2183
+ bean_id: string;
2184
+ shop_id: string;
2185
+ };
2186
+ Update: {
2187
+ bean_id?: string;
2188
+ shop_id?: string;
2189
+ };
2190
+ Relationships: [
2191
+ {
2192
+ foreignKeyName: "shop_beans_bean_id_fkey";
2193
+ columns: ["bean_id"];
2194
+ isOneToOne: false;
2195
+ referencedRelation: "coffee_beans";
2196
+ referencedColumns: ["id"];
2197
+ },
2198
+ {
2199
+ foreignKeyName: "shop_beans_shop_id_fkey";
2200
+ columns: ["shop_id"];
2201
+ isOneToOne: false;
2202
+ referencedRelation: "shop_stats";
2203
+ referencedColumns: ["id"];
2204
+ },
2205
+ {
2206
+ foreignKeyName: "shop_beans_shop_id_fkey";
2207
+ columns: ["shop_id"];
2208
+ isOneToOne: false;
2209
+ referencedRelation: "shops";
2210
+ referencedColumns: ["id"];
2211
+ }
2212
+ ];
2213
+ };
2214
+ shop_favourites: {
2215
+ Row: {
2216
+ created_at: string | null;
2217
+ shop_id: string;
2218
+ user_id: string;
2219
+ };
2220
+ Insert: {
2221
+ created_at?: string | null;
2222
+ shop_id: string;
2223
+ user_id: string;
2224
+ };
2225
+ Update: {
2226
+ created_at?: string | null;
2227
+ shop_id?: string;
2228
+ user_id?: string;
2229
+ };
2230
+ Relationships: [
2231
+ {
2232
+ foreignKeyName: "shop_favourites_shop_id_fkey";
2233
+ columns: ["shop_id"];
2234
+ isOneToOne: false;
2235
+ referencedRelation: "shop_stats";
2236
+ referencedColumns: ["id"];
2237
+ },
2238
+ {
2239
+ foreignKeyName: "shop_favourites_shop_id_fkey";
2240
+ columns: ["shop_id"];
2241
+ isOneToOne: false;
2242
+ referencedRelation: "shops";
2243
+ referencedColumns: ["id"];
2244
+ },
2245
+ {
2246
+ foreignKeyName: "shop_favourites_user_id_fkey";
2247
+ columns: ["user_id"];
2248
+ isOneToOne: false;
2249
+ referencedRelation: "leaderboard";
2250
+ referencedColumns: ["id"];
2251
+ },
2252
+ {
2253
+ foreignKeyName: "shop_favourites_user_id_fkey";
2254
+ columns: ["user_id"];
2255
+ isOneToOne: false;
2256
+ referencedRelation: "user_activity_summary";
2257
+ referencedColumns: ["id"];
2258
+ },
2259
+ {
2260
+ foreignKeyName: "shop_favourites_user_id_fkey";
2261
+ columns: ["user_id"];
2262
+ isOneToOne: false;
2263
+ referencedRelation: "users";
2264
+ referencedColumns: ["id"];
2265
+ }
2266
+ ];
2267
+ };
2268
+ shop_followers: {
2269
+ Row: {
2270
+ created_at: string | null;
2271
+ shop_id: string;
2272
+ user_id: string;
2273
+ };
2274
+ Insert: {
2275
+ created_at?: string | null;
2276
+ shop_id: string;
2277
+ user_id: string;
2278
+ };
2279
+ Update: {
2280
+ created_at?: string | null;
2281
+ shop_id?: string;
2282
+ user_id?: string;
2283
+ };
2284
+ Relationships: [
2285
+ {
2286
+ foreignKeyName: "shop_followers_shop_id_fkey";
2287
+ columns: ["shop_id"];
2288
+ isOneToOne: false;
2289
+ referencedRelation: "shop_stats";
2290
+ referencedColumns: ["id"];
2291
+ },
2292
+ {
2293
+ foreignKeyName: "shop_followers_shop_id_fkey";
2294
+ columns: ["shop_id"];
2295
+ isOneToOne: false;
2296
+ referencedRelation: "shops";
2297
+ referencedColumns: ["id"];
2298
+ },
2299
+ {
2300
+ foreignKeyName: "shop_followers_user_id_fkey";
2301
+ columns: ["user_id"];
2302
+ isOneToOne: false;
2303
+ referencedRelation: "leaderboard";
2304
+ referencedColumns: ["id"];
2305
+ },
2306
+ {
2307
+ foreignKeyName: "shop_followers_user_id_fkey";
2308
+ columns: ["user_id"];
2309
+ isOneToOne: false;
2310
+ referencedRelation: "user_activity_summary";
2311
+ referencedColumns: ["id"];
2312
+ },
2313
+ {
2314
+ foreignKeyName: "shop_followers_user_id_fkey";
2315
+ columns: ["user_id"];
2316
+ isOneToOne: false;
2317
+ referencedRelation: "users";
2318
+ referencedColumns: ["id"];
2319
+ }
2320
+ ];
2321
+ };
2322
+ shop_list_members: {
2323
+ Row: {
2324
+ id: string;
2325
+ invited_by: string | null;
2326
+ joined_at: string;
2327
+ list_id: string;
2328
+ role: string;
2329
+ user_id: string;
2330
+ };
2331
+ Insert: {
2332
+ id?: string;
2333
+ invited_by?: string | null;
2334
+ joined_at?: string;
2335
+ list_id: string;
2336
+ role?: string;
2337
+ user_id: string;
2338
+ };
2339
+ Update: {
2340
+ id?: string;
2341
+ invited_by?: string | null;
2342
+ joined_at?: string;
2343
+ list_id?: string;
2344
+ role?: string;
2345
+ user_id?: string;
2346
+ };
2347
+ Relationships: [
2348
+ {
2349
+ foreignKeyName: "shop_list_members_invited_by_fkey";
2350
+ columns: ["invited_by"];
2351
+ isOneToOne: false;
2352
+ referencedRelation: "leaderboard";
2353
+ referencedColumns: ["id"];
2354
+ },
2355
+ {
2356
+ foreignKeyName: "shop_list_members_invited_by_fkey";
2357
+ columns: ["invited_by"];
2358
+ isOneToOne: false;
2359
+ referencedRelation: "user_activity_summary";
2360
+ referencedColumns: ["id"];
2361
+ },
2362
+ {
2363
+ foreignKeyName: "shop_list_members_invited_by_fkey";
2364
+ columns: ["invited_by"];
2365
+ isOneToOne: false;
2366
+ referencedRelation: "users";
2367
+ referencedColumns: ["id"];
2368
+ },
2369
+ {
2370
+ foreignKeyName: "shop_list_members_list_id_fkey";
2371
+ columns: ["list_id"];
2372
+ isOneToOne: false;
2373
+ referencedRelation: "user_lists";
2374
+ referencedColumns: ["id"];
2375
+ },
2376
+ {
2377
+ foreignKeyName: "shop_list_members_user_id_fkey";
2378
+ columns: ["user_id"];
2379
+ isOneToOne: false;
2380
+ referencedRelation: "leaderboard";
2381
+ referencedColumns: ["id"];
2382
+ },
2383
+ {
2384
+ foreignKeyName: "shop_list_members_user_id_fkey";
2385
+ columns: ["user_id"];
2386
+ isOneToOne: false;
2387
+ referencedRelation: "user_activity_summary";
2388
+ referencedColumns: ["id"];
2389
+ },
2390
+ {
2391
+ foreignKeyName: "shop_list_members_user_id_fkey";
2392
+ columns: ["user_id"];
2393
+ isOneToOne: false;
2394
+ referencedRelation: "users";
2395
+ referencedColumns: ["id"];
2396
+ }
2397
+ ];
2398
+ };
2399
+ shop_roasters: {
2400
+ Row: {
2401
+ is_house_roaster: boolean | null;
2402
+ roaster_id: string;
2403
+ shop_id: string;
2404
+ };
2405
+ Insert: {
2406
+ is_house_roaster?: boolean | null;
2407
+ roaster_id: string;
2408
+ shop_id: string;
2409
+ };
2410
+ Update: {
2411
+ is_house_roaster?: boolean | null;
2412
+ roaster_id?: string;
2413
+ shop_id?: string;
2414
+ };
2415
+ Relationships: [
2416
+ {
2417
+ foreignKeyName: "shop_roasters_roaster_id_fkey";
2418
+ columns: ["roaster_id"];
2419
+ isOneToOne: false;
2420
+ referencedRelation: "roasters";
2421
+ referencedColumns: ["id"];
2422
+ },
2423
+ {
2424
+ foreignKeyName: "shop_roasters_shop_id_fkey";
2425
+ columns: ["shop_id"];
2426
+ isOneToOne: false;
2427
+ referencedRelation: "shop_stats";
2428
+ referencedColumns: ["id"];
2429
+ },
2430
+ {
2431
+ foreignKeyName: "shop_roasters_shop_id_fkey";
2432
+ columns: ["shop_id"];
2433
+ isOneToOne: false;
2434
+ referencedRelation: "shops";
2435
+ referencedColumns: ["id"];
2436
+ }
2437
+ ];
2438
+ };
2439
+ shops: {
2440
+ Row: {
2441
+ active: boolean | null;
2442
+ added_at: string | null;
2443
+ added_by_user: string | null;
2444
+ analytics: Json | null;
2445
+ awards: Json | null;
2446
+ brew_methods: string[] | null;
2447
+ city: string | null;
2448
+ coffee_brewing_methods: Json | null;
2449
+ contact_details: Json | null;
2450
+ country_code: string | null;
2451
+ cover_image: string | null;
2452
+ created_at: string | null;
2453
+ custom_roasters: string[] | null;
2454
+ features: Json | null;
2455
+ fika_rating: number | null;
2456
+ geo_point: Json | null;
2457
+ google_rating: number | null;
2458
+ id: string;
2459
+ images: Json | null;
2460
+ info: Json | null;
2461
+ logo_image: string | null;
2462
+ name: string;
2463
+ onboarding: Json | null;
2464
+ payment_options: Json | null;
2465
+ place_id: string | null;
2466
+ platform_loyalty_rewards: Json | null;
2467
+ rating_details: Json | null;
2468
+ regular_opening_hours: Json | null;
2469
+ roaster_refs_ids: string[] | null;
2470
+ roasting_and_beans_info: Json | null;
2471
+ signals: Json | null;
2472
+ slug: string | null;
2473
+ speciality_level: string | null;
2474
+ specialties: Json | null;
2475
+ specialty: Json | null;
2476
+ total_reviews: number | null;
2477
+ updated_at: string | null;
2478
+ };
2479
+ Insert: {
2480
+ active?: boolean | null;
2481
+ added_at?: string | null;
2482
+ added_by_user?: string | null;
2483
+ analytics?: Json | null;
2484
+ awards?: Json | null;
2485
+ brew_methods?: string[] | null;
2486
+ city?: string | null;
2487
+ coffee_brewing_methods?: Json | null;
2488
+ contact_details?: Json | null;
2489
+ country_code?: string | null;
2490
+ cover_image?: string | null;
2491
+ created_at?: string | null;
2492
+ custom_roasters?: string[] | null;
2493
+ features?: Json | null;
2494
+ fika_rating?: number | null;
2495
+ geo_point?: Json | null;
2496
+ google_rating?: number | null;
2497
+ id: string;
2498
+ images?: Json | null;
2499
+ info?: Json | null;
2500
+ logo_image?: string | null;
2501
+ name: string;
2502
+ onboarding?: Json | null;
2503
+ payment_options?: Json | null;
2504
+ place_id?: string | null;
2505
+ platform_loyalty_rewards?: Json | null;
2506
+ rating_details?: Json | null;
2507
+ regular_opening_hours?: Json | null;
2508
+ roaster_refs_ids?: string[] | null;
2509
+ roasting_and_beans_info?: Json | null;
2510
+ signals?: Json | null;
2511
+ slug?: string | null;
2512
+ speciality_level?: string | null;
2513
+ specialties?: Json | null;
2514
+ specialty?: Json | null;
2515
+ total_reviews?: number | null;
2516
+ updated_at?: string | null;
2517
+ };
2518
+ Update: {
2519
+ active?: boolean | null;
2520
+ added_at?: string | null;
2521
+ added_by_user?: string | null;
2522
+ analytics?: Json | null;
2523
+ awards?: Json | null;
2524
+ brew_methods?: string[] | null;
2525
+ city?: string | null;
2526
+ coffee_brewing_methods?: Json | null;
2527
+ contact_details?: Json | null;
2528
+ country_code?: string | null;
2529
+ cover_image?: string | null;
2530
+ created_at?: string | null;
2531
+ custom_roasters?: string[] | null;
2532
+ features?: Json | null;
2533
+ fika_rating?: number | null;
2534
+ geo_point?: Json | null;
2535
+ google_rating?: number | null;
2536
+ id?: string;
2537
+ images?: Json | null;
2538
+ info?: Json | null;
2539
+ logo_image?: string | null;
2540
+ name?: string;
2541
+ onboarding?: Json | null;
2542
+ payment_options?: Json | null;
2543
+ place_id?: string | null;
2544
+ platform_loyalty_rewards?: Json | null;
2545
+ rating_details?: Json | null;
2546
+ regular_opening_hours?: Json | null;
2547
+ roaster_refs_ids?: string[] | null;
2548
+ roasting_and_beans_info?: Json | null;
2549
+ signals?: Json | null;
2550
+ slug?: string | null;
2551
+ speciality_level?: string | null;
2552
+ specialties?: Json | null;
2553
+ specialty?: Json | null;
2554
+ total_reviews?: number | null;
2555
+ updated_at?: string | null;
2556
+ };
2557
+ Relationships: [
2558
+ {
2559
+ foreignKeyName: "shops_added_by_user_fkey";
2560
+ columns: ["added_by_user"];
2561
+ isOneToOne: false;
2562
+ referencedRelation: "leaderboard";
2563
+ referencedColumns: ["id"];
2564
+ },
2565
+ {
2566
+ foreignKeyName: "shops_added_by_user_fkey";
2567
+ columns: ["added_by_user"];
2568
+ isOneToOne: false;
2569
+ referencedRelation: "user_activity_summary";
2570
+ referencedColumns: ["id"];
2571
+ },
2572
+ {
2573
+ foreignKeyName: "shops_added_by_user_fkey";
2574
+ columns: ["added_by_user"];
2575
+ isOneToOne: false;
2576
+ referencedRelation: "users";
2577
+ referencedColumns: ["id"];
2578
+ }
2579
+ ];
2580
+ };
2581
+ shot_likes: {
2582
+ Row: {
2583
+ created_at: string | null;
2584
+ shot_id: string;
2585
+ user_id: string;
2586
+ };
2587
+ Insert: {
2588
+ created_at?: string | null;
2589
+ shot_id: string;
2590
+ user_id: string;
2591
+ };
2592
+ Update: {
2593
+ created_at?: string | null;
2594
+ shot_id?: string;
2595
+ user_id?: string;
2596
+ };
2597
+ Relationships: [
2598
+ {
2599
+ foreignKeyName: "shot_likes_shot_id_fkey";
2600
+ columns: ["shot_id"];
2601
+ isOneToOne: false;
2602
+ referencedRelation: "shots";
2603
+ referencedColumns: ["id"];
2604
+ },
2605
+ {
2606
+ foreignKeyName: "shot_likes_user_id_fkey";
2607
+ columns: ["user_id"];
2608
+ isOneToOne: false;
2609
+ referencedRelation: "leaderboard";
2610
+ referencedColumns: ["id"];
2611
+ },
2612
+ {
2613
+ foreignKeyName: "shot_likes_user_id_fkey";
2614
+ columns: ["user_id"];
2615
+ isOneToOne: false;
2616
+ referencedRelation: "user_activity_summary";
2617
+ referencedColumns: ["id"];
2618
+ },
2619
+ {
2620
+ foreignKeyName: "shot_likes_user_id_fkey";
2621
+ columns: ["user_id"];
2622
+ isOneToOne: false;
2623
+ referencedRelation: "users";
2624
+ referencedColumns: ["id"];
2625
+ }
2626
+ ];
2627
+ };
2628
+ shots: {
2629
+ Row: {
2630
+ coffee_shop_id: string | null;
2631
+ coffee_shop_name: string | null;
2632
+ created_at: string | null;
2633
+ date: string | null;
2634
+ geo_point: Json | null;
2635
+ id: string;
2636
+ image: string | null;
2637
+ user_id: string | null;
2638
+ };
2639
+ Insert: {
2640
+ coffee_shop_id?: string | null;
2641
+ coffee_shop_name?: string | null;
2642
+ created_at?: string | null;
2643
+ date?: string | null;
2644
+ geo_point?: Json | null;
2645
+ id: string;
2646
+ image?: string | null;
2647
+ user_id?: string | null;
2648
+ };
2649
+ Update: {
2650
+ coffee_shop_id?: string | null;
2651
+ coffee_shop_name?: string | null;
2652
+ created_at?: string | null;
2653
+ date?: string | null;
2654
+ geo_point?: Json | null;
2655
+ id?: string;
2656
+ image?: string | null;
2657
+ user_id?: string | null;
2658
+ };
2659
+ Relationships: [
2660
+ {
2661
+ foreignKeyName: "shots_coffee_shop_id_fkey";
2662
+ columns: ["coffee_shop_id"];
2663
+ isOneToOne: false;
2664
+ referencedRelation: "shop_stats";
2665
+ referencedColumns: ["id"];
2666
+ },
2667
+ {
2668
+ foreignKeyName: "shots_coffee_shop_id_fkey";
2669
+ columns: ["coffee_shop_id"];
2670
+ isOneToOne: false;
2671
+ referencedRelation: "shops";
2672
+ referencedColumns: ["id"];
2673
+ },
2674
+ {
2675
+ foreignKeyName: "shots_user_id_fkey";
2676
+ columns: ["user_id"];
2677
+ isOneToOne: false;
2678
+ referencedRelation: "leaderboard";
2679
+ referencedColumns: ["id"];
2680
+ },
2681
+ {
2682
+ foreignKeyName: "shots_user_id_fkey";
2683
+ columns: ["user_id"];
2684
+ isOneToOne: false;
2685
+ referencedRelation: "user_activity_summary";
2686
+ referencedColumns: ["id"];
2687
+ },
2688
+ {
2689
+ foreignKeyName: "shots_user_id_fkey";
2690
+ columns: ["user_id"];
2691
+ isOneToOne: false;
2692
+ referencedRelation: "users";
2693
+ referencedColumns: ["id"];
2694
+ }
2695
+ ];
2696
+ };
2697
+ specialty_jobs: {
2698
+ Row: {
2699
+ completed_at: string | null;
2700
+ created_at: string;
2701
+ error_message: string | null;
2702
+ id: string;
2703
+ job_name: string;
2704
+ result: Json | null;
2705
+ started_at: string | null;
2706
+ status: string;
2707
+ };
2708
+ Insert: {
2709
+ completed_at?: string | null;
2710
+ created_at?: string;
2711
+ error_message?: string | null;
2712
+ id?: string;
2713
+ job_name: string;
2714
+ result?: Json | null;
2715
+ started_at?: string | null;
2716
+ status?: string;
2717
+ };
2718
+ Update: {
2719
+ completed_at?: string | null;
2720
+ created_at?: string;
2721
+ error_message?: string | null;
2722
+ id?: string;
2723
+ job_name?: string;
2724
+ result?: Json | null;
2725
+ started_at?: string | null;
2726
+ status?: string;
2727
+ };
2728
+ Relationships: [];
2729
+ };
2730
+ staff: {
2731
+ Row: {
2732
+ accepted_at: string | null;
2733
+ created_at: string;
2734
+ id: string;
2735
+ invited_at: string | null;
2736
+ invited_by: string | null;
2737
+ permissions: Json | null;
2738
+ role: string;
2739
+ shop_id: string;
2740
+ status: string;
2741
+ updated_at: string;
2742
+ user_id: string;
2743
+ };
2744
+ Insert: {
2745
+ accepted_at?: string | null;
2746
+ created_at?: string;
2747
+ id?: string;
2748
+ invited_at?: string | null;
2749
+ invited_by?: string | null;
2750
+ permissions?: Json | null;
2751
+ role?: string;
2752
+ shop_id: string;
2753
+ status?: string;
2754
+ updated_at?: string;
2755
+ user_id: string;
2756
+ };
2757
+ Update: {
2758
+ accepted_at?: string | null;
2759
+ created_at?: string;
2760
+ id?: string;
2761
+ invited_at?: string | null;
2762
+ invited_by?: string | null;
2763
+ permissions?: Json | null;
2764
+ role?: string;
2765
+ shop_id?: string;
2766
+ status?: string;
2767
+ updated_at?: string;
2768
+ user_id?: string;
2769
+ };
2770
+ Relationships: [
2771
+ {
2772
+ foreignKeyName: "staff_invited_by_fkey";
2773
+ columns: ["invited_by"];
2774
+ isOneToOne: false;
2775
+ referencedRelation: "leaderboard";
2776
+ referencedColumns: ["id"];
2777
+ },
2778
+ {
2779
+ foreignKeyName: "staff_invited_by_fkey";
2780
+ columns: ["invited_by"];
2781
+ isOneToOne: false;
2782
+ referencedRelation: "user_activity_summary";
2783
+ referencedColumns: ["id"];
2784
+ },
2785
+ {
2786
+ foreignKeyName: "staff_invited_by_fkey";
2787
+ columns: ["invited_by"];
2788
+ isOneToOne: false;
2789
+ referencedRelation: "users";
2790
+ referencedColumns: ["id"];
2791
+ },
2792
+ {
2793
+ foreignKeyName: "staff_shop_id_fkey";
2794
+ columns: ["shop_id"];
2795
+ isOneToOne: false;
2796
+ referencedRelation: "shop_stats";
2797
+ referencedColumns: ["id"];
2798
+ },
2799
+ {
2800
+ foreignKeyName: "staff_shop_id_fkey";
2801
+ columns: ["shop_id"];
2802
+ isOneToOne: false;
2803
+ referencedRelation: "shops";
2804
+ referencedColumns: ["id"];
2805
+ },
2806
+ {
2807
+ foreignKeyName: "staff_user_id_fkey";
2808
+ columns: ["user_id"];
2809
+ isOneToOne: false;
2810
+ referencedRelation: "leaderboard";
2811
+ referencedColumns: ["id"];
2812
+ },
2813
+ {
2814
+ foreignKeyName: "staff_user_id_fkey";
2815
+ columns: ["user_id"];
2816
+ isOneToOne: false;
2817
+ referencedRelation: "user_activity_summary";
2818
+ referencedColumns: ["id"];
2819
+ },
2820
+ {
2821
+ foreignKeyName: "staff_user_id_fkey";
2822
+ columns: ["user_id"];
2823
+ isOneToOne: false;
2824
+ referencedRelation: "users";
2825
+ referencedColumns: ["id"];
2826
+ }
2827
+ ];
2828
+ };
2829
+ staff_invites: {
2830
+ Row: {
2831
+ accepted_at: string | null;
2832
+ accepted_by: string | null;
2833
+ created_at: string;
2834
+ email: string;
2835
+ expires_at: string;
2836
+ id: string;
2837
+ invited_by: string;
2838
+ permissions: Json | null;
2839
+ role: string;
2840
+ shop_id: string;
2841
+ status: string;
2842
+ token: string;
2843
+ };
2844
+ Insert: {
2845
+ accepted_at?: string | null;
2846
+ accepted_by?: string | null;
2847
+ created_at?: string;
2848
+ email: string;
2849
+ expires_at: string;
2850
+ id?: string;
2851
+ invited_by: string;
2852
+ permissions?: Json | null;
2853
+ role?: string;
2854
+ shop_id: string;
2855
+ status?: string;
2856
+ token: string;
2857
+ };
2858
+ Update: {
2859
+ accepted_at?: string | null;
2860
+ accepted_by?: string | null;
2861
+ created_at?: string;
2862
+ email?: string;
2863
+ expires_at?: string;
2864
+ id?: string;
2865
+ invited_by?: string;
2866
+ permissions?: Json | null;
2867
+ role?: string;
2868
+ shop_id?: string;
2869
+ status?: string;
2870
+ token?: string;
2871
+ };
2872
+ Relationships: [
2873
+ {
2874
+ foreignKeyName: "staff_invites_accepted_by_fkey";
2875
+ columns: ["accepted_by"];
2876
+ isOneToOne: false;
2877
+ referencedRelation: "leaderboard";
2878
+ referencedColumns: ["id"];
2879
+ },
2880
+ {
2881
+ foreignKeyName: "staff_invites_accepted_by_fkey";
2882
+ columns: ["accepted_by"];
2883
+ isOneToOne: false;
2884
+ referencedRelation: "user_activity_summary";
2885
+ referencedColumns: ["id"];
2886
+ },
2887
+ {
2888
+ foreignKeyName: "staff_invites_accepted_by_fkey";
2889
+ columns: ["accepted_by"];
2890
+ isOneToOne: false;
2891
+ referencedRelation: "users";
2892
+ referencedColumns: ["id"];
2893
+ },
2894
+ {
2895
+ foreignKeyName: "staff_invites_invited_by_fkey";
2896
+ columns: ["invited_by"];
2897
+ isOneToOne: false;
2898
+ referencedRelation: "leaderboard";
2899
+ referencedColumns: ["id"];
2900
+ },
2901
+ {
2902
+ foreignKeyName: "staff_invites_invited_by_fkey";
2903
+ columns: ["invited_by"];
2904
+ isOneToOne: false;
2905
+ referencedRelation: "user_activity_summary";
2906
+ referencedColumns: ["id"];
2907
+ },
2908
+ {
2909
+ foreignKeyName: "staff_invites_invited_by_fkey";
2910
+ columns: ["invited_by"];
2911
+ isOneToOne: false;
2912
+ referencedRelation: "users";
2913
+ referencedColumns: ["id"];
2914
+ },
2915
+ {
2916
+ foreignKeyName: "staff_invites_shop_id_fkey";
2917
+ columns: ["shop_id"];
2918
+ isOneToOne: false;
2919
+ referencedRelation: "shop_stats";
2920
+ referencedColumns: ["id"];
2921
+ },
2922
+ {
2923
+ foreignKeyName: "staff_invites_shop_id_fkey";
2924
+ columns: ["shop_id"];
2925
+ isOneToOne: false;
2926
+ referencedRelation: "shops";
2927
+ referencedColumns: ["id"];
2928
+ }
2929
+ ];
2930
+ };
2931
+ stickers: {
2932
+ Row: {
2933
+ category: string | null;
2934
+ created_at: string;
2935
+ description: string | null;
2936
+ id: string;
2937
+ image_url: string;
2938
+ is_active: boolean | null;
2939
+ name: string;
2940
+ rarity: string | null;
2941
+ unlock_criteria: Json | null;
2942
+ };
2943
+ Insert: {
2944
+ category?: string | null;
2945
+ created_at?: string;
2946
+ description?: string | null;
2947
+ id: string;
2948
+ image_url: string;
2949
+ is_active?: boolean | null;
2950
+ name: string;
2951
+ rarity?: string | null;
2952
+ unlock_criteria?: Json | null;
2953
+ };
2954
+ Update: {
2955
+ category?: string | null;
2956
+ created_at?: string;
2957
+ description?: string | null;
2958
+ id?: string;
2959
+ image_url?: string;
2960
+ is_active?: boolean | null;
2961
+ name?: string;
2962
+ rarity?: string | null;
2963
+ unlock_criteria?: Json | null;
2964
+ };
2965
+ Relationships: [];
2966
+ };
2967
+ submissions: {
2968
+ Row: {
2969
+ created_at: string;
2970
+ data: Json;
2971
+ id: string;
2972
+ review_notes: string | null;
2973
+ reviewed_at: string | null;
2974
+ reviewed_by: string | null;
2975
+ status: string;
2976
+ type: string;
2977
+ updated_at: string;
2978
+ user_id: string;
2979
+ };
2980
+ Insert: {
2981
+ created_at?: string;
2982
+ data: Json;
2983
+ id?: string;
2984
+ review_notes?: string | null;
2985
+ reviewed_at?: string | null;
2986
+ reviewed_by?: string | null;
2987
+ status?: string;
2988
+ type: string;
2989
+ updated_at?: string;
2990
+ user_id: string;
2991
+ };
2992
+ Update: {
2993
+ created_at?: string;
2994
+ data?: Json;
2995
+ id?: string;
2996
+ review_notes?: string | null;
2997
+ reviewed_at?: string | null;
2998
+ reviewed_by?: string | null;
2999
+ status?: string;
3000
+ type?: string;
3001
+ updated_at?: string;
3002
+ user_id?: string;
3003
+ };
3004
+ Relationships: [
3005
+ {
3006
+ foreignKeyName: "submissions_reviewed_by_fkey";
3007
+ columns: ["reviewed_by"];
3008
+ isOneToOne: false;
3009
+ referencedRelation: "leaderboard";
3010
+ referencedColumns: ["id"];
3011
+ },
3012
+ {
3013
+ foreignKeyName: "submissions_reviewed_by_fkey";
3014
+ columns: ["reviewed_by"];
3015
+ isOneToOne: false;
3016
+ referencedRelation: "user_activity_summary";
3017
+ referencedColumns: ["id"];
3018
+ },
3019
+ {
3020
+ foreignKeyName: "submissions_reviewed_by_fkey";
3021
+ columns: ["reviewed_by"];
3022
+ isOneToOne: false;
3023
+ referencedRelation: "users";
3024
+ referencedColumns: ["id"];
3025
+ },
3026
+ {
3027
+ foreignKeyName: "submissions_user_id_fkey";
3028
+ columns: ["user_id"];
3029
+ isOneToOne: false;
3030
+ referencedRelation: "leaderboard";
3031
+ referencedColumns: ["id"];
3032
+ },
3033
+ {
3034
+ foreignKeyName: "submissions_user_id_fkey";
3035
+ columns: ["user_id"];
3036
+ isOneToOne: false;
3037
+ referencedRelation: "user_activity_summary";
3038
+ referencedColumns: ["id"];
3039
+ },
3040
+ {
3041
+ foreignKeyName: "submissions_user_id_fkey";
3042
+ columns: ["user_id"];
3043
+ isOneToOne: false;
3044
+ referencedRelation: "users";
3045
+ referencedColumns: ["id"];
3046
+ }
3047
+ ];
3048
+ };
3049
+ system_config: {
3050
+ Row: {
3051
+ created_at: string;
3052
+ description: string | null;
3053
+ key: string;
3054
+ updated_at: string;
3055
+ updated_by: string | null;
3056
+ value: Json;
3057
+ };
3058
+ Insert: {
3059
+ created_at?: string;
3060
+ description?: string | null;
3061
+ key: string;
3062
+ updated_at?: string;
3063
+ updated_by?: string | null;
3064
+ value: Json;
3065
+ };
3066
+ Update: {
3067
+ created_at?: string;
3068
+ description?: string | null;
3069
+ key?: string;
3070
+ updated_at?: string;
3071
+ updated_by?: string | null;
3072
+ value?: Json;
3073
+ };
3074
+ Relationships: [
3075
+ {
3076
+ foreignKeyName: "system_config_updated_by_fkey";
3077
+ columns: ["updated_by"];
3078
+ isOneToOne: false;
3079
+ referencedRelation: "leaderboard";
3080
+ referencedColumns: ["id"];
3081
+ },
3082
+ {
3083
+ foreignKeyName: "system_config_updated_by_fkey";
3084
+ columns: ["updated_by"];
3085
+ isOneToOne: false;
3086
+ referencedRelation: "user_activity_summary";
3087
+ referencedColumns: ["id"];
3088
+ },
3089
+ {
3090
+ foreignKeyName: "system_config_updated_by_fkey";
3091
+ columns: ["updated_by"];
3092
+ isOneToOne: false;
3093
+ referencedRelation: "users";
3094
+ referencedColumns: ["id"];
3095
+ }
3096
+ ];
3097
+ };
3098
+ things_to_do: {
3099
+ Row: {
3100
+ created_at: string;
3101
+ description: string | null;
3102
+ end_date: string | null;
3103
+ id: string;
3104
+ image_url: string | null;
3105
+ is_active: boolean | null;
3106
+ location: Json | null;
3107
+ priority: number | null;
3108
+ related_shop_id: string | null;
3109
+ start_date: string | null;
3110
+ tags: string[] | null;
3111
+ title: string;
3112
+ type: string;
3113
+ updated_at: string;
3114
+ };
3115
+ Insert: {
3116
+ created_at?: string;
3117
+ description?: string | null;
3118
+ end_date?: string | null;
3119
+ id?: string;
3120
+ image_url?: string | null;
3121
+ is_active?: boolean | null;
3122
+ location?: Json | null;
3123
+ priority?: number | null;
3124
+ related_shop_id?: string | null;
3125
+ start_date?: string | null;
3126
+ tags?: string[] | null;
3127
+ title: string;
3128
+ type: string;
3129
+ updated_at?: string;
3130
+ };
3131
+ Update: {
3132
+ created_at?: string;
3133
+ description?: string | null;
3134
+ end_date?: string | null;
3135
+ id?: string;
3136
+ image_url?: string | null;
3137
+ is_active?: boolean | null;
3138
+ location?: Json | null;
3139
+ priority?: number | null;
3140
+ related_shop_id?: string | null;
3141
+ start_date?: string | null;
3142
+ tags?: string[] | null;
3143
+ title?: string;
3144
+ type?: string;
3145
+ updated_at?: string;
3146
+ };
3147
+ Relationships: [
3148
+ {
3149
+ foreignKeyName: "things_to_do_related_shop_id_fkey";
3150
+ columns: ["related_shop_id"];
3151
+ isOneToOne: false;
3152
+ referencedRelation: "shop_stats";
3153
+ referencedColumns: ["id"];
3154
+ },
3155
+ {
3156
+ foreignKeyName: "things_to_do_related_shop_id_fkey";
3157
+ columns: ["related_shop_id"];
3158
+ isOneToOne: false;
3159
+ referencedRelation: "shops";
3160
+ referencedColumns: ["id"];
3161
+ }
3162
+ ];
3163
+ };
3164
+ user_corrections: {
3165
+ Row: {
3166
+ created_at: string;
3167
+ current_value: string | null;
3168
+ entity_id: string;
3169
+ entity_type: string;
3170
+ field_name: string;
3171
+ id: string;
3172
+ reason: string | null;
3173
+ review_notes: string | null;
3174
+ reviewed_at: string | null;
3175
+ reviewed_by: string | null;
3176
+ status: string;
3177
+ suggested_value: string;
3178
+ user_id: string;
3179
+ };
3180
+ Insert: {
3181
+ created_at?: string;
3182
+ current_value?: string | null;
3183
+ entity_id: string;
3184
+ entity_type: string;
3185
+ field_name: string;
3186
+ id?: string;
3187
+ reason?: string | null;
3188
+ review_notes?: string | null;
3189
+ reviewed_at?: string | null;
3190
+ reviewed_by?: string | null;
3191
+ status?: string;
3192
+ suggested_value: string;
3193
+ user_id: string;
3194
+ };
3195
+ Update: {
3196
+ created_at?: string;
3197
+ current_value?: string | null;
3198
+ entity_id?: string;
3199
+ entity_type?: string;
3200
+ field_name?: string;
3201
+ id?: string;
3202
+ reason?: string | null;
3203
+ review_notes?: string | null;
3204
+ reviewed_at?: string | null;
3205
+ reviewed_by?: string | null;
3206
+ status?: string;
3207
+ suggested_value?: string;
3208
+ user_id?: string;
3209
+ };
3210
+ Relationships: [
3211
+ {
3212
+ foreignKeyName: "user_corrections_reviewed_by_fkey";
3213
+ columns: ["reviewed_by"];
3214
+ isOneToOne: false;
3215
+ referencedRelation: "leaderboard";
3216
+ referencedColumns: ["id"];
3217
+ },
3218
+ {
3219
+ foreignKeyName: "user_corrections_reviewed_by_fkey";
3220
+ columns: ["reviewed_by"];
3221
+ isOneToOne: false;
3222
+ referencedRelation: "user_activity_summary";
3223
+ referencedColumns: ["id"];
3224
+ },
3225
+ {
3226
+ foreignKeyName: "user_corrections_reviewed_by_fkey";
3227
+ columns: ["reviewed_by"];
3228
+ isOneToOne: false;
3229
+ referencedRelation: "users";
3230
+ referencedColumns: ["id"];
3231
+ },
3232
+ {
3233
+ foreignKeyName: "user_corrections_user_id_fkey";
3234
+ columns: ["user_id"];
3235
+ isOneToOne: false;
3236
+ referencedRelation: "leaderboard";
3237
+ referencedColumns: ["id"];
3238
+ },
3239
+ {
3240
+ foreignKeyName: "user_corrections_user_id_fkey";
3241
+ columns: ["user_id"];
3242
+ isOneToOne: false;
3243
+ referencedRelation: "user_activity_summary";
3244
+ referencedColumns: ["id"];
3245
+ },
3246
+ {
3247
+ foreignKeyName: "user_corrections_user_id_fkey";
3248
+ columns: ["user_id"];
3249
+ isOneToOne: false;
3250
+ referencedRelation: "users";
3251
+ referencedColumns: ["id"];
3252
+ }
3253
+ ];
3254
+ };
3255
+ user_followers: {
3256
+ Row: {
3257
+ created_at: string | null;
3258
+ follower_id: string;
3259
+ following_id: string;
3260
+ };
3261
+ Insert: {
3262
+ created_at?: string | null;
3263
+ follower_id: string;
3264
+ following_id: string;
3265
+ };
3266
+ Update: {
3267
+ created_at?: string | null;
3268
+ follower_id?: string;
3269
+ following_id?: string;
3270
+ };
3271
+ Relationships: [
3272
+ {
3273
+ foreignKeyName: "user_followers_follower_id_fkey";
3274
+ columns: ["follower_id"];
3275
+ isOneToOne: false;
3276
+ referencedRelation: "leaderboard";
3277
+ referencedColumns: ["id"];
3278
+ },
3279
+ {
3280
+ foreignKeyName: "user_followers_follower_id_fkey";
3281
+ columns: ["follower_id"];
3282
+ isOneToOne: false;
3283
+ referencedRelation: "user_activity_summary";
3284
+ referencedColumns: ["id"];
3285
+ },
3286
+ {
3287
+ foreignKeyName: "user_followers_follower_id_fkey";
3288
+ columns: ["follower_id"];
3289
+ isOneToOne: false;
3290
+ referencedRelation: "users";
3291
+ referencedColumns: ["id"];
3292
+ },
3293
+ {
3294
+ foreignKeyName: "user_followers_following_id_fkey";
3295
+ columns: ["following_id"];
3296
+ isOneToOne: false;
3297
+ referencedRelation: "leaderboard";
3298
+ referencedColumns: ["id"];
3299
+ },
3300
+ {
3301
+ foreignKeyName: "user_followers_following_id_fkey";
3302
+ columns: ["following_id"];
3303
+ isOneToOne: false;
3304
+ referencedRelation: "user_activity_summary";
3305
+ referencedColumns: ["id"];
3306
+ },
3307
+ {
3308
+ foreignKeyName: "user_followers_following_id_fkey";
3309
+ columns: ["following_id"];
3310
+ isOneToOne: false;
3311
+ referencedRelation: "users";
3312
+ referencedColumns: ["id"];
3313
+ }
3314
+ ];
3315
+ };
3316
+ user_list_shops: {
3317
+ Row: {
3318
+ added_at: string;
3319
+ id: string;
3320
+ list_id: string;
3321
+ notes: string | null;
3322
+ position: number | null;
3323
+ shop_id: string;
3324
+ };
3325
+ Insert: {
3326
+ added_at?: string;
3327
+ id?: string;
3328
+ list_id: string;
3329
+ notes?: string | null;
3330
+ position?: number | null;
3331
+ shop_id: string;
3332
+ };
3333
+ Update: {
3334
+ added_at?: string;
3335
+ id?: string;
3336
+ list_id?: string;
3337
+ notes?: string | null;
3338
+ position?: number | null;
3339
+ shop_id?: string;
3340
+ };
3341
+ Relationships: [
3342
+ {
3343
+ foreignKeyName: "user_list_shops_list_id_fkey";
3344
+ columns: ["list_id"];
3345
+ isOneToOne: false;
3346
+ referencedRelation: "user_lists";
3347
+ referencedColumns: ["id"];
3348
+ },
3349
+ {
3350
+ foreignKeyName: "user_list_shops_shop_id_fkey";
3351
+ columns: ["shop_id"];
3352
+ isOneToOne: false;
3353
+ referencedRelation: "shop_stats";
3354
+ referencedColumns: ["id"];
3355
+ },
3356
+ {
3357
+ foreignKeyName: "user_list_shops_shop_id_fkey";
3358
+ columns: ["shop_id"];
3359
+ isOneToOne: false;
3360
+ referencedRelation: "shops";
3361
+ referencedColumns: ["id"];
3362
+ }
3363
+ ];
3364
+ };
3365
+ user_lists: {
3366
+ Row: {
3367
+ cover_image_url: string | null;
3368
+ created_at: string;
3369
+ description: string | null;
3370
+ id: string;
3371
+ is_public: boolean | null;
3372
+ name: string;
3373
+ updated_at: string;
3374
+ user_id: string;
3375
+ };
3376
+ Insert: {
3377
+ cover_image_url?: string | null;
3378
+ created_at?: string;
3379
+ description?: string | null;
3380
+ id?: string;
3381
+ is_public?: boolean | null;
3382
+ name: string;
3383
+ updated_at?: string;
3384
+ user_id: string;
3385
+ };
3386
+ Update: {
3387
+ cover_image_url?: string | null;
3388
+ created_at?: string;
3389
+ description?: string | null;
3390
+ id?: string;
3391
+ is_public?: boolean | null;
3392
+ name?: string;
3393
+ updated_at?: string;
3394
+ user_id?: string;
3395
+ };
3396
+ Relationships: [
3397
+ {
3398
+ foreignKeyName: "user_lists_user_id_fkey";
3399
+ columns: ["user_id"];
3400
+ isOneToOne: false;
3401
+ referencedRelation: "leaderboard";
3402
+ referencedColumns: ["id"];
3403
+ },
3404
+ {
3405
+ foreignKeyName: "user_lists_user_id_fkey";
3406
+ columns: ["user_id"];
3407
+ isOneToOne: false;
3408
+ referencedRelation: "user_activity_summary";
3409
+ referencedColumns: ["id"];
3410
+ },
3411
+ {
3412
+ foreignKeyName: "user_lists_user_id_fkey";
3413
+ columns: ["user_id"];
3414
+ isOneToOne: false;
3415
+ referencedRelation: "users";
3416
+ referencedColumns: ["id"];
3417
+ }
3418
+ ];
3419
+ };
3420
+ user_shop_orders: {
3421
+ Row: {
3422
+ created_at: string;
3423
+ id: string;
3424
+ last_order_at: string | null;
3425
+ order_type: string;
3426
+ preferences: Json | null;
3427
+ shop_id: string;
3428
+ updated_at: string;
3429
+ user_id: string;
3430
+ };
3431
+ Insert: {
3432
+ created_at?: string;
3433
+ id?: string;
3434
+ last_order_at?: string | null;
3435
+ order_type: string;
3436
+ preferences?: Json | null;
3437
+ shop_id: string;
3438
+ updated_at?: string;
3439
+ user_id: string;
3440
+ };
3441
+ Update: {
3442
+ created_at?: string;
3443
+ id?: string;
3444
+ last_order_at?: string | null;
3445
+ order_type?: string;
3446
+ preferences?: Json | null;
3447
+ shop_id?: string;
3448
+ updated_at?: string;
3449
+ user_id?: string;
3450
+ };
3451
+ Relationships: [
3452
+ {
3453
+ foreignKeyName: "user_shop_orders_shop_id_fkey";
3454
+ columns: ["shop_id"];
3455
+ isOneToOne: false;
3456
+ referencedRelation: "shop_stats";
3457
+ referencedColumns: ["id"];
3458
+ },
3459
+ {
3460
+ foreignKeyName: "user_shop_orders_shop_id_fkey";
3461
+ columns: ["shop_id"];
3462
+ isOneToOne: false;
3463
+ referencedRelation: "shops";
3464
+ referencedColumns: ["id"];
3465
+ },
3466
+ {
3467
+ foreignKeyName: "user_shop_orders_user_id_fkey";
3468
+ columns: ["user_id"];
3469
+ isOneToOne: false;
3470
+ referencedRelation: "leaderboard";
3471
+ referencedColumns: ["id"];
3472
+ },
3473
+ {
3474
+ foreignKeyName: "user_shop_orders_user_id_fkey";
3475
+ columns: ["user_id"];
3476
+ isOneToOne: false;
3477
+ referencedRelation: "user_activity_summary";
3478
+ referencedColumns: ["id"];
3479
+ },
3480
+ {
3481
+ foreignKeyName: "user_shop_orders_user_id_fkey";
3482
+ columns: ["user_id"];
3483
+ isOneToOne: false;
3484
+ referencedRelation: "users";
3485
+ referencedColumns: ["id"];
3486
+ }
3487
+ ];
3488
+ };
3489
+ user_stickers: {
3490
+ Row: {
3491
+ earned_at: string;
3492
+ id: string;
3493
+ source: string | null;
3494
+ source_id: string | null;
3495
+ sticker_id: string;
3496
+ user_id: string;
3497
+ };
3498
+ Insert: {
3499
+ earned_at?: string;
3500
+ id?: string;
3501
+ source?: string | null;
3502
+ source_id?: string | null;
3503
+ sticker_id: string;
3504
+ user_id: string;
3505
+ };
3506
+ Update: {
3507
+ earned_at?: string;
3508
+ id?: string;
3509
+ source?: string | null;
3510
+ source_id?: string | null;
3511
+ sticker_id?: string;
3512
+ user_id?: string;
3513
+ };
3514
+ Relationships: [
3515
+ {
3516
+ foreignKeyName: "user_stickers_sticker_id_fkey";
3517
+ columns: ["sticker_id"];
3518
+ isOneToOne: false;
3519
+ referencedRelation: "stickers";
3520
+ referencedColumns: ["id"];
3521
+ },
3522
+ {
3523
+ foreignKeyName: "user_stickers_user_id_fkey";
3524
+ columns: ["user_id"];
3525
+ isOneToOne: false;
3526
+ referencedRelation: "leaderboard";
3527
+ referencedColumns: ["id"];
3528
+ },
3529
+ {
3530
+ foreignKeyName: "user_stickers_user_id_fkey";
3531
+ columns: ["user_id"];
3532
+ isOneToOne: false;
3533
+ referencedRelation: "user_activity_summary";
3534
+ referencedColumns: ["id"];
3535
+ },
3536
+ {
3537
+ foreignKeyName: "user_stickers_user_id_fkey";
3538
+ columns: ["user_id"];
3539
+ isOneToOne: false;
3540
+ referencedRelation: "users";
3541
+ referencedColumns: ["id"];
3542
+ }
3543
+ ];
3544
+ };
3545
+ usernames: {
3546
+ Row: {
3547
+ updated_at: string | null;
3548
+ user_id: string | null;
3549
+ username: string;
3550
+ };
3551
+ Insert: {
3552
+ updated_at?: string | null;
3553
+ user_id?: string | null;
3554
+ username: string;
3555
+ };
3556
+ Update: {
3557
+ updated_at?: string | null;
3558
+ user_id?: string | null;
3559
+ username?: string;
3560
+ };
3561
+ Relationships: [
3562
+ {
3563
+ foreignKeyName: "usernames_user_id_fkey";
3564
+ columns: ["user_id"];
3565
+ isOneToOne: false;
3566
+ referencedRelation: "leaderboard";
3567
+ referencedColumns: ["id"];
3568
+ },
3569
+ {
3570
+ foreignKeyName: "usernames_user_id_fkey";
3571
+ columns: ["user_id"];
3572
+ isOneToOne: false;
3573
+ referencedRelation: "user_activity_summary";
3574
+ referencedColumns: ["id"];
3575
+ },
3576
+ {
3577
+ foreignKeyName: "usernames_user_id_fkey";
3578
+ columns: ["user_id"];
3579
+ isOneToOne: false;
3580
+ referencedRelation: "users";
3581
+ referencedColumns: ["id"];
3582
+ }
3583
+ ];
3584
+ };
3585
+ users: {
3586
+ Row: {
3587
+ created_at: string | null;
3588
+ custom_claims: Json | null;
3589
+ deleted_at: string | null;
3590
+ disabled: boolean | null;
3591
+ display_name: string | null;
3592
+ early_adopter: boolean | null;
3593
+ email: string | null;
3594
+ email_verified: boolean | null;
3595
+ home_city: string | null;
3596
+ home_country: string | null;
3597
+ id: string;
3598
+ last_location: Json | null;
3599
+ last_login: string | null;
3600
+ metadata: Json | null;
3601
+ photo_url: string | null;
3602
+ points: number | null;
3603
+ profile_image: string | null;
3604
+ provider_data: Json | null;
3605
+ shop_roles: Json | null;
3606
+ status: string | null;
3607
+ unread_notification_count: number | null;
3608
+ updated_at: string | null;
3609
+ username: string | null;
3610
+ };
3611
+ Insert: {
3612
+ created_at?: string | null;
3613
+ custom_claims?: Json | null;
3614
+ deleted_at?: string | null;
3615
+ disabled?: boolean | null;
3616
+ display_name?: string | null;
3617
+ early_adopter?: boolean | null;
3618
+ email?: string | null;
3619
+ email_verified?: boolean | null;
3620
+ home_city?: string | null;
3621
+ home_country?: string | null;
3622
+ id: string;
3623
+ last_location?: Json | null;
3624
+ last_login?: string | null;
3625
+ metadata?: Json | null;
3626
+ photo_url?: string | null;
3627
+ points?: number | null;
3628
+ profile_image?: string | null;
3629
+ provider_data?: Json | null;
3630
+ shop_roles?: Json | null;
3631
+ status?: string | null;
3632
+ unread_notification_count?: number | null;
3633
+ updated_at?: string | null;
3634
+ username?: string | null;
3635
+ };
3636
+ Update: {
3637
+ created_at?: string | null;
3638
+ custom_claims?: Json | null;
3639
+ deleted_at?: string | null;
3640
+ disabled?: boolean | null;
3641
+ display_name?: string | null;
3642
+ early_adopter?: boolean | null;
3643
+ email?: string | null;
3644
+ email_verified?: boolean | null;
3645
+ home_city?: string | null;
3646
+ home_country?: string | null;
3647
+ id?: string;
3648
+ last_location?: Json | null;
3649
+ last_login?: string | null;
3650
+ metadata?: Json | null;
3651
+ photo_url?: string | null;
3652
+ points?: number | null;
3653
+ profile_image?: string | null;
3654
+ provider_data?: Json | null;
3655
+ shop_roles?: Json | null;
3656
+ status?: string | null;
3657
+ unread_notification_count?: number | null;
3658
+ updated_at?: string | null;
3659
+ username?: string | null;
3660
+ };
3661
+ Relationships: [];
3662
+ };
3663
+ votes: {
3664
+ Row: {
3665
+ created_at: string | null;
3666
+ id: string;
3667
+ shop_id: string | null;
3668
+ source: string | null;
3669
+ subject_id: string;
3670
+ user_id: string | null;
3671
+ vote_type: string;
3672
+ };
3673
+ Insert: {
3674
+ created_at?: string | null;
3675
+ id: string;
3676
+ shop_id?: string | null;
3677
+ source?: string | null;
3678
+ subject_id: string;
3679
+ user_id?: string | null;
3680
+ vote_type: string;
3681
+ };
3682
+ Update: {
3683
+ created_at?: string | null;
3684
+ id?: string;
3685
+ shop_id?: string | null;
3686
+ source?: string | null;
3687
+ subject_id?: string;
3688
+ user_id?: string | null;
3689
+ vote_type?: string;
3690
+ };
3691
+ Relationships: [
3692
+ {
3693
+ foreignKeyName: "votes_shop_id_fkey";
3694
+ columns: ["shop_id"];
3695
+ isOneToOne: false;
3696
+ referencedRelation: "shop_stats";
3697
+ referencedColumns: ["id"];
3698
+ },
3699
+ {
3700
+ foreignKeyName: "votes_shop_id_fkey";
3701
+ columns: ["shop_id"];
3702
+ isOneToOne: false;
3703
+ referencedRelation: "shops";
3704
+ referencedColumns: ["id"];
3705
+ },
3706
+ {
3707
+ foreignKeyName: "votes_user_id_fkey";
3708
+ columns: ["user_id"];
3709
+ isOneToOne: false;
3710
+ referencedRelation: "leaderboard";
3711
+ referencedColumns: ["id"];
3712
+ },
3713
+ {
3714
+ foreignKeyName: "votes_user_id_fkey";
3715
+ columns: ["user_id"];
3716
+ isOneToOne: false;
3717
+ referencedRelation: "user_activity_summary";
3718
+ referencedColumns: ["id"];
3719
+ },
3720
+ {
3721
+ foreignKeyName: "votes_user_id_fkey";
3722
+ columns: ["user_id"];
3723
+ isOneToOne: false;
3724
+ referencedRelation: "users";
3725
+ referencedColumns: ["id"];
3726
+ }
3727
+ ];
3728
+ };
3729
+ vouchers: {
3730
+ Row: {
3731
+ claim_token: string | null;
3732
+ claim_token_expires_at: string | null;
3733
+ claimed_at: string | null;
3734
+ claimed_by: string | null;
3735
+ created_at: string | null;
3736
+ id: string;
3737
+ is_open_voucher: boolean | null;
3738
+ message: string | null;
3739
+ platform_reward: Json | null;
3740
+ redeemed: boolean | null;
3741
+ reward_description: string | null;
3742
+ reward_type: string | null;
3743
+ source: Json | null;
3744
+ user_id: string | null;
3745
+ valid: boolean | null;
3746
+ voucher_type: string | null;
3747
+ };
3748
+ Insert: {
3749
+ claim_token?: string | null;
3750
+ claim_token_expires_at?: string | null;
3751
+ claimed_at?: string | null;
3752
+ claimed_by?: string | null;
3753
+ created_at?: string | null;
3754
+ id: string;
3755
+ is_open_voucher?: boolean | null;
3756
+ message?: string | null;
3757
+ platform_reward?: Json | null;
3758
+ redeemed?: boolean | null;
3759
+ reward_description?: string | null;
3760
+ reward_type?: string | null;
3761
+ source?: Json | null;
3762
+ user_id?: string | null;
3763
+ valid?: boolean | null;
3764
+ voucher_type?: string | null;
3765
+ };
3766
+ Update: {
3767
+ claim_token?: string | null;
3768
+ claim_token_expires_at?: string | null;
3769
+ claimed_at?: string | null;
3770
+ claimed_by?: string | null;
3771
+ created_at?: string | null;
3772
+ id?: string;
3773
+ is_open_voucher?: boolean | null;
3774
+ message?: string | null;
3775
+ platform_reward?: Json | null;
3776
+ redeemed?: boolean | null;
3777
+ reward_description?: string | null;
3778
+ reward_type?: string | null;
3779
+ source?: Json | null;
3780
+ user_id?: string | null;
3781
+ valid?: boolean | null;
3782
+ voucher_type?: string | null;
3783
+ };
3784
+ Relationships: [
3785
+ {
3786
+ foreignKeyName: "vouchers_user_id_fkey";
3787
+ columns: ["user_id"];
3788
+ isOneToOne: false;
3789
+ referencedRelation: "leaderboard";
3790
+ referencedColumns: ["id"];
3791
+ },
3792
+ {
3793
+ foreignKeyName: "vouchers_user_id_fkey";
3794
+ columns: ["user_id"];
3795
+ isOneToOne: false;
3796
+ referencedRelation: "user_activity_summary";
3797
+ referencedColumns: ["id"];
3798
+ },
3799
+ {
3800
+ foreignKeyName: "vouchers_user_id_fkey";
3801
+ columns: ["user_id"];
3802
+ isOneToOne: false;
3803
+ referencedRelation: "users";
3804
+ referencedColumns: ["id"];
3805
+ }
3806
+ ];
3807
+ };
3808
+ };
3809
+ Views: {
3810
+ leaderboard: {
3811
+ Row: {
3812
+ display_name: string | null;
3813
+ id: string | null;
3814
+ profile_image: string | null;
3815
+ rank: number | null;
3816
+ total_points: number | null;
3817
+ total_reviews: number | null;
3818
+ total_shots: number | null;
3819
+ username: string | null;
3820
+ };
3821
+ Relationships: [];
3822
+ };
3823
+ shop_stats: {
3824
+ Row: {
3825
+ avg_craft_rating: number | null;
3826
+ favourite_count: number | null;
3827
+ follower_count: number | null;
3828
+ id: string | null;
3829
+ name: string | null;
3830
+ review_count: number | null;
3831
+ shot_count: number | null;
3832
+ };
3833
+ Relationships: [];
3834
+ };
3835
+ user_activity_summary: {
3836
+ Row: {
3837
+ follower_count: number | null;
3838
+ following_count: number | null;
3839
+ id: string | null;
3840
+ review_count: number | null;
3841
+ shot_count: number | null;
3842
+ stamp_count: number | null;
3843
+ total_points: number | null;
3844
+ username: string | null;
3845
+ };
3846
+ Relationships: [];
3847
+ };
3848
+ };
3849
+ Functions: {
3850
+ [_ in never]: never;
3851
+ };
3852
+ Enums: {
3853
+ [_ in never]: never;
3854
+ };
3855
+ CompositeTypes: {
3856
+ [_ in never]: never;
3857
+ };
3858
+ };
3859
+ };
3860
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
3861
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
3862
+ export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
3863
+ schema: keyof DatabaseWithoutInternals;
3864
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
3865
+ schema: keyof DatabaseWithoutInternals;
3866
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
3867
+ schema: keyof DatabaseWithoutInternals;
3868
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
3869
+ Row: infer R;
3870
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
3871
+ Row: infer R;
3872
+ } ? R : never : never;
3873
+ export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
3874
+ schema: keyof DatabaseWithoutInternals;
3875
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
3876
+ schema: keyof DatabaseWithoutInternals;
3877
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
3878
+ schema: keyof DatabaseWithoutInternals;
3879
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
3880
+ Insert: infer I;
3881
+ } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
3882
+ Insert: infer I;
3883
+ } ? I : never : never;
3884
+ export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] | {
3885
+ schema: keyof DatabaseWithoutInternals;
3886
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
3887
+ schema: keyof DatabaseWithoutInternals;
3888
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] : never = never> = DefaultSchemaTableNameOrOptions extends {
3889
+ schema: keyof DatabaseWithoutInternals;
3890
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
3891
+ Update: infer U;
3892
+ } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
3893
+ Update: infer U;
3894
+ } ? U : never : never;
3895
+ export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] | {
3896
+ schema: keyof DatabaseWithoutInternals;
3897
+ }, EnumName extends DefaultSchemaEnumNameOrOptions extends {
3898
+ schema: keyof DatabaseWithoutInternals;
3899
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] : never = never> = DefaultSchemaEnumNameOrOptions extends {
3900
+ schema: keyof DatabaseWithoutInternals;
3901
+ } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] : never;
3902
+ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] | {
3903
+ schema: keyof DatabaseWithoutInternals;
3904
+ }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
3905
+ schema: keyof DatabaseWithoutInternals;
3906
+ } ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
3907
+ schema: keyof DatabaseWithoutInternals;
3908
+ } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
3909
+ export declare const Constants: {
3910
+ readonly public: {
3911
+ readonly Enums: {};
3912
+ };
3913
+ };
3914
+ export {};