@rjromeoent/ein-supabase 0.1.6 → 0.1.8

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.
@@ -15650,7 +15650,27 @@ export type Database = {
15650
15650
  };
15651
15651
  public: {
15652
15652
  Tables: {
15653
- [_ in never]: never;
15653
+ rls_debug_log: {
15654
+ Row: {
15655
+ id: number;
15656
+ message: string | null;
15657
+ payload: Json | null;
15658
+ ts: string | null;
15659
+ };
15660
+ Insert: {
15661
+ id?: number;
15662
+ message?: string | null;
15663
+ payload?: Json | null;
15664
+ ts?: string | null;
15665
+ };
15666
+ Update: {
15667
+ id?: number;
15668
+ message?: string | null;
15669
+ payload?: Json | null;
15670
+ ts?: string | null;
15671
+ };
15672
+ Relationships: [];
15673
+ };
15654
15674
  };
15655
15675
  Views: {
15656
15676
  [_ in never]: never;
@@ -16768,345 +16788,554 @@ export type Database = {
16768
16788
  }
16769
16789
  ];
16770
16790
  };
16771
- decision_log: {
16791
+ dashboard_search_overlay_warming_targets: {
16772
16792
  Row: {
16773
- artist_id: string;
16774
- assignment_id: string;
16793
+ batch_limit: number;
16794
+ center_city: string;
16795
+ center_city_key: string;
16775
16796
  created_at: string;
16776
- decision_actor_type: Database["rad"]["Enums"]["decision_actor_type"];
16777
- decision_actor_user_id: string | null;
16778
- decision_scope: string;
16779
- decision_type: Database["rad"]["Enums"]["decision_type"];
16780
- demand_context: Json;
16781
- event_edition_id: string;
16797
+ date_window_days: number;
16782
16798
  id: string;
16783
- idempotency_key: string | null;
16784
- metadata_json: Json;
16799
+ is_active: boolean;
16800
+ last_result: Json;
16801
+ last_run_at: string | null;
16802
+ last_status: string | null;
16803
+ max_batches_per_run: number;
16785
16804
  organization_id: string;
16786
- rationale: string | null;
16787
- recommendation_run_id: string | null;
16788
- source_surface: string;
16789
- tracked_artist_id: string;
16805
+ priority: number;
16806
+ radius_miles: number;
16807
+ updated_at: string;
16790
16808
  };
16791
16809
  Insert: {
16792
- artist_id: string;
16793
- assignment_id: string;
16810
+ batch_limit?: number;
16811
+ center_city: string;
16812
+ center_city_key: string;
16794
16813
  created_at?: string;
16795
- decision_actor_type?: Database["rad"]["Enums"]["decision_actor_type"];
16796
- decision_actor_user_id?: string | null;
16797
- decision_scope?: string;
16798
- decision_type: Database["rad"]["Enums"]["decision_type"];
16799
- demand_context?: Json;
16800
- event_edition_id: string;
16814
+ date_window_days?: number;
16801
16815
  id?: string;
16802
- idempotency_key?: string | null;
16803
- metadata_json?: Json;
16816
+ is_active?: boolean;
16817
+ last_result?: Json;
16818
+ last_run_at?: string | null;
16819
+ last_status?: string | null;
16820
+ max_batches_per_run?: number;
16804
16821
  organization_id: string;
16805
- rationale?: string | null;
16806
- recommendation_run_id?: string | null;
16807
- source_surface?: string;
16808
- tracked_artist_id: string;
16822
+ priority?: number;
16823
+ radius_miles?: number;
16824
+ updated_at?: string;
16809
16825
  };
16810
16826
  Update: {
16811
- artist_id?: string;
16812
- assignment_id?: string;
16827
+ batch_limit?: number;
16828
+ center_city?: string;
16829
+ center_city_key?: string;
16813
16830
  created_at?: string;
16814
- decision_actor_type?: Database["rad"]["Enums"]["decision_actor_type"];
16815
- decision_actor_user_id?: string | null;
16816
- decision_scope?: string;
16817
- decision_type?: Database["rad"]["Enums"]["decision_type"];
16818
- demand_context?: Json;
16819
- event_edition_id?: string;
16831
+ date_window_days?: number;
16820
16832
  id?: string;
16821
- idempotency_key?: string | null;
16822
- metadata_json?: Json;
16833
+ is_active?: boolean;
16834
+ last_result?: Json;
16835
+ last_run_at?: string | null;
16836
+ last_status?: string | null;
16837
+ max_batches_per_run?: number;
16823
16838
  organization_id?: string;
16824
- rationale?: string | null;
16825
- recommendation_run_id?: string | null;
16826
- source_surface?: string;
16827
- tracked_artist_id?: string;
16839
+ priority?: number;
16840
+ radius_miles?: number;
16841
+ updated_at?: string;
16828
16842
  };
16829
16843
  Relationships: [
16830
16844
  {
16831
- foreignKeyName: "decision_log_assignment_id_fkey";
16832
- columns: ["assignment_id"];
16845
+ foreignKeyName: "dashboard_search_overlay_warming_targets_organization_id_fkey";
16846
+ columns: ["organization_id"];
16833
16847
  isOneToOne: false;
16834
- referencedRelation: "assignment_decision_projection";
16835
- referencedColumns: ["assignment_id"];
16848
+ referencedRelation: "dashboard_health_view";
16849
+ referencedColumns: ["organization_id"];
16836
16850
  },
16837
16851
  {
16838
- foreignKeyName: "decision_log_assignment_id_fkey";
16839
- columns: ["assignment_id"];
16852
+ foreignKeyName: "dashboard_search_overlay_warming_targets_organization_id_fkey";
16853
+ columns: ["organization_id"];
16840
16854
  isOneToOne: false;
16841
- referencedRelation: "event_artist_assignments";
16842
- referencedColumns: ["id"];
16843
- },
16855
+ referencedRelation: "system_health_overview";
16856
+ referencedColumns: ["organization_id"];
16857
+ }
16858
+ ];
16859
+ };
16860
+ dashboard_search_overlays: {
16861
+ Row: {
16862
+ availability_window_id: string;
16863
+ available_with_routing_match: boolean;
16864
+ center_city_key: string;
16865
+ computed_at: string;
16866
+ has_market_conflict: boolean;
16867
+ has_nearby_interest: boolean;
16868
+ interest_from: string;
16869
+ interest_to: string;
16870
+ is_routed: boolean;
16871
+ market_conflicts: Json;
16872
+ nearby_interest: Json;
16873
+ organization_id: string;
16874
+ radius_conflict: boolean;
16875
+ radius_conflicts: Json;
16876
+ radius_miles: number;
16877
+ routing_shows: Json;
16878
+ same_day_interest: Json;
16879
+ source_window_hash: string | null;
16880
+ };
16881
+ Insert: {
16882
+ availability_window_id: string;
16883
+ available_with_routing_match?: boolean;
16884
+ center_city_key: string;
16885
+ computed_at?: string;
16886
+ has_market_conflict?: boolean;
16887
+ has_nearby_interest?: boolean;
16888
+ interest_from: string;
16889
+ interest_to: string;
16890
+ is_routed?: boolean;
16891
+ market_conflicts?: Json;
16892
+ nearby_interest?: Json;
16893
+ organization_id: string;
16894
+ radius_conflict?: boolean;
16895
+ radius_conflicts?: Json;
16896
+ radius_miles: number;
16897
+ routing_shows?: Json;
16898
+ same_day_interest?: Json;
16899
+ source_window_hash?: string | null;
16900
+ };
16901
+ Update: {
16902
+ availability_window_id?: string;
16903
+ available_with_routing_match?: boolean;
16904
+ center_city_key?: string;
16905
+ computed_at?: string;
16906
+ has_market_conflict?: boolean;
16907
+ has_nearby_interest?: boolean;
16908
+ interest_from?: string;
16909
+ interest_to?: string;
16910
+ is_routed?: boolean;
16911
+ market_conflicts?: Json;
16912
+ nearby_interest?: Json;
16913
+ organization_id?: string;
16914
+ radius_conflict?: boolean;
16915
+ radius_conflicts?: Json;
16916
+ radius_miles?: number;
16917
+ routing_shows?: Json;
16918
+ same_day_interest?: Json;
16919
+ source_window_hash?: string | null;
16920
+ };
16921
+ Relationships: [
16844
16922
  {
16845
- foreignKeyName: "decision_log_assignment_id_fkey";
16846
- columns: ["assignment_id"];
16923
+ foreignKeyName: "dashboard_search_overlays_availability_window_id_fkey";
16924
+ columns: ["availability_window_id"];
16847
16925
  isOneToOne: false;
16848
- referencedRelation: "event_edition_avail_assignments";
16926
+ referencedRelation: "artist_availability_windows";
16849
16927
  referencedColumns: ["id"];
16850
16928
  },
16851
16929
  {
16852
- foreignKeyName: "decision_log_assignment_id_fkey";
16853
- columns: ["assignment_id"];
16930
+ foreignKeyName: "dashboard_search_overlays_availability_window_id_fkey";
16931
+ columns: ["availability_window_id"];
16854
16932
  isOneToOne: false;
16855
- referencedRelation: "event_edition_candidate_set";
16856
- referencedColumns: ["assignment_id"];
16933
+ referencedRelation: "availability_search_base";
16934
+ referencedColumns: ["id"];
16857
16935
  },
16858
16936
  {
16859
- foreignKeyName: "decision_log_assignment_id_fkey";
16860
- columns: ["assignment_id"];
16937
+ foreignKeyName: "dashboard_search_overlays_availability_window_id_fkey";
16938
+ columns: ["availability_window_id"];
16861
16939
  isOneToOne: false;
16862
16940
  referencedRelation: "event_edition_live_grid";
16863
- referencedColumns: ["assignment_id"];
16941
+ referencedColumns: ["live_availability_window_id"];
16864
16942
  },
16865
16943
  {
16866
- foreignKeyName: "decision_log_organization_id_fkey";
16944
+ foreignKeyName: "dashboard_search_overlays_organization_id_fkey";
16867
16945
  columns: ["organization_id"];
16868
16946
  isOneToOne: false;
16869
16947
  referencedRelation: "dashboard_health_view";
16870
16948
  referencedColumns: ["organization_id"];
16871
16949
  },
16872
16950
  {
16873
- foreignKeyName: "decision_log_organization_id_fkey";
16951
+ foreignKeyName: "dashboard_search_overlays_organization_id_fkey";
16874
16952
  columns: ["organization_id"];
16875
16953
  isOneToOne: false;
16876
16954
  referencedRelation: "system_health_overview";
16877
16955
  referencedColumns: ["organization_id"];
16878
- },
16879
- {
16880
- foreignKeyName: "decision_log_tracked_artist_id_fkey";
16881
- columns: ["tracked_artist_id"];
16882
- isOneToOne: false;
16883
- referencedRelation: "artist_detail_view";
16884
- referencedColumns: ["tracked_artist_id"];
16885
- },
16886
- {
16887
- foreignKeyName: "decision_log_tracked_artist_id_fkey";
16888
- columns: ["tracked_artist_id"];
16889
- isOneToOne: false;
16890
- referencedRelation: "artist_freshness_view";
16891
- referencedColumns: ["tracked_artist_id"];
16892
- },
16893
- {
16894
- foreignKeyName: "decision_log_tracked_artist_id_fkey";
16895
- columns: ["tracked_artist_id"];
16896
- isOneToOne: false;
16897
- referencedRelation: "tracked_artists";
16898
- referencedColumns: ["id"];
16899
16956
  }
16900
16957
  ];
16901
16958
  };
16902
- duplicate_avails_cleanup_state: {
16959
+ dashboard_search_refresh_queue: {
16903
16960
  Row: {
16904
- completed_at: string | null;
16905
- created_at: string;
16906
- current_artist_name: string | null;
16907
- current_group_index: number | null;
16908
- duplicates_found: number;
16909
- duplicates_resolved: number;
16910
- heartbeat_at: string | null;
16961
+ attempts: number;
16962
+ availability_window_id: string;
16963
+ error_message: string | null;
16911
16964
  id: string;
16912
- is_processing: boolean;
16913
- last_error: string | null;
16914
- last_run_trigger: string | null;
16965
+ last_attempt_at: string | null;
16915
16966
  metadata: Json;
16916
16967
  organization_id: string;
16917
- records_deleted: number;
16918
- started_at: string | null;
16919
- total_groups: number | null;
16920
- updated_at: string;
16968
+ processed_at: string | null;
16969
+ queued_at: string;
16970
+ reason: string;
16971
+ source_row_id: string | null;
16972
+ source_table: string | null;
16921
16973
  };
16922
16974
  Insert: {
16923
- completed_at?: string | null;
16924
- created_at?: string;
16925
- current_artist_name?: string | null;
16926
- current_group_index?: number | null;
16927
- duplicates_found?: number;
16928
- duplicates_resolved?: number;
16929
- heartbeat_at?: string | null;
16975
+ attempts?: number;
16976
+ availability_window_id: string;
16977
+ error_message?: string | null;
16930
16978
  id?: string;
16931
- is_processing?: boolean;
16932
- last_error?: string | null;
16933
- last_run_trigger?: string | null;
16979
+ last_attempt_at?: string | null;
16934
16980
  metadata?: Json;
16935
16981
  organization_id: string;
16936
- records_deleted?: number;
16937
- started_at?: string | null;
16938
- total_groups?: number | null;
16939
- updated_at?: string;
16982
+ processed_at?: string | null;
16983
+ queued_at?: string;
16984
+ reason: string;
16985
+ source_row_id?: string | null;
16986
+ source_table?: string | null;
16940
16987
  };
16941
16988
  Update: {
16942
- completed_at?: string | null;
16943
- created_at?: string;
16944
- current_artist_name?: string | null;
16945
- current_group_index?: number | null;
16946
- duplicates_found?: number;
16947
- duplicates_resolved?: number;
16948
- heartbeat_at?: string | null;
16989
+ attempts?: number;
16990
+ availability_window_id?: string;
16991
+ error_message?: string | null;
16949
16992
  id?: string;
16950
- is_processing?: boolean;
16951
- last_error?: string | null;
16952
- last_run_trigger?: string | null;
16993
+ last_attempt_at?: string | null;
16953
16994
  metadata?: Json;
16954
16995
  organization_id?: string;
16955
- records_deleted?: number;
16956
- started_at?: string | null;
16957
- total_groups?: number | null;
16958
- updated_at?: string;
16996
+ processed_at?: string | null;
16997
+ queued_at?: string;
16998
+ reason?: string;
16999
+ source_row_id?: string | null;
17000
+ source_table?: string | null;
16959
17001
  };
16960
17002
  Relationships: [
16961
17003
  {
16962
- foreignKeyName: "duplicate_avails_cleanup_state_organization_id_fkey";
17004
+ foreignKeyName: "dashboard_search_refresh_queue_availability_window_id_fkey";
17005
+ columns: ["availability_window_id"];
17006
+ isOneToOne: false;
17007
+ referencedRelation: "artist_availability_windows";
17008
+ referencedColumns: ["id"];
17009
+ },
17010
+ {
17011
+ foreignKeyName: "dashboard_search_refresh_queue_availability_window_id_fkey";
17012
+ columns: ["availability_window_id"];
17013
+ isOneToOne: false;
17014
+ referencedRelation: "availability_search_base";
17015
+ referencedColumns: ["id"];
17016
+ },
17017
+ {
17018
+ foreignKeyName: "dashboard_search_refresh_queue_availability_window_id_fkey";
17019
+ columns: ["availability_window_id"];
17020
+ isOneToOne: false;
17021
+ referencedRelation: "event_edition_live_grid";
17022
+ referencedColumns: ["live_availability_window_id"];
17023
+ },
17024
+ {
17025
+ foreignKeyName: "dashboard_search_refresh_queue_organization_id_fkey";
16963
17026
  columns: ["organization_id"];
16964
- isOneToOne: true;
17027
+ isOneToOne: false;
16965
17028
  referencedRelation: "dashboard_health_view";
16966
17029
  referencedColumns: ["organization_id"];
16967
17030
  },
16968
17031
  {
16969
- foreignKeyName: "duplicate_avails_cleanup_state_organization_id_fkey";
17032
+ foreignKeyName: "dashboard_search_refresh_queue_organization_id_fkey";
16970
17033
  columns: ["organization_id"];
16971
- isOneToOne: true;
17034
+ isOneToOne: false;
16972
17035
  referencedRelation: "system_health_overview";
16973
17036
  referencedColumns: ["organization_id"];
16974
17037
  }
16975
17038
  ];
16976
17039
  };
16977
- event_artist_assignments: {
17040
+ dashboard_search_refresh_runs: {
16978
17041
  Row: {
16979
- artist_id: string;
16980
- assigned_at: string;
16981
- assigned_by_user_id: string | null;
16982
- assignment_state: Database["rad"]["Enums"]["assignment_state"];
16983
- assignment_status: Database["rad"]["Enums"]["assignment_status"];
16984
- availability_window_id: string | null;
16985
- billing_tier_target: string | null;
16986
- buyer_note: string | null;
16987
- created_at: string;
16988
- decision_metadata: Json;
16989
- event_edition_id: string;
17042
+ error_message: string | null;
17043
+ finished_at: string | null;
16990
17044
  id: string;
16991
- last_decision_log_id: string | null;
16992
- last_verified_at: string | null;
16993
17045
  metadata: Json;
16994
- organization_id: string;
16995
- rank_order: number | null;
16996
- recommendation_run_id: string | null;
16997
- tracked_artist_id: string;
16998
- updated_at: string;
17046
+ organization_id: string | null;
17047
+ refresh_scope: string;
17048
+ refresh_status: string;
17049
+ rows_deleted: number;
17050
+ rows_upserted: number;
17051
+ started_at: string;
16999
17052
  };
17000
17053
  Insert: {
17001
- artist_id: string;
17002
- assigned_at?: string;
17003
- assigned_by_user_id?: string | null;
17004
- assignment_state?: Database["rad"]["Enums"]["assignment_state"];
17005
- assignment_status?: Database["rad"]["Enums"]["assignment_status"];
17006
- availability_window_id?: string | null;
17007
- billing_tier_target?: string | null;
17008
- buyer_note?: string | null;
17009
- created_at?: string;
17010
- decision_metadata?: Json;
17011
- event_edition_id: string;
17054
+ error_message?: string | null;
17055
+ finished_at?: string | null;
17012
17056
  id?: string;
17013
- last_decision_log_id?: string | null;
17014
- last_verified_at?: string | null;
17015
17057
  metadata?: Json;
17016
- organization_id: string;
17017
- rank_order?: number | null;
17018
- recommendation_run_id?: string | null;
17019
- tracked_artist_id: string;
17020
- updated_at?: string;
17058
+ organization_id?: string | null;
17059
+ refresh_scope: string;
17060
+ refresh_status?: string;
17061
+ rows_deleted?: number;
17062
+ rows_upserted?: number;
17063
+ started_at?: string;
17021
17064
  };
17022
17065
  Update: {
17023
- artist_id?: string;
17024
- assigned_at?: string;
17025
- assigned_by_user_id?: string | null;
17026
- assignment_state?: Database["rad"]["Enums"]["assignment_state"];
17027
- assignment_status?: Database["rad"]["Enums"]["assignment_status"];
17028
- availability_window_id?: string | null;
17029
- billing_tier_target?: string | null;
17030
- buyer_note?: string | null;
17031
- created_at?: string;
17032
- decision_metadata?: Json;
17033
- event_edition_id?: string;
17066
+ error_message?: string | null;
17067
+ finished_at?: string | null;
17034
17068
  id?: string;
17035
- last_decision_log_id?: string | null;
17036
- last_verified_at?: string | null;
17037
17069
  metadata?: Json;
17038
- organization_id?: string;
17039
- rank_order?: number | null;
17040
- recommendation_run_id?: string | null;
17041
- tracked_artist_id?: string;
17042
- updated_at?: string;
17070
+ organization_id?: string | null;
17071
+ refresh_scope?: string;
17072
+ refresh_status?: string;
17073
+ rows_deleted?: number;
17074
+ rows_upserted?: number;
17075
+ started_at?: string;
17043
17076
  };
17044
17077
  Relationships: [
17045
17078
  {
17046
- foreignKeyName: "event_artist_assignments_last_decision_log_id_fkey";
17047
- columns: ["last_decision_log_id"];
17079
+ foreignKeyName: "dashboard_search_refresh_runs_organization_id_fkey";
17080
+ columns: ["organization_id"];
17048
17081
  isOneToOne: false;
17049
- referencedRelation: "assignment_decision_projection";
17050
- referencedColumns: ["latest_decision_id"];
17082
+ referencedRelation: "dashboard_health_view";
17083
+ referencedColumns: ["organization_id"];
17051
17084
  },
17052
17085
  {
17053
- foreignKeyName: "event_artist_assignments_last_decision_log_id_fkey";
17054
- columns: ["last_decision_log_id"];
17086
+ foreignKeyName: "dashboard_search_refresh_runs_organization_id_fkey";
17087
+ columns: ["organization_id"];
17055
17088
  isOneToOne: false;
17056
- referencedRelation: "decision_log";
17057
- referencedColumns: ["id"];
17058
- },
17089
+ referencedRelation: "system_health_overview";
17090
+ referencedColumns: ["organization_id"];
17091
+ }
17092
+ ];
17093
+ };
17094
+ dashboard_search_windows: {
17095
+ Row: {
17096
+ agency: string | null;
17097
+ agency_lc: string | null;
17098
+ analytics_activity_score: number | null;
17099
+ analytics_activity_tier: string | null;
17100
+ analytics_artist_rank: number | null;
17101
+ analytics_chartmetric_id: string | null;
17102
+ analytics_instagram_engagement: number | null;
17103
+ analytics_instagram_followers: number | null;
17104
+ analytics_last_updated_at: string | null;
17105
+ analytics_next_update_due: string | null;
17106
+ analytics_spotify_followers: number | null;
17107
+ analytics_spotify_monthly_listeners: number | null;
17108
+ analytics_tiktok_engagement: number | null;
17109
+ analytics_tiktok_followers: number | null;
17110
+ analytics_tiktok_track_posts: number | null;
17111
+ analytics_total_fanbase: number | null;
17112
+ artist_id: string;
17113
+ artist_name: string;
17114
+ artist_name_lc: string;
17115
+ artist_normalized_name: string | null;
17116
+ artist_normalized_name_lc: string | null;
17117
+ assignment_count: number;
17118
+ availability_window_id: string;
17119
+ confidence: number | null;
17120
+ data_freshness_days: number | null;
17121
+ effective_date: string;
17122
+ effective_status: string;
17123
+ financials_total_shows: number | null;
17124
+ genre: string | null;
17125
+ genre_lc: string | null;
17126
+ has_assignment: boolean;
17127
+ inferred_at: string | null;
17128
+ interest_source: string | null;
17129
+ is_active: boolean;
17130
+ is_inferred: boolean;
17131
+ latest_assigned_at: string | null;
17132
+ latest_assignment_state: string | null;
17133
+ market_city: string | null;
17134
+ market_city_lc: string | null;
17135
+ market_id: string | null;
17136
+ market_name: string | null;
17137
+ market_name_lc: string | null;
17138
+ market_state: string | null;
17139
+ momentum: string | null;
17140
+ organization_id: string;
17141
+ primary_source: string | null;
17142
+ quote_avg_gross: number | null;
17143
+ quote_avg_guarantee: number | null;
17144
+ quote_avg_tickets_sold: number | null;
17145
+ quote_high: number | null;
17146
+ quote_low: number | null;
17147
+ read_model_hash: string;
17148
+ read_model_refreshed_at: string;
17149
+ reg_last_mod_date: string | null;
17150
+ source_updated_at: string | null;
17151
+ status_display: string;
17152
+ tracked_artist_id: string;
17153
+ venue_capacity: number | null;
17154
+ venue_id: string | null;
17155
+ venue_name: string | null;
17156
+ venue_name_lc: string | null;
17157
+ venue_type: string | null;
17158
+ };
17159
+ Insert: {
17160
+ agency?: string | null;
17161
+ agency_lc?: string | null;
17162
+ analytics_activity_score?: number | null;
17163
+ analytics_activity_tier?: string | null;
17164
+ analytics_artist_rank?: number | null;
17165
+ analytics_chartmetric_id?: string | null;
17166
+ analytics_instagram_engagement?: number | null;
17167
+ analytics_instagram_followers?: number | null;
17168
+ analytics_last_updated_at?: string | null;
17169
+ analytics_next_update_due?: string | null;
17170
+ analytics_spotify_followers?: number | null;
17171
+ analytics_spotify_monthly_listeners?: number | null;
17172
+ analytics_tiktok_engagement?: number | null;
17173
+ analytics_tiktok_followers?: number | null;
17174
+ analytics_tiktok_track_posts?: number | null;
17175
+ analytics_total_fanbase?: number | null;
17176
+ artist_id: string;
17177
+ artist_name: string;
17178
+ artist_name_lc: string;
17179
+ artist_normalized_name?: string | null;
17180
+ artist_normalized_name_lc?: string | null;
17181
+ assignment_count?: number;
17182
+ availability_window_id: string;
17183
+ confidence?: number | null;
17184
+ data_freshness_days?: number | null;
17185
+ effective_date: string;
17186
+ effective_status: string;
17187
+ financials_total_shows?: number | null;
17188
+ genre?: string | null;
17189
+ genre_lc?: string | null;
17190
+ has_assignment?: boolean;
17191
+ inferred_at?: string | null;
17192
+ interest_source?: string | null;
17193
+ is_active?: boolean;
17194
+ is_inferred?: boolean;
17195
+ latest_assigned_at?: string | null;
17196
+ latest_assignment_state?: string | null;
17197
+ market_city?: string | null;
17198
+ market_city_lc?: string | null;
17199
+ market_id?: string | null;
17200
+ market_name?: string | null;
17201
+ market_name_lc?: string | null;
17202
+ market_state?: string | null;
17203
+ momentum?: string | null;
17204
+ organization_id: string;
17205
+ primary_source?: string | null;
17206
+ quote_avg_gross?: number | null;
17207
+ quote_avg_guarantee?: number | null;
17208
+ quote_avg_tickets_sold?: number | null;
17209
+ quote_high?: number | null;
17210
+ quote_low?: number | null;
17211
+ read_model_hash: string;
17212
+ read_model_refreshed_at?: string;
17213
+ reg_last_mod_date?: string | null;
17214
+ source_updated_at?: string | null;
17215
+ status_display: string;
17216
+ tracked_artist_id: string;
17217
+ venue_capacity?: number | null;
17218
+ venue_id?: string | null;
17219
+ venue_name?: string | null;
17220
+ venue_name_lc?: string | null;
17221
+ venue_type?: string | null;
17222
+ };
17223
+ Update: {
17224
+ agency?: string | null;
17225
+ agency_lc?: string | null;
17226
+ analytics_activity_score?: number | null;
17227
+ analytics_activity_tier?: string | null;
17228
+ analytics_artist_rank?: number | null;
17229
+ analytics_chartmetric_id?: string | null;
17230
+ analytics_instagram_engagement?: number | null;
17231
+ analytics_instagram_followers?: number | null;
17232
+ analytics_last_updated_at?: string | null;
17233
+ analytics_next_update_due?: string | null;
17234
+ analytics_spotify_followers?: number | null;
17235
+ analytics_spotify_monthly_listeners?: number | null;
17236
+ analytics_tiktok_engagement?: number | null;
17237
+ analytics_tiktok_followers?: number | null;
17238
+ analytics_tiktok_track_posts?: number | null;
17239
+ analytics_total_fanbase?: number | null;
17240
+ artist_id?: string;
17241
+ artist_name?: string;
17242
+ artist_name_lc?: string;
17243
+ artist_normalized_name?: string | null;
17244
+ artist_normalized_name_lc?: string | null;
17245
+ assignment_count?: number;
17246
+ availability_window_id?: string;
17247
+ confidence?: number | null;
17248
+ data_freshness_days?: number | null;
17249
+ effective_date?: string;
17250
+ effective_status?: string;
17251
+ financials_total_shows?: number | null;
17252
+ genre?: string | null;
17253
+ genre_lc?: string | null;
17254
+ has_assignment?: boolean;
17255
+ inferred_at?: string | null;
17256
+ interest_source?: string | null;
17257
+ is_active?: boolean;
17258
+ is_inferred?: boolean;
17259
+ latest_assigned_at?: string | null;
17260
+ latest_assignment_state?: string | null;
17261
+ market_city?: string | null;
17262
+ market_city_lc?: string | null;
17263
+ market_id?: string | null;
17264
+ market_name?: string | null;
17265
+ market_name_lc?: string | null;
17266
+ market_state?: string | null;
17267
+ momentum?: string | null;
17268
+ organization_id?: string;
17269
+ primary_source?: string | null;
17270
+ quote_avg_gross?: number | null;
17271
+ quote_avg_guarantee?: number | null;
17272
+ quote_avg_tickets_sold?: number | null;
17273
+ quote_high?: number | null;
17274
+ quote_low?: number | null;
17275
+ read_model_hash?: string;
17276
+ read_model_refreshed_at?: string;
17277
+ reg_last_mod_date?: string | null;
17278
+ source_updated_at?: string | null;
17279
+ status_display?: string;
17280
+ tracked_artist_id?: string;
17281
+ venue_capacity?: number | null;
17282
+ venue_id?: string | null;
17283
+ venue_name?: string | null;
17284
+ venue_name_lc?: string | null;
17285
+ venue_type?: string | null;
17286
+ };
17287
+ Relationships: [
17059
17288
  {
17060
- foreignKeyName: "event_edition_avail_assignments_availability_window_id_fkey";
17289
+ foreignKeyName: "dashboard_search_windows_availability_window_id_fkey";
17061
17290
  columns: ["availability_window_id"];
17062
- isOneToOne: false;
17291
+ isOneToOne: true;
17063
17292
  referencedRelation: "artist_availability_windows";
17064
17293
  referencedColumns: ["id"];
17065
17294
  },
17066
17295
  {
17067
- foreignKeyName: "event_edition_avail_assignments_availability_window_id_fkey";
17296
+ foreignKeyName: "dashboard_search_windows_availability_window_id_fkey";
17068
17297
  columns: ["availability_window_id"];
17069
- isOneToOne: false;
17298
+ isOneToOne: true;
17070
17299
  referencedRelation: "availability_search_base";
17071
17300
  referencedColumns: ["id"];
17072
17301
  },
17073
17302
  {
17074
- foreignKeyName: "event_edition_avail_assignments_availability_window_id_fkey";
17303
+ foreignKeyName: "dashboard_search_windows_availability_window_id_fkey";
17075
17304
  columns: ["availability_window_id"];
17076
- isOneToOne: false;
17305
+ isOneToOne: true;
17077
17306
  referencedRelation: "event_edition_live_grid";
17078
17307
  referencedColumns: ["live_availability_window_id"];
17079
17308
  },
17080
17309
  {
17081
- foreignKeyName: "event_edition_avail_assignments_organization_id_fkey";
17310
+ foreignKeyName: "dashboard_search_windows_organization_id_fkey";
17082
17311
  columns: ["organization_id"];
17083
17312
  isOneToOne: false;
17084
17313
  referencedRelation: "dashboard_health_view";
17085
17314
  referencedColumns: ["organization_id"];
17086
17315
  },
17087
17316
  {
17088
- foreignKeyName: "event_edition_avail_assignments_organization_id_fkey";
17317
+ foreignKeyName: "dashboard_search_windows_organization_id_fkey";
17089
17318
  columns: ["organization_id"];
17090
17319
  isOneToOne: false;
17091
17320
  referencedRelation: "system_health_overview";
17092
17321
  referencedColumns: ["organization_id"];
17093
17322
  },
17094
17323
  {
17095
- foreignKeyName: "event_edition_avail_assignments_tracked_artist_id_fkey";
17324
+ foreignKeyName: "dashboard_search_windows_tracked_artist_id_fkey";
17096
17325
  columns: ["tracked_artist_id"];
17097
17326
  isOneToOne: false;
17098
17327
  referencedRelation: "artist_detail_view";
17099
17328
  referencedColumns: ["tracked_artist_id"];
17100
17329
  },
17101
17330
  {
17102
- foreignKeyName: "event_edition_avail_assignments_tracked_artist_id_fkey";
17331
+ foreignKeyName: "dashboard_search_windows_tracked_artist_id_fkey";
17103
17332
  columns: ["tracked_artist_id"];
17104
17333
  isOneToOne: false;
17105
17334
  referencedRelation: "artist_freshness_view";
17106
17335
  referencedColumns: ["tracked_artist_id"];
17107
17336
  },
17108
17337
  {
17109
- foreignKeyName: "event_edition_avail_assignments_tracked_artist_id_fkey";
17338
+ foreignKeyName: "dashboard_search_windows_tracked_artist_id_fkey";
17110
17339
  columns: ["tracked_artist_id"];
17111
17340
  isOneToOne: false;
17112
17341
  referencedRelation: "tracked_artists";
@@ -17114,125 +17343,205 @@ export type Database = {
17114
17343
  }
17115
17344
  ];
17116
17345
  };
17117
- historical_scrape_processing_state: {
17346
+ decision_log: {
17118
17347
  Row: {
17119
- active_run_id: string | null;
17120
- cancel_requested: boolean;
17348
+ artist_id: string;
17349
+ assignment_id: string;
17121
17350
  created_at: string;
17122
- heartbeat_at: string | null;
17351
+ decision_actor_type: Database["rad"]["Enums"]["decision_actor_type"];
17352
+ decision_actor_user_id: string | null;
17353
+ decision_scope: string;
17354
+ decision_type: Database["rad"]["Enums"]["decision_type"];
17355
+ demand_context: Json;
17356
+ event_edition_id: string;
17123
17357
  id: string;
17124
- is_processing: boolean;
17125
- last_completed_at: string | null;
17126
- last_error: string | null;
17127
- last_run_id: string | null;
17128
- metadata: Json;
17358
+ idempotency_key: string | null;
17359
+ metadata_json: Json;
17129
17360
  organization_id: string;
17130
- started_at: string | null;
17131
- updated_at: string;
17361
+ rationale: string | null;
17362
+ recommendation_run_id: string | null;
17363
+ source_surface: string;
17364
+ tracked_artist_id: string;
17132
17365
  };
17133
17366
  Insert: {
17134
- active_run_id?: string | null;
17135
- cancel_requested?: boolean;
17367
+ artist_id: string;
17368
+ assignment_id: string;
17136
17369
  created_at?: string;
17137
- heartbeat_at?: string | null;
17370
+ decision_actor_type?: Database["rad"]["Enums"]["decision_actor_type"];
17371
+ decision_actor_user_id?: string | null;
17372
+ decision_scope?: string;
17373
+ decision_type: Database["rad"]["Enums"]["decision_type"];
17374
+ demand_context?: Json;
17375
+ event_edition_id: string;
17138
17376
  id?: string;
17139
- is_processing?: boolean;
17140
- last_completed_at?: string | null;
17141
- last_error?: string | null;
17142
- last_run_id?: string | null;
17143
- metadata?: Json;
17377
+ idempotency_key?: string | null;
17378
+ metadata_json?: Json;
17144
17379
  organization_id: string;
17145
- started_at?: string | null;
17146
- updated_at?: string;
17380
+ rationale?: string | null;
17381
+ recommendation_run_id?: string | null;
17382
+ source_surface?: string;
17383
+ tracked_artist_id: string;
17147
17384
  };
17148
17385
  Update: {
17149
- active_run_id?: string | null;
17150
- cancel_requested?: boolean;
17386
+ artist_id?: string;
17387
+ assignment_id?: string;
17151
17388
  created_at?: string;
17152
- heartbeat_at?: string | null;
17389
+ decision_actor_type?: Database["rad"]["Enums"]["decision_actor_type"];
17390
+ decision_actor_user_id?: string | null;
17391
+ decision_scope?: string;
17392
+ decision_type?: Database["rad"]["Enums"]["decision_type"];
17393
+ demand_context?: Json;
17394
+ event_edition_id?: string;
17153
17395
  id?: string;
17154
- is_processing?: boolean;
17155
- last_completed_at?: string | null;
17156
- last_error?: string | null;
17157
- last_run_id?: string | null;
17158
- metadata?: Json;
17396
+ idempotency_key?: string | null;
17397
+ metadata_json?: Json;
17159
17398
  organization_id?: string;
17160
- started_at?: string | null;
17161
- updated_at?: string;
17399
+ rationale?: string | null;
17400
+ recommendation_run_id?: string | null;
17401
+ source_surface?: string;
17402
+ tracked_artist_id?: string;
17162
17403
  };
17163
17404
  Relationships: [
17164
17405
  {
17165
- foreignKeyName: "historical_scrape_processing_state_organization_id_fkey";
17406
+ foreignKeyName: "decision_log_assignment_id_fkey";
17407
+ columns: ["assignment_id"];
17408
+ isOneToOne: false;
17409
+ referencedRelation: "assignment_decision_projection";
17410
+ referencedColumns: ["assignment_id"];
17411
+ },
17412
+ {
17413
+ foreignKeyName: "decision_log_assignment_id_fkey";
17414
+ columns: ["assignment_id"];
17415
+ isOneToOne: false;
17416
+ referencedRelation: "event_artist_assignments";
17417
+ referencedColumns: ["id"];
17418
+ },
17419
+ {
17420
+ foreignKeyName: "decision_log_assignment_id_fkey";
17421
+ columns: ["assignment_id"];
17422
+ isOneToOne: false;
17423
+ referencedRelation: "event_edition_avail_assignments";
17424
+ referencedColumns: ["id"];
17425
+ },
17426
+ {
17427
+ foreignKeyName: "decision_log_assignment_id_fkey";
17428
+ columns: ["assignment_id"];
17429
+ isOneToOne: false;
17430
+ referencedRelation: "event_edition_candidate_set";
17431
+ referencedColumns: ["assignment_id"];
17432
+ },
17433
+ {
17434
+ foreignKeyName: "decision_log_assignment_id_fkey";
17435
+ columns: ["assignment_id"];
17436
+ isOneToOne: false;
17437
+ referencedRelation: "event_edition_live_grid";
17438
+ referencedColumns: ["assignment_id"];
17439
+ },
17440
+ {
17441
+ foreignKeyName: "decision_log_organization_id_fkey";
17166
17442
  columns: ["organization_id"];
17167
- isOneToOne: true;
17443
+ isOneToOne: false;
17168
17444
  referencedRelation: "dashboard_health_view";
17169
17445
  referencedColumns: ["organization_id"];
17170
17446
  },
17171
17447
  {
17172
- foreignKeyName: "historical_scrape_processing_state_organization_id_fkey";
17448
+ foreignKeyName: "decision_log_organization_id_fkey";
17173
17449
  columns: ["organization_id"];
17174
- isOneToOne: true;
17450
+ isOneToOne: false;
17175
17451
  referencedRelation: "system_health_overview";
17176
17452
  referencedColumns: ["organization_id"];
17453
+ },
17454
+ {
17455
+ foreignKeyName: "decision_log_tracked_artist_id_fkey";
17456
+ columns: ["tracked_artist_id"];
17457
+ isOneToOne: false;
17458
+ referencedRelation: "artist_detail_view";
17459
+ referencedColumns: ["tracked_artist_id"];
17460
+ },
17461
+ {
17462
+ foreignKeyName: "decision_log_tracked_artist_id_fkey";
17463
+ columns: ["tracked_artist_id"];
17464
+ isOneToOne: false;
17465
+ referencedRelation: "artist_freshness_view";
17466
+ referencedColumns: ["tracked_artist_id"];
17467
+ },
17468
+ {
17469
+ foreignKeyName: "decision_log_tracked_artist_id_fkey";
17470
+ columns: ["tracked_artist_id"];
17471
+ isOneToOne: false;
17472
+ referencedRelation: "tracked_artists";
17473
+ referencedColumns: ["id"];
17177
17474
  }
17178
17475
  ];
17179
17476
  };
17180
- inferred_avails_processing_state: {
17477
+ duplicate_avails_cleanup_state: {
17181
17478
  Row: {
17182
- active_run_id: string | null;
17183
- cancel_requested: boolean;
17479
+ completed_at: string | null;
17184
17480
  created_at: string;
17481
+ current_artist_name: string | null;
17482
+ current_group_index: number | null;
17483
+ duplicates_found: number;
17484
+ duplicates_resolved: number;
17185
17485
  heartbeat_at: string | null;
17186
17486
  id: string;
17187
17487
  is_processing: boolean;
17188
- last_completed_at: string | null;
17189
17488
  last_error: string | null;
17190
- last_run_id: string | null;
17489
+ last_run_trigger: string | null;
17191
17490
  metadata: Json;
17192
17491
  organization_id: string;
17492
+ records_deleted: number;
17193
17493
  started_at: string | null;
17494
+ total_groups: number | null;
17194
17495
  updated_at: string;
17195
17496
  };
17196
17497
  Insert: {
17197
- active_run_id?: string | null;
17198
- cancel_requested?: boolean;
17498
+ completed_at?: string | null;
17199
17499
  created_at?: string;
17500
+ current_artist_name?: string | null;
17501
+ current_group_index?: number | null;
17502
+ duplicates_found?: number;
17503
+ duplicates_resolved?: number;
17200
17504
  heartbeat_at?: string | null;
17201
17505
  id?: string;
17202
17506
  is_processing?: boolean;
17203
- last_completed_at?: string | null;
17204
17507
  last_error?: string | null;
17205
- last_run_id?: string | null;
17508
+ last_run_trigger?: string | null;
17206
17509
  metadata?: Json;
17207
17510
  organization_id: string;
17511
+ records_deleted?: number;
17208
17512
  started_at?: string | null;
17513
+ total_groups?: number | null;
17209
17514
  updated_at?: string;
17210
17515
  };
17211
17516
  Update: {
17212
- active_run_id?: string | null;
17213
- cancel_requested?: boolean;
17517
+ completed_at?: string | null;
17214
17518
  created_at?: string;
17519
+ current_artist_name?: string | null;
17520
+ current_group_index?: number | null;
17521
+ duplicates_found?: number;
17522
+ duplicates_resolved?: number;
17215
17523
  heartbeat_at?: string | null;
17216
17524
  id?: string;
17217
17525
  is_processing?: boolean;
17218
- last_completed_at?: string | null;
17219
17526
  last_error?: string | null;
17220
- last_run_id?: string | null;
17527
+ last_run_trigger?: string | null;
17221
17528
  metadata?: Json;
17222
17529
  organization_id?: string;
17530
+ records_deleted?: number;
17223
17531
  started_at?: string | null;
17532
+ total_groups?: number | null;
17224
17533
  updated_at?: string;
17225
17534
  };
17226
17535
  Relationships: [
17227
17536
  {
17228
- foreignKeyName: "inferred_avails_processing_state_organization_id_fkey";
17537
+ foreignKeyName: "duplicate_avails_cleanup_state_organization_id_fkey";
17229
17538
  columns: ["organization_id"];
17230
17539
  isOneToOne: true;
17231
17540
  referencedRelation: "dashboard_health_view";
17232
17541
  referencedColumns: ["organization_id"];
17233
17542
  },
17234
17543
  {
17235
- foreignKeyName: "inferred_avails_processing_state_organization_id_fkey";
17544
+ foreignKeyName: "duplicate_avails_cleanup_state_organization_id_fkey";
17236
17545
  columns: ["organization_id"];
17237
17546
  isOneToOne: true;
17238
17547
  referencedRelation: "system_health_overview";
@@ -17240,124 +17549,139 @@ export type Database = {
17240
17549
  }
17241
17550
  ];
17242
17551
  };
17243
- offer_links: {
17552
+ event_artist_assignments: {
17244
17553
  Row: {
17245
17554
  artist_id: string;
17246
- assignment_id: string;
17247
- booking_engine_offer_id: string;
17248
- booking_offer_id: string;
17555
+ assigned_at: string;
17556
+ assigned_by_user_id: string | null;
17557
+ assignment_state: Database["rad"]["Enums"]["assignment_state"];
17558
+ assignment_status: Database["rad"]["Enums"]["assignment_status"];
17559
+ availability_window_id: string | null;
17560
+ billing_tier_target: string | null;
17561
+ buyer_note: string | null;
17249
17562
  created_at: string;
17563
+ decision_metadata: Json;
17250
17564
  event_edition_id: string;
17251
17565
  id: string;
17252
- link_status: Database["rad"]["Enums"]["offer_link_status"];
17253
- linked_at: string;
17254
- linked_by_user_id: string | null;
17566
+ last_decision_log_id: string | null;
17567
+ last_verified_at: string | null;
17255
17568
  metadata: Json;
17256
17569
  organization_id: string;
17257
- revoked_at: string | null;
17570
+ rank_order: number | null;
17571
+ recommendation_run_id: string | null;
17258
17572
  tracked_artist_id: string;
17259
17573
  updated_at: string;
17260
17574
  };
17261
17575
  Insert: {
17262
17576
  artist_id: string;
17263
- assignment_id: string;
17264
- booking_engine_offer_id: string;
17265
- booking_offer_id: string;
17577
+ assigned_at?: string;
17578
+ assigned_by_user_id?: string | null;
17579
+ assignment_state?: Database["rad"]["Enums"]["assignment_state"];
17580
+ assignment_status?: Database["rad"]["Enums"]["assignment_status"];
17581
+ availability_window_id?: string | null;
17582
+ billing_tier_target?: string | null;
17583
+ buyer_note?: string | null;
17266
17584
  created_at?: string;
17585
+ decision_metadata?: Json;
17267
17586
  event_edition_id: string;
17268
17587
  id?: string;
17269
- link_status?: Database["rad"]["Enums"]["offer_link_status"];
17270
- linked_at?: string;
17271
- linked_by_user_id?: string | null;
17588
+ last_decision_log_id?: string | null;
17589
+ last_verified_at?: string | null;
17272
17590
  metadata?: Json;
17273
17591
  organization_id: string;
17274
- revoked_at?: string | null;
17592
+ rank_order?: number | null;
17593
+ recommendation_run_id?: string | null;
17275
17594
  tracked_artist_id: string;
17276
17595
  updated_at?: string;
17277
17596
  };
17278
17597
  Update: {
17279
17598
  artist_id?: string;
17280
- assignment_id?: string;
17281
- booking_engine_offer_id?: string;
17282
- booking_offer_id?: string;
17599
+ assigned_at?: string;
17600
+ assigned_by_user_id?: string | null;
17601
+ assignment_state?: Database["rad"]["Enums"]["assignment_state"];
17602
+ assignment_status?: Database["rad"]["Enums"]["assignment_status"];
17603
+ availability_window_id?: string | null;
17604
+ billing_tier_target?: string | null;
17605
+ buyer_note?: string | null;
17283
17606
  created_at?: string;
17607
+ decision_metadata?: Json;
17284
17608
  event_edition_id?: string;
17285
17609
  id?: string;
17286
- link_status?: Database["rad"]["Enums"]["offer_link_status"];
17287
- linked_at?: string;
17288
- linked_by_user_id?: string | null;
17610
+ last_decision_log_id?: string | null;
17611
+ last_verified_at?: string | null;
17289
17612
  metadata?: Json;
17290
17613
  organization_id?: string;
17291
- revoked_at?: string | null;
17614
+ rank_order?: number | null;
17615
+ recommendation_run_id?: string | null;
17292
17616
  tracked_artist_id?: string;
17293
17617
  updated_at?: string;
17294
17618
  };
17295
17619
  Relationships: [
17296
17620
  {
17297
- foreignKeyName: "offer_links_assignment_id_fkey";
17298
- columns: ["assignment_id"];
17621
+ foreignKeyName: "event_artist_assignments_last_decision_log_id_fkey";
17622
+ columns: ["last_decision_log_id"];
17299
17623
  isOneToOne: false;
17300
17624
  referencedRelation: "assignment_decision_projection";
17301
- referencedColumns: ["assignment_id"];
17625
+ referencedColumns: ["latest_decision_id"];
17302
17626
  },
17303
17627
  {
17304
- foreignKeyName: "offer_links_assignment_id_fkey";
17305
- columns: ["assignment_id"];
17628
+ foreignKeyName: "event_artist_assignments_last_decision_log_id_fkey";
17629
+ columns: ["last_decision_log_id"];
17306
17630
  isOneToOne: false;
17307
- referencedRelation: "event_artist_assignments";
17631
+ referencedRelation: "decision_log";
17308
17632
  referencedColumns: ["id"];
17309
17633
  },
17310
17634
  {
17311
- foreignKeyName: "offer_links_assignment_id_fkey";
17312
- columns: ["assignment_id"];
17635
+ foreignKeyName: "event_edition_avail_assignments_availability_window_id_fkey";
17636
+ columns: ["availability_window_id"];
17313
17637
  isOneToOne: false;
17314
- referencedRelation: "event_edition_avail_assignments";
17638
+ referencedRelation: "artist_availability_windows";
17315
17639
  referencedColumns: ["id"];
17316
17640
  },
17317
17641
  {
17318
- foreignKeyName: "offer_links_assignment_id_fkey";
17319
- columns: ["assignment_id"];
17642
+ foreignKeyName: "event_edition_avail_assignments_availability_window_id_fkey";
17643
+ columns: ["availability_window_id"];
17320
17644
  isOneToOne: false;
17321
- referencedRelation: "event_edition_candidate_set";
17322
- referencedColumns: ["assignment_id"];
17645
+ referencedRelation: "availability_search_base";
17646
+ referencedColumns: ["id"];
17323
17647
  },
17324
17648
  {
17325
- foreignKeyName: "offer_links_assignment_id_fkey";
17326
- columns: ["assignment_id"];
17649
+ foreignKeyName: "event_edition_avail_assignments_availability_window_id_fkey";
17650
+ columns: ["availability_window_id"];
17327
17651
  isOneToOne: false;
17328
17652
  referencedRelation: "event_edition_live_grid";
17329
- referencedColumns: ["assignment_id"];
17653
+ referencedColumns: ["live_availability_window_id"];
17330
17654
  },
17331
17655
  {
17332
- foreignKeyName: "offer_links_organization_id_fkey";
17656
+ foreignKeyName: "event_edition_avail_assignments_organization_id_fkey";
17333
17657
  columns: ["organization_id"];
17334
17658
  isOneToOne: false;
17335
17659
  referencedRelation: "dashboard_health_view";
17336
17660
  referencedColumns: ["organization_id"];
17337
17661
  },
17338
17662
  {
17339
- foreignKeyName: "offer_links_organization_id_fkey";
17663
+ foreignKeyName: "event_edition_avail_assignments_organization_id_fkey";
17340
17664
  columns: ["organization_id"];
17341
17665
  isOneToOne: false;
17342
17666
  referencedRelation: "system_health_overview";
17343
17667
  referencedColumns: ["organization_id"];
17344
17668
  },
17345
17669
  {
17346
- foreignKeyName: "offer_links_tracked_artist_id_fkey";
17670
+ foreignKeyName: "event_edition_avail_assignments_tracked_artist_id_fkey";
17347
17671
  columns: ["tracked_artist_id"];
17348
17672
  isOneToOne: false;
17349
17673
  referencedRelation: "artist_detail_view";
17350
17674
  referencedColumns: ["tracked_artist_id"];
17351
17675
  },
17352
17676
  {
17353
- foreignKeyName: "offer_links_tracked_artist_id_fkey";
17677
+ foreignKeyName: "event_edition_avail_assignments_tracked_artist_id_fkey";
17354
17678
  columns: ["tracked_artist_id"];
17355
17679
  isOneToOne: false;
17356
17680
  referencedRelation: "artist_freshness_view";
17357
17681
  referencedColumns: ["tracked_artist_id"];
17358
17682
  },
17359
17683
  {
17360
- foreignKeyName: "offer_links_tracked_artist_id_fkey";
17684
+ foreignKeyName: "event_edition_avail_assignments_tracked_artist_id_fkey";
17361
17685
  columns: ["tracked_artist_id"];
17362
17686
  isOneToOne: false;
17363
17687
  referencedRelation: "tracked_artists";
@@ -17365,40 +17689,291 @@ export type Database = {
17365
17689
  }
17366
17690
  ];
17367
17691
  };
17368
- performance_metrics: {
17692
+ historical_scrape_processing_state: {
17369
17693
  Row: {
17694
+ active_run_id: string | null;
17695
+ cancel_requested: boolean;
17370
17696
  created_at: string;
17697
+ heartbeat_at: string | null;
17371
17698
  id: string;
17699
+ is_processing: boolean;
17700
+ last_completed_at: string | null;
17701
+ last_error: string | null;
17702
+ last_run_id: string | null;
17372
17703
  metadata: Json;
17373
- metric_name: string;
17374
- metric_type: string;
17375
- organization_id: string | null;
17376
- unit: string | null;
17377
- value: number;
17704
+ organization_id: string;
17705
+ started_at: string | null;
17706
+ updated_at: string;
17378
17707
  };
17379
17708
  Insert: {
17709
+ active_run_id?: string | null;
17710
+ cancel_requested?: boolean;
17380
17711
  created_at?: string;
17712
+ heartbeat_at?: string | null;
17381
17713
  id?: string;
17714
+ is_processing?: boolean;
17715
+ last_completed_at?: string | null;
17716
+ last_error?: string | null;
17717
+ last_run_id?: string | null;
17382
17718
  metadata?: Json;
17383
- metric_name: string;
17384
- metric_type: string;
17385
- organization_id?: string | null;
17386
- unit?: string | null;
17387
- value: number;
17719
+ organization_id: string;
17720
+ started_at?: string | null;
17721
+ updated_at?: string;
17388
17722
  };
17389
17723
  Update: {
17724
+ active_run_id?: string | null;
17725
+ cancel_requested?: boolean;
17390
17726
  created_at?: string;
17727
+ heartbeat_at?: string | null;
17391
17728
  id?: string;
17729
+ is_processing?: boolean;
17730
+ last_completed_at?: string | null;
17731
+ last_error?: string | null;
17732
+ last_run_id?: string | null;
17392
17733
  metadata?: Json;
17393
- metric_name?: string;
17394
- metric_type?: string;
17395
- organization_id?: string | null;
17396
- unit?: string | null;
17397
- value?: number;
17734
+ organization_id?: string;
17735
+ started_at?: string | null;
17736
+ updated_at?: string;
17398
17737
  };
17399
17738
  Relationships: [
17400
17739
  {
17401
- foreignKeyName: "performance_metrics_organization_id_fkey";
17740
+ foreignKeyName: "historical_scrape_processing_state_organization_id_fkey";
17741
+ columns: ["organization_id"];
17742
+ isOneToOne: true;
17743
+ referencedRelation: "dashboard_health_view";
17744
+ referencedColumns: ["organization_id"];
17745
+ },
17746
+ {
17747
+ foreignKeyName: "historical_scrape_processing_state_organization_id_fkey";
17748
+ columns: ["organization_id"];
17749
+ isOneToOne: true;
17750
+ referencedRelation: "system_health_overview";
17751
+ referencedColumns: ["organization_id"];
17752
+ }
17753
+ ];
17754
+ };
17755
+ inferred_avails_processing_state: {
17756
+ Row: {
17757
+ active_run_id: string | null;
17758
+ cancel_requested: boolean;
17759
+ created_at: string;
17760
+ heartbeat_at: string | null;
17761
+ id: string;
17762
+ is_processing: boolean;
17763
+ last_completed_at: string | null;
17764
+ last_error: string | null;
17765
+ last_run_id: string | null;
17766
+ metadata: Json;
17767
+ organization_id: string;
17768
+ started_at: string | null;
17769
+ updated_at: string;
17770
+ };
17771
+ Insert: {
17772
+ active_run_id?: string | null;
17773
+ cancel_requested?: boolean;
17774
+ created_at?: string;
17775
+ heartbeat_at?: string | null;
17776
+ id?: string;
17777
+ is_processing?: boolean;
17778
+ last_completed_at?: string | null;
17779
+ last_error?: string | null;
17780
+ last_run_id?: string | null;
17781
+ metadata?: Json;
17782
+ organization_id: string;
17783
+ started_at?: string | null;
17784
+ updated_at?: string;
17785
+ };
17786
+ Update: {
17787
+ active_run_id?: string | null;
17788
+ cancel_requested?: boolean;
17789
+ created_at?: string;
17790
+ heartbeat_at?: string | null;
17791
+ id?: string;
17792
+ is_processing?: boolean;
17793
+ last_completed_at?: string | null;
17794
+ last_error?: string | null;
17795
+ last_run_id?: string | null;
17796
+ metadata?: Json;
17797
+ organization_id?: string;
17798
+ started_at?: string | null;
17799
+ updated_at?: string;
17800
+ };
17801
+ Relationships: [
17802
+ {
17803
+ foreignKeyName: "inferred_avails_processing_state_organization_id_fkey";
17804
+ columns: ["organization_id"];
17805
+ isOneToOne: true;
17806
+ referencedRelation: "dashboard_health_view";
17807
+ referencedColumns: ["organization_id"];
17808
+ },
17809
+ {
17810
+ foreignKeyName: "inferred_avails_processing_state_organization_id_fkey";
17811
+ columns: ["organization_id"];
17812
+ isOneToOne: true;
17813
+ referencedRelation: "system_health_overview";
17814
+ referencedColumns: ["organization_id"];
17815
+ }
17816
+ ];
17817
+ };
17818
+ offer_links: {
17819
+ Row: {
17820
+ artist_id: string;
17821
+ assignment_id: string;
17822
+ booking_engine_offer_id: string;
17823
+ booking_offer_id: string;
17824
+ created_at: string;
17825
+ event_edition_id: string;
17826
+ id: string;
17827
+ link_status: Database["rad"]["Enums"]["offer_link_status"];
17828
+ linked_at: string;
17829
+ linked_by_user_id: string | null;
17830
+ metadata: Json;
17831
+ organization_id: string;
17832
+ revoked_at: string | null;
17833
+ tracked_artist_id: string;
17834
+ updated_at: string;
17835
+ };
17836
+ Insert: {
17837
+ artist_id: string;
17838
+ assignment_id: string;
17839
+ booking_engine_offer_id: string;
17840
+ booking_offer_id: string;
17841
+ created_at?: string;
17842
+ event_edition_id: string;
17843
+ id?: string;
17844
+ link_status?: Database["rad"]["Enums"]["offer_link_status"];
17845
+ linked_at?: string;
17846
+ linked_by_user_id?: string | null;
17847
+ metadata?: Json;
17848
+ organization_id: string;
17849
+ revoked_at?: string | null;
17850
+ tracked_artist_id: string;
17851
+ updated_at?: string;
17852
+ };
17853
+ Update: {
17854
+ artist_id?: string;
17855
+ assignment_id?: string;
17856
+ booking_engine_offer_id?: string;
17857
+ booking_offer_id?: string;
17858
+ created_at?: string;
17859
+ event_edition_id?: string;
17860
+ id?: string;
17861
+ link_status?: Database["rad"]["Enums"]["offer_link_status"];
17862
+ linked_at?: string;
17863
+ linked_by_user_id?: string | null;
17864
+ metadata?: Json;
17865
+ organization_id?: string;
17866
+ revoked_at?: string | null;
17867
+ tracked_artist_id?: string;
17868
+ updated_at?: string;
17869
+ };
17870
+ Relationships: [
17871
+ {
17872
+ foreignKeyName: "offer_links_assignment_id_fkey";
17873
+ columns: ["assignment_id"];
17874
+ isOneToOne: false;
17875
+ referencedRelation: "assignment_decision_projection";
17876
+ referencedColumns: ["assignment_id"];
17877
+ },
17878
+ {
17879
+ foreignKeyName: "offer_links_assignment_id_fkey";
17880
+ columns: ["assignment_id"];
17881
+ isOneToOne: false;
17882
+ referencedRelation: "event_artist_assignments";
17883
+ referencedColumns: ["id"];
17884
+ },
17885
+ {
17886
+ foreignKeyName: "offer_links_assignment_id_fkey";
17887
+ columns: ["assignment_id"];
17888
+ isOneToOne: false;
17889
+ referencedRelation: "event_edition_avail_assignments";
17890
+ referencedColumns: ["id"];
17891
+ },
17892
+ {
17893
+ foreignKeyName: "offer_links_assignment_id_fkey";
17894
+ columns: ["assignment_id"];
17895
+ isOneToOne: false;
17896
+ referencedRelation: "event_edition_candidate_set";
17897
+ referencedColumns: ["assignment_id"];
17898
+ },
17899
+ {
17900
+ foreignKeyName: "offer_links_assignment_id_fkey";
17901
+ columns: ["assignment_id"];
17902
+ isOneToOne: false;
17903
+ referencedRelation: "event_edition_live_grid";
17904
+ referencedColumns: ["assignment_id"];
17905
+ },
17906
+ {
17907
+ foreignKeyName: "offer_links_organization_id_fkey";
17908
+ columns: ["organization_id"];
17909
+ isOneToOne: false;
17910
+ referencedRelation: "dashboard_health_view";
17911
+ referencedColumns: ["organization_id"];
17912
+ },
17913
+ {
17914
+ foreignKeyName: "offer_links_organization_id_fkey";
17915
+ columns: ["organization_id"];
17916
+ isOneToOne: false;
17917
+ referencedRelation: "system_health_overview";
17918
+ referencedColumns: ["organization_id"];
17919
+ },
17920
+ {
17921
+ foreignKeyName: "offer_links_tracked_artist_id_fkey";
17922
+ columns: ["tracked_artist_id"];
17923
+ isOneToOne: false;
17924
+ referencedRelation: "artist_detail_view";
17925
+ referencedColumns: ["tracked_artist_id"];
17926
+ },
17927
+ {
17928
+ foreignKeyName: "offer_links_tracked_artist_id_fkey";
17929
+ columns: ["tracked_artist_id"];
17930
+ isOneToOne: false;
17931
+ referencedRelation: "artist_freshness_view";
17932
+ referencedColumns: ["tracked_artist_id"];
17933
+ },
17934
+ {
17935
+ foreignKeyName: "offer_links_tracked_artist_id_fkey";
17936
+ columns: ["tracked_artist_id"];
17937
+ isOneToOne: false;
17938
+ referencedRelation: "tracked_artists";
17939
+ referencedColumns: ["id"];
17940
+ }
17941
+ ];
17942
+ };
17943
+ performance_metrics: {
17944
+ Row: {
17945
+ created_at: string;
17946
+ id: string;
17947
+ metadata: Json;
17948
+ metric_name: string;
17949
+ metric_type: string;
17950
+ organization_id: string | null;
17951
+ unit: string | null;
17952
+ value: number;
17953
+ };
17954
+ Insert: {
17955
+ created_at?: string;
17956
+ id?: string;
17957
+ metadata?: Json;
17958
+ metric_name: string;
17959
+ metric_type: string;
17960
+ organization_id?: string | null;
17961
+ unit?: string | null;
17962
+ value: number;
17963
+ };
17964
+ Update: {
17965
+ created_at?: string;
17966
+ id?: string;
17967
+ metadata?: Json;
17968
+ metric_name?: string;
17969
+ metric_type?: string;
17970
+ organization_id?: string | null;
17971
+ unit?: string | null;
17972
+ value?: number;
17973
+ };
17974
+ Relationships: [
17975
+ {
17976
+ foreignKeyName: "performance_metrics_organization_id_fkey";
17402
17977
  columns: ["organization_id"];
17403
17978
  isOneToOne: false;
17404
17979
  referencedRelation: "dashboard_health_view";
@@ -19173,30 +19748,209 @@ export type Database = {
19173
19748
  availability_window_id: string;
19174
19749
  }[];
19175
19750
  };
19176
- filtered_availability_search_rows: {
19751
+ dashboard_search_overlay_cache_status: {
19177
19752
  Args: {
19178
- p_active_only?: boolean;
19179
- p_agencies?: string[];
19180
- p_artists?: string[];
19181
- p_assigned_only?: boolean;
19182
- p_center_city?: string;
19183
- p_city?: string;
19753
+ p_center_city: string;
19184
19754
  p_date_from: string;
19185
19755
  p_date_to: string;
19186
- p_event_edition_id?: string;
19187
- p_fanbase_max?: number;
19188
- p_fanbase_min?: number;
19189
- p_genres?: string[];
19190
- p_momentums?: string[];
19756
+ p_interest_from: string;
19757
+ p_interest_to: string;
19191
19758
  p_organization_id: string;
19192
- p_quote_high?: number;
19193
- p_quote_low?: number;
19194
- p_radius_miles?: number;
19195
- p_search?: string;
19196
- p_spotify_max?: number;
19197
- p_spotify_min?: number;
19198
- p_states?: string[];
19199
- p_statuses?: string[];
19759
+ p_radius_miles: number;
19760
+ };
19761
+ Returns: {
19762
+ cache_complete: boolean;
19763
+ center_city_key: string;
19764
+ interest_from: string;
19765
+ interest_to: string;
19766
+ missing_window_count: number;
19767
+ newest_refreshed_at: string;
19768
+ oldest_refreshed_at: string;
19769
+ overlay_window_count: number;
19770
+ radius_miles: number;
19771
+ source_window_count: number;
19772
+ }[];
19773
+ };
19774
+ dashboard_search_window_source_rows: {
19775
+ Args: {
19776
+ p_availability_window_id?: string;
19777
+ p_organization_id?: string;
19778
+ };
19779
+ Returns: {
19780
+ agency: string;
19781
+ agency_lc: string;
19782
+ analytics_activity_score: number;
19783
+ analytics_activity_tier: string;
19784
+ analytics_artist_rank: number;
19785
+ analytics_chartmetric_id: string;
19786
+ analytics_instagram_engagement: number;
19787
+ analytics_instagram_followers: number;
19788
+ analytics_last_updated_at: string;
19789
+ analytics_next_update_due: string;
19790
+ analytics_spotify_followers: number;
19791
+ analytics_spotify_monthly_listeners: number;
19792
+ analytics_tiktok_engagement: number;
19793
+ analytics_tiktok_followers: number;
19794
+ analytics_tiktok_track_posts: number;
19795
+ analytics_total_fanbase: number;
19796
+ artist_id: string;
19797
+ artist_name: string;
19798
+ artist_name_lc: string;
19799
+ artist_normalized_name: string;
19800
+ artist_normalized_name_lc: string;
19801
+ assignment_count: number;
19802
+ availability_window_id: string;
19803
+ confidence: number;
19804
+ data_freshness_days: number;
19805
+ effective_date: string;
19806
+ effective_status: string;
19807
+ financials_total_shows: number;
19808
+ genre: string;
19809
+ genre_lc: string;
19810
+ has_assignment: boolean;
19811
+ inferred_at: string;
19812
+ interest_source: string;
19813
+ is_active: boolean;
19814
+ is_inferred: boolean;
19815
+ latest_assigned_at: string;
19816
+ latest_assignment_state: string;
19817
+ market_city: string;
19818
+ market_city_lc: string;
19819
+ market_id: string;
19820
+ market_name: string;
19821
+ market_name_lc: string;
19822
+ market_state: string;
19823
+ momentum: string;
19824
+ organization_id: string;
19825
+ primary_source: string;
19826
+ quote_avg_gross: number;
19827
+ quote_avg_guarantee: number;
19828
+ quote_avg_tickets_sold: number;
19829
+ quote_high: number;
19830
+ quote_low: number;
19831
+ read_model_hash: string;
19832
+ reg_last_mod_date: string;
19833
+ source_updated_at: string;
19834
+ status_display: string;
19835
+ tracked_artist_id: string;
19836
+ venue_capacity: number;
19837
+ venue_id: string;
19838
+ venue_name: string;
19839
+ venue_name_lc: string;
19840
+ venue_type: string;
19841
+ }[];
19842
+ };
19843
+ dashboard_search_window_source_rows_for_window_ids: {
19844
+ Args: {
19845
+ p_availability_window_ids: string[];
19846
+ };
19847
+ Returns: {
19848
+ agency: string;
19849
+ agency_lc: string;
19850
+ analytics_activity_score: number;
19851
+ analytics_activity_tier: string;
19852
+ analytics_artist_rank: number;
19853
+ analytics_chartmetric_id: string;
19854
+ analytics_instagram_engagement: number;
19855
+ analytics_instagram_followers: number;
19856
+ analytics_last_updated_at: string;
19857
+ analytics_next_update_due: string;
19858
+ analytics_spotify_followers: number;
19859
+ analytics_spotify_monthly_listeners: number;
19860
+ analytics_tiktok_engagement: number;
19861
+ analytics_tiktok_followers: number;
19862
+ analytics_tiktok_track_posts: number;
19863
+ analytics_total_fanbase: number;
19864
+ artist_id: string;
19865
+ artist_name: string;
19866
+ artist_name_lc: string;
19867
+ artist_normalized_name: string;
19868
+ artist_normalized_name_lc: string;
19869
+ assignment_count: number;
19870
+ availability_window_id: string;
19871
+ confidence: number;
19872
+ data_freshness_days: number;
19873
+ effective_date: string;
19874
+ effective_status: string;
19875
+ financials_total_shows: number;
19876
+ genre: string;
19877
+ genre_lc: string;
19878
+ has_assignment: boolean;
19879
+ inferred_at: string;
19880
+ interest_source: string;
19881
+ is_active: boolean;
19882
+ is_inferred: boolean;
19883
+ latest_assigned_at: string;
19884
+ latest_assignment_state: string;
19885
+ market_city: string;
19886
+ market_city_lc: string;
19887
+ market_id: string;
19888
+ market_name: string;
19889
+ market_name_lc: string;
19890
+ market_state: string;
19891
+ momentum: string;
19892
+ organization_id: string;
19893
+ primary_source: string;
19894
+ quote_avg_gross: number;
19895
+ quote_avg_guarantee: number;
19896
+ quote_avg_tickets_sold: number;
19897
+ quote_high: number;
19898
+ quote_low: number;
19899
+ read_model_hash: string;
19900
+ reg_last_mod_date: string;
19901
+ source_updated_at: string;
19902
+ status_display: string;
19903
+ tracked_artist_id: string;
19904
+ venue_capacity: number;
19905
+ venue_id: string;
19906
+ venue_name: string;
19907
+ venue_name_lc: string;
19908
+ venue_type: string;
19909
+ }[];
19910
+ };
19911
+ enqueue_dashboard_search_read_model_repair: {
19912
+ Args: {
19913
+ p_date_from?: string;
19914
+ p_date_to?: string;
19915
+ p_limit?: number;
19916
+ p_organization_id: string;
19917
+ };
19918
+ Returns: Json;
19919
+ };
19920
+ enqueue_dashboard_search_refresh_windows: {
19921
+ Args: {
19922
+ p_availability_window_ids: string[];
19923
+ p_metadata?: Json;
19924
+ p_reason: string;
19925
+ p_source_row_id?: string;
19926
+ p_source_table?: string;
19927
+ };
19928
+ Returns: number;
19929
+ };
19930
+ filtered_availability_search_rows: {
19931
+ Args: {
19932
+ p_active_only?: boolean;
19933
+ p_agencies?: string[];
19934
+ p_artists?: string[];
19935
+ p_assigned_only?: boolean;
19936
+ p_center_city?: string;
19937
+ p_city?: string;
19938
+ p_date_from: string;
19939
+ p_date_to: string;
19940
+ p_event_edition_id?: string;
19941
+ p_fanbase_max?: number;
19942
+ p_fanbase_min?: number;
19943
+ p_genres?: string[];
19944
+ p_momentums?: string[];
19945
+ p_organization_id: string;
19946
+ p_quote_high?: number;
19947
+ p_quote_low?: number;
19948
+ p_radius_miles?: number;
19949
+ p_search?: string;
19950
+ p_spotify_max?: number;
19951
+ p_spotify_min?: number;
19952
+ p_states?: string[];
19953
+ p_statuses?: string[];
19200
19954
  };
19201
19955
  Returns: {
19202
19956
  agency: string;
@@ -19460,6 +20214,23 @@ export type Database = {
19460
20214
  tracked_artist_count: number;
19461
20215
  }[];
19462
20216
  };
20217
+ get_dashboard_search_overlay_warming_status: {
20218
+ Args: never;
20219
+ Returns: Json;
20220
+ };
20221
+ get_dashboard_search_read_model_health: {
20222
+ Args: {
20223
+ p_date_from?: string;
20224
+ p_date_to?: string;
20225
+ p_organization_id: string;
20226
+ p_sample_limit?: number;
20227
+ };
20228
+ Returns: Json;
20229
+ };
20230
+ get_dashboard_search_refresh_queue_status: {
20231
+ Args: never;
20232
+ Returns: Json;
20233
+ };
19463
20234
  get_duplicate_avail_groups: {
19464
20235
  Args: {
19465
20236
  p_max_groups?: number;
@@ -19635,147 +20406,419 @@ export type Database = {
19635
20406
  venue_name: string;
19636
20407
  }[];
19637
20408
  };
19638
- get_search_conflict_summary: {
20409
+ get_search_conflict_summary: {
20410
+ Args: {
20411
+ p_active_only?: boolean;
20412
+ p_agencies?: string[];
20413
+ p_artists?: string[];
20414
+ p_assigned_only?: boolean;
20415
+ p_center_city?: string;
20416
+ p_city?: string;
20417
+ p_date_from: string;
20418
+ p_date_to: string;
20419
+ p_event_edition_id?: string;
20420
+ p_fanbase_max?: number;
20421
+ p_fanbase_min?: number;
20422
+ p_genres?: string[];
20423
+ p_momentums?: string[];
20424
+ p_organization_id: string;
20425
+ p_quote_high?: number;
20426
+ p_quote_low?: number;
20427
+ p_radius_miles?: number;
20428
+ p_search?: string;
20429
+ p_spotify_max?: number;
20430
+ p_spotify_min?: number;
20431
+ p_states?: string[];
20432
+ p_statuses?: string[];
20433
+ };
20434
+ Returns: {
20435
+ conflict_artists: number;
20436
+ conflict_dates: number;
20437
+ conflict_events: number;
20438
+ conflict_records: number;
20439
+ market_conflict_artists: number;
20440
+ market_conflict_dates: number;
20441
+ market_conflict_events: number;
20442
+ radius_conflict_artists: number;
20443
+ radius_conflict_dates: number;
20444
+ radius_conflict_events: number;
20445
+ }[];
20446
+ };
20447
+ get_search_geo_context_data: {
20448
+ Args: {
20449
+ p_artist_ids?: string[];
20450
+ p_conflict_from?: string;
20451
+ p_interest_from?: string;
20452
+ p_interest_to?: string;
20453
+ p_organization_id: string;
20454
+ p_tracked_artist_ids?: string[];
20455
+ };
20456
+ Returns: {
20457
+ artist_id: string;
20458
+ artist_name: string;
20459
+ date: string;
20460
+ interest_source: string;
20461
+ market_city: string;
20462
+ market_market: string;
20463
+ market_state: string;
20464
+ organization_id: string;
20465
+ primary_source: string;
20466
+ status: string;
20467
+ status_display: string;
20468
+ tracked_artist_id: string;
20469
+ venue_name: string;
20470
+ }[];
20471
+ };
20472
+ get_search_interest_data: {
20473
+ Args: {
20474
+ p_artist_ids?: string[];
20475
+ p_interest_from?: string;
20476
+ p_interest_to?: string;
20477
+ p_organization_id: string;
20478
+ p_tracked_artist_ids?: string[];
20479
+ };
20480
+ Returns: {
20481
+ artist_id: string;
20482
+ artist_name: string;
20483
+ date: string;
20484
+ interest_source: string;
20485
+ market_city: string;
20486
+ market_market: string;
20487
+ market_state: string;
20488
+ organization_id: string;
20489
+ primary_source: string;
20490
+ status: string;
20491
+ status_display: string;
20492
+ tracked_artist_id: string;
20493
+ venue_name: string;
20494
+ }[];
20495
+ };
20496
+ get_search_market_history: {
20497
+ Args: {
20498
+ p_artist_ids?: string[];
20499
+ p_history_from?: string;
20500
+ p_history_to?: string;
20501
+ p_organization_id: string;
20502
+ p_tracked_artist_ids?: string[];
20503
+ };
20504
+ Returns: {
20505
+ artist_id: string;
20506
+ artist_name: string;
20507
+ date: string;
20508
+ market_city: string;
20509
+ market_market: string;
20510
+ market_state: string;
20511
+ organization_id: string;
20512
+ primary_source: string;
20513
+ tracked_artist_id: string;
20514
+ venue_name: string;
20515
+ }[];
20516
+ };
20517
+ get_system_health_summary: {
20518
+ Args: {
20519
+ p_organization_id: string;
20520
+ };
20521
+ Returns: {
20522
+ analytics_count: number;
20523
+ analytics_last_error: string;
20524
+ analytics_processing: boolean;
20525
+ avail_count: number;
20526
+ historical_scrape_last_error: string;
20527
+ historical_scrape_processing: boolean;
20528
+ inferred_avails_last_error: string;
20529
+ inferred_avails_processing: boolean;
20530
+ latest_analytics_updated_at: string;
20531
+ latest_reg_sync_completed_at: string;
20532
+ latest_reg_sync_started_at: string;
20533
+ latest_search_request_at: string;
20534
+ organization_id: string;
20535
+ organization_name: string;
20536
+ pending_analytics_count: number;
20537
+ pending_reg_sync_count: number;
20538
+ reg_sync_last_error: string;
20539
+ reg_sync_processing: boolean;
20540
+ scraping_last_error: string;
20541
+ scraping_processing: boolean;
20542
+ tracked_artist_count: number;
20543
+ }[];
20544
+ };
20545
+ hydrate_artist_avails: {
20546
+ Args: {
20547
+ p_active_only?: boolean;
20548
+ p_agencies?: string[];
20549
+ p_artist_ids?: string[];
20550
+ p_artists?: string[];
20551
+ p_assigned_only?: boolean;
20552
+ p_center_city?: string;
20553
+ p_city?: string;
20554
+ p_date_from: string;
20555
+ p_date_to: string;
20556
+ p_event_edition_id?: string;
20557
+ p_fanbase_max?: number;
20558
+ p_fanbase_min?: number;
20559
+ p_genres?: string[];
20560
+ p_has_market_conflict?: boolean;
20561
+ p_has_nearby_interest?: boolean;
20562
+ p_has_radius_conflict?: boolean;
20563
+ p_has_routing_opportunity?: boolean;
20564
+ p_limit?: number;
20565
+ p_momentums?: string[];
20566
+ p_offset?: number;
20567
+ p_organization_id: string;
20568
+ p_quote_high?: number;
20569
+ p_quote_low?: number;
20570
+ p_radius_miles?: number;
20571
+ p_require_available_with_routing?: boolean;
20572
+ p_search?: string;
20573
+ p_spotify_max?: number;
20574
+ p_spotify_min?: number;
20575
+ p_states?: string[];
20576
+ p_statuses?: string[];
20577
+ p_tracked_artist_ids?: string[];
20578
+ };
20579
+ Returns: {
20580
+ agency: string;
20581
+ analytics_activity_score: number;
20582
+ analytics_activity_tier: string;
20583
+ analytics_artist_rank: number;
20584
+ analytics_chartmetric_id: string;
20585
+ analytics_instagram_engagement: number;
20586
+ analytics_instagram_followers: number;
20587
+ analytics_last_updated_at: string;
20588
+ analytics_next_update_due: string;
20589
+ analytics_spotify_followers: number;
20590
+ analytics_spotify_monthly_listeners: number;
20591
+ analytics_tiktok_engagement: number;
20592
+ analytics_tiktok_followers: number;
20593
+ analytics_tiktok_track_posts: number;
20594
+ analytics_total_fanbase: number;
20595
+ artist_id: string;
20596
+ artist_name: string;
20597
+ artist_normalized_name: string;
20598
+ confidence: number;
20599
+ data_freshness_days: number;
20600
+ date: string;
20601
+ distance_miles: number;
20602
+ financials_avg_gross: number;
20603
+ financials_avg_guarantee: number;
20604
+ financials_avg_tickets_sold: number;
20605
+ financials_quote_high: number;
20606
+ financials_quote_low: number;
20607
+ financials_total_shows: number;
20608
+ genre: string;
20609
+ has_market_conflict: boolean;
20610
+ historical_scrape_status: string;
20611
+ id: string;
20612
+ inferred_at: string;
20613
+ interest_source: string;
20614
+ is_inferred: boolean;
20615
+ is_routed: boolean;
20616
+ last_scraped_at: string;
20617
+ last_sync_status: string;
20618
+ lineage: Json;
20619
+ market_city: string;
20620
+ market_conflicts: Json;
20621
+ market_id: string;
20622
+ market_market: string;
20623
+ market_state: string;
20624
+ momentum: string;
20625
+ nearby_interest: Json;
20626
+ organization_id: string;
20627
+ primary_source: string;
20628
+ radius_conflict: boolean;
20629
+ radius_conflicts: Json;
20630
+ reg_last_mod_date: string;
20631
+ reg_last_synced_at: string;
20632
+ reg_metadata_last_synced_at: string;
20633
+ routing_shows: Json;
20634
+ same_day_interest: Json;
20635
+ status: string;
20636
+ status_display: string;
20637
+ total_count: number;
20638
+ tracked_artist_id: string;
20639
+ venue_capacity: number;
20640
+ venue_id: string;
20641
+ venue_name: string;
20642
+ venue_type: string;
20643
+ }[];
20644
+ };
20645
+ hydrate_artist_avails_overlay_cached: {
20646
+ Args: {
20647
+ p_active_only?: boolean;
20648
+ p_agencies?: string[];
20649
+ p_artist_ids?: string[];
20650
+ p_artists?: string[];
20651
+ p_assigned_only?: boolean;
20652
+ p_center_city?: string;
20653
+ p_city?: string;
20654
+ p_date_from: string;
20655
+ p_date_to: string;
20656
+ p_event_edition_id?: string;
20657
+ p_fanbase_max?: number;
20658
+ p_fanbase_min?: number;
20659
+ p_genres?: string[];
20660
+ p_has_market_conflict?: boolean;
20661
+ p_has_nearby_interest?: boolean;
20662
+ p_has_radius_conflict?: boolean;
20663
+ p_has_routing_opportunity?: boolean;
20664
+ p_limit?: number;
20665
+ p_momentums?: string[];
20666
+ p_offset?: number;
20667
+ p_organization_id: string;
20668
+ p_quote_high?: number;
20669
+ p_quote_low?: number;
20670
+ p_radius_miles?: number;
20671
+ p_require_available_with_routing?: boolean;
20672
+ p_search?: string;
20673
+ p_spotify_max?: number;
20674
+ p_spotify_min?: number;
20675
+ p_states?: string[];
20676
+ p_statuses?: string[];
20677
+ p_tracked_artist_ids?: string[];
20678
+ };
20679
+ Returns: {
20680
+ agency: string;
20681
+ analytics_activity_score: number;
20682
+ analytics_activity_tier: string;
20683
+ analytics_artist_rank: number;
20684
+ analytics_chartmetric_id: string;
20685
+ analytics_instagram_engagement: number;
20686
+ analytics_instagram_followers: number;
20687
+ analytics_last_updated_at: string;
20688
+ analytics_next_update_due: string;
20689
+ analytics_spotify_followers: number;
20690
+ analytics_spotify_monthly_listeners: number;
20691
+ analytics_tiktok_engagement: number;
20692
+ analytics_tiktok_followers: number;
20693
+ analytics_tiktok_track_posts: number;
20694
+ analytics_total_fanbase: number;
20695
+ artist_id: string;
20696
+ artist_name: string;
20697
+ artist_normalized_name: string;
20698
+ confidence: number;
20699
+ data_freshness_days: number;
20700
+ date: string;
20701
+ distance_miles: number;
20702
+ financials_avg_gross: number;
20703
+ financials_avg_guarantee: number;
20704
+ financials_avg_tickets_sold: number;
20705
+ financials_quote_high: number;
20706
+ financials_quote_low: number;
20707
+ financials_total_shows: number;
20708
+ genre: string;
20709
+ has_market_conflict: boolean;
20710
+ historical_scrape_status: string;
20711
+ id: string;
20712
+ inferred_at: string;
20713
+ interest_source: string;
20714
+ is_inferred: boolean;
20715
+ is_routed: boolean;
20716
+ last_scraped_at: string;
20717
+ last_sync_status: string;
20718
+ lineage: Json;
20719
+ market_city: string;
20720
+ market_conflicts: Json;
20721
+ market_id: string;
20722
+ market_market: string;
20723
+ market_state: string;
20724
+ momentum: string;
20725
+ nearby_interest: Json;
20726
+ organization_id: string;
20727
+ primary_source: string;
20728
+ radius_conflict: boolean;
20729
+ radius_conflicts: Json;
20730
+ reg_last_mod_date: string;
20731
+ reg_last_synced_at: string;
20732
+ reg_metadata_last_synced_at: string;
20733
+ routing_shows: Json;
20734
+ same_day_interest: Json;
20735
+ status: string;
20736
+ status_display: string;
20737
+ total_count: number;
20738
+ tracked_artist_id: string;
20739
+ venue_capacity: number;
20740
+ venue_id: string;
20741
+ venue_name: string;
20742
+ venue_type: string;
20743
+ }[];
20744
+ };
20745
+ invalidate_dashboard_search_overlays_for_windows: {
19639
20746
  Args: {
19640
- p_active_only?: boolean;
19641
- p_agencies?: string[];
19642
- p_artists?: string[];
19643
- p_assigned_only?: boolean;
20747
+ p_availability_window_ids: string[];
20748
+ };
20749
+ Returns: number;
20750
+ };
20751
+ log_search_unknown_cities: {
20752
+ Args: {
20753
+ p_availability_window_ids: string[];
19644
20754
  p_center_city?: string;
19645
- p_city?: string;
19646
- p_date_from: string;
19647
- p_date_to: string;
19648
- p_event_edition_id?: string;
19649
- p_fanbase_max?: number;
19650
- p_fanbase_min?: number;
19651
- p_genres?: string[];
19652
- p_momentums?: string[];
19653
20755
  p_organization_id: string;
19654
- p_quote_high?: number;
19655
- p_quote_low?: number;
19656
- p_radius_miles?: number;
19657
- p_search?: string;
19658
- p_spotify_max?: number;
19659
- p_spotify_min?: number;
19660
- p_states?: string[];
19661
- p_statuses?: string[];
19662
20756
  };
19663
- Returns: {
19664
- conflict_artists: number;
19665
- conflict_dates: number;
19666
- conflict_events: number;
19667
- conflict_records: number;
19668
- market_conflict_artists: number;
19669
- market_conflict_dates: number;
19670
- market_conflict_events: number;
19671
- radius_conflict_artists: number;
19672
- radius_conflict_dates: number;
19673
- radius_conflict_events: number;
19674
- }[];
20757
+ Returns: number;
19675
20758
  };
19676
- get_search_geo_context_data: {
20759
+ process_dashboard_search_overlay_warming_targets: {
20760
+ Args: {
20761
+ p_limit?: number;
20762
+ };
20763
+ Returns: Json;
20764
+ };
20765
+ process_dashboard_search_refresh_queue: {
20766
+ Args: {
20767
+ p_limit?: number;
20768
+ };
20769
+ Returns: Json;
20770
+ };
20771
+ refresh_artist_availability_stats: {
19677
20772
  Args: {
19678
- p_artist_ids?: string[];
19679
- p_conflict_from?: string;
19680
- p_interest_from?: string;
19681
- p_interest_to?: string;
19682
20773
  p_organization_id: string;
19683
20774
  p_tracked_artist_ids?: string[];
19684
20775
  };
19685
20776
  Returns: {
19686
- artist_id: string;
19687
- artist_name: string;
19688
- date: string;
19689
- interest_source: string;
19690
- market_city: string;
19691
- market_market: string;
19692
- market_state: string;
19693
- organization_id: string;
19694
- primary_source: string;
19695
- status: string;
19696
- status_display: string;
19697
- tracked_artist_id: string;
19698
- venue_name: string;
20777
+ refreshed_artist_count: number;
19699
20778
  }[];
19700
20779
  };
19701
- get_search_interest_data: {
20780
+ refresh_dashboard_search_overlays_batch: {
19702
20781
  Args: {
19703
- p_artist_ids?: string[];
20782
+ p_after_date?: string;
20783
+ p_after_id?: string;
20784
+ p_center_city: string;
20785
+ p_date_from: string;
20786
+ p_date_to: string;
19704
20787
  p_interest_from?: string;
19705
20788
  p_interest_to?: string;
20789
+ p_limit?: number;
19706
20790
  p_organization_id: string;
19707
- p_tracked_artist_ids?: string[];
20791
+ p_radius_miles?: number;
19708
20792
  };
19709
- Returns: {
19710
- artist_id: string;
19711
- artist_name: string;
19712
- date: string;
19713
- interest_source: string;
19714
- market_city: string;
19715
- market_market: string;
19716
- market_state: string;
19717
- organization_id: string;
19718
- primary_source: string;
19719
- status: string;
19720
- status_display: string;
19721
- tracked_artist_id: string;
19722
- venue_name: string;
19723
- }[];
20793
+ Returns: Json;
19724
20794
  };
19725
- get_search_market_history: {
20795
+ refresh_dashboard_search_window: {
19726
20796
  Args: {
19727
- p_artist_ids?: string[];
19728
- p_history_from?: string;
19729
- p_history_to?: string;
19730
- p_organization_id: string;
19731
- p_tracked_artist_ids?: string[];
20797
+ p_availability_window_id: string;
19732
20798
  };
19733
- Returns: {
19734
- artist_id: string;
19735
- artist_name: string;
19736
- date: string;
19737
- market_city: string;
19738
- market_market: string;
19739
- market_state: string;
19740
- organization_id: string;
19741
- primary_source: string;
19742
- tracked_artist_id: string;
19743
- venue_name: string;
19744
- }[];
20799
+ Returns: Json;
19745
20800
  };
19746
- get_system_health_summary: {
20801
+ refresh_dashboard_search_windows: {
20802
+ Args: {
20803
+ p_organization_id?: string;
20804
+ };
20805
+ Returns: Json;
20806
+ };
20807
+ refresh_dashboard_search_windows_batch: {
19747
20808
  Args: {
20809
+ p_after_availability_window_id?: string;
20810
+ p_after_effective_date?: string;
20811
+ p_date_from: string;
20812
+ p_date_to: string;
20813
+ p_limit?: number;
19748
20814
  p_organization_id: string;
19749
20815
  };
19750
- Returns: {
19751
- analytics_count: number;
19752
- analytics_last_error: string;
19753
- analytics_processing: boolean;
19754
- avail_count: number;
19755
- historical_scrape_last_error: string;
19756
- historical_scrape_processing: boolean;
19757
- inferred_avails_last_error: string;
19758
- inferred_avails_processing: boolean;
19759
- latest_analytics_updated_at: string;
19760
- latest_reg_sync_completed_at: string;
19761
- latest_reg_sync_started_at: string;
19762
- latest_search_request_at: string;
19763
- organization_id: string;
19764
- organization_name: string;
19765
- pending_analytics_count: number;
19766
- pending_reg_sync_count: number;
19767
- reg_sync_last_error: string;
19768
- reg_sync_processing: boolean;
19769
- scraping_last_error: string;
19770
- scraping_processing: boolean;
19771
- tracked_artist_count: number;
19772
- }[];
20816
+ Returns: Json;
19773
20817
  };
19774
- hydrate_artist_avails: {
20818
+ search_artist_avails: {
19775
20819
  Args: {
19776
20820
  p_active_only?: boolean;
19777
20821
  p_agencies?: string[];
19778
- p_artist_ids?: string[];
19779
20822
  p_artists?: string[];
19780
20823
  p_assigned_only?: boolean;
19781
20824
  p_center_city?: string;
@@ -19790,10 +20833,10 @@ export type Database = {
19790
20833
  p_has_nearby_interest?: boolean;
19791
20834
  p_has_radius_conflict?: boolean;
19792
20835
  p_has_routing_opportunity?: boolean;
19793
- p_limit?: number;
19794
20836
  p_momentums?: string[];
19795
- p_offset?: number;
19796
20837
  p_organization_id: string;
20838
+ p_page?: number;
20839
+ p_page_size?: number;
19797
20840
  p_quote_high?: number;
19798
20841
  p_quote_low?: number;
19799
20842
  p_radius_miles?: number;
@@ -19803,7 +20846,6 @@ export type Database = {
19803
20846
  p_spotify_min?: number;
19804
20847
  p_states?: string[];
19805
20848
  p_statuses?: string[];
19806
- p_tracked_artist_ids?: string[];
19807
20849
  };
19808
20850
  Returns: {
19809
20851
  agency: string;
@@ -19871,30 +20913,69 @@ export type Database = {
19871
20913
  venue_type: string;
19872
20914
  }[];
19873
20915
  };
19874
- log_search_unknown_cities: {
20916
+ search_artist_avails_advanced_summary: {
19875
20917
  Args: {
19876
- p_availability_window_ids: string[];
20918
+ p_active_only?: boolean;
20919
+ p_agencies?: string[];
20920
+ p_artists?: string[];
20921
+ p_assigned_only?: boolean;
19877
20922
  p_center_city?: string;
20923
+ p_city?: string;
20924
+ p_date_from: string;
20925
+ p_date_to: string;
20926
+ p_event_edition_id?: string;
20927
+ p_fanbase_max?: number;
20928
+ p_fanbase_min?: number;
20929
+ p_genres?: string[];
20930
+ p_has_market_conflict?: boolean;
20931
+ p_has_nearby_interest?: boolean;
20932
+ p_has_radius_conflict?: boolean;
20933
+ p_has_routing_opportunity?: boolean;
20934
+ p_momentums?: string[];
19878
20935
  p_organization_id: string;
19879
- };
19880
- Returns: number;
19881
- };
19882
- refresh_artist_availability_stats: {
19883
- Args: {
19884
- p_organization_id: string;
19885
- p_tracked_artist_ids?: string[];
20936
+ p_quote_high?: number;
20937
+ p_quote_low?: number;
20938
+ p_radius_miles?: number;
20939
+ p_require_available_with_routing?: boolean;
20940
+ p_search?: string;
20941
+ p_spotify_max?: number;
20942
+ p_spotify_min?: number;
20943
+ p_states?: string[];
20944
+ p_statuses?: string[];
19886
20945
  };
19887
20946
  Returns: {
19888
- refreshed_artist_count: number;
20947
+ artists_with_analytics: number;
20948
+ assigned_records: number;
20949
+ available_records: number;
20950
+ avg_confidence: number;
20951
+ blocked_records: number;
20952
+ confirmed_records: number;
20953
+ conflict_artists: number;
20954
+ conflict_dates: number;
20955
+ conflict_events: number;
20956
+ conflict_records: number;
20957
+ hold_records: number;
20958
+ inferred_records: number;
20959
+ market_conflict_artists: number;
20960
+ market_conflict_dates: number;
20961
+ market_conflict_events: number;
20962
+ offer_records: number;
20963
+ radius_conflict_artists: number;
20964
+ radius_conflict_dates: number;
20965
+ radius_conflict_events: number;
20966
+ total_records: number;
20967
+ unique_artists: number;
20968
+ unique_markets: number;
20969
+ unique_venues: number;
20970
+ wishlist_records: number;
19889
20971
  }[];
19890
20972
  };
19891
- search_artist_avails: {
20973
+ search_artist_avails_page: {
19892
20974
  Args: {
19893
20975
  p_active_only?: boolean;
19894
20976
  p_agencies?: string[];
19895
20977
  p_artists?: string[];
19896
20978
  p_assigned_only?: boolean;
19897
- p_center_city?: string;
19898
20979
  p_city?: string;
19899
20980
  p_date_from: string;
19900
20981
  p_date_to: string;
@@ -19902,18 +20983,12 @@ export type Database = {
19902
20983
  p_fanbase_max?: number;
19903
20984
  p_fanbase_min?: number;
19904
20985
  p_genres?: string[];
19905
- p_has_market_conflict?: boolean;
19906
- p_has_nearby_interest?: boolean;
19907
- p_has_radius_conflict?: boolean;
19908
- p_has_routing_opportunity?: boolean;
19909
20986
  p_momentums?: string[];
19910
20987
  p_organization_id: string;
19911
20988
  p_page?: number;
19912
20989
  p_page_size?: number;
19913
20990
  p_quote_high?: number;
19914
20991
  p_quote_low?: number;
19915
- p_radius_miles?: number;
19916
- p_require_available_with_routing?: boolean;
19917
20992
  p_search?: string;
19918
20993
  p_spotify_max?: number;
19919
20994
  p_spotify_min?: number;
@@ -20090,6 +21165,32 @@ export type Database = {
20090
21165
  tracked_artist_id: string;
20091
21166
  }[];
20092
21167
  };
21168
+ upsert_dashboard_search_overlay_warming_target: {
21169
+ Args: {
21170
+ p_batch_limit?: number;
21171
+ p_center_city: string;
21172
+ p_date_window_days?: number;
21173
+ p_is_active?: boolean;
21174
+ p_max_batches_per_run?: number;
21175
+ p_organization_id: string;
21176
+ p_priority?: number;
21177
+ p_radius_miles?: number;
21178
+ };
21179
+ Returns: string;
21180
+ };
21181
+ upsert_dashboard_search_windows_from_source: {
21182
+ Args: {
21183
+ p_availability_window_id?: string;
21184
+ p_organization_id?: string;
21185
+ };
21186
+ Returns: number;
21187
+ };
21188
+ upsert_dashboard_search_windows_from_window_ids: {
21189
+ Args: {
21190
+ p_availability_window_ids: string[];
21191
+ };
21192
+ Returns: number;
21193
+ };
20093
21194
  };
20094
21195
  Enums: {
20095
21196
  assignment_state: "discovered" | "shortlisted" | "client_interested" | "approved_for_offer" | "offer_created" | "passed" | "removed" | "overridden";