Delete Stats object and replace with Stats2023

Deleting the stats object in the database and any functions/files that are using it and replacing it with Stats2023 in the view tab.

Signed-off-by: Emily Markova <emily.markova@gmail.com>
Change-Id: I76f5ad9e3f5d4a6ede60266fdc179e21013d6093
diff --git a/scouting/www/view/view.component.ts b/scouting/www/view/view.component.ts
index f4a55a1..f5b4d6a 100644
--- a/scouting/www/view/view.component.ts
+++ b/scouting/www/view/view.component.ts
@@ -4,9 +4,9 @@
   RequestAllDriverRankingsResponse,
 } from '../../webserver/requests/messages/request_all_driver_rankings_response_generated';
 import {
-  Stats,
-  RequestDataScoutingResponse,
-} from '../../webserver/requests/messages/request_data_scouting_response_generated';
+  Stats2023,
+  Request2023DataScoutingResponse,
+} from '../../webserver/requests/messages/request_2023_data_scouting_response_generated';
 import {
   Note,
   RequestAllNotesResponse,
@@ -14,7 +14,7 @@
 
 import {ViewDataRequestor} from '../rpc';
 
-type Source = 'Notes' | 'Stats' | 'DriverRanking';
+type Source = 'Notes' | 'Stats2023' | 'DriverRanking';
 
 //TODO(Filip): Deduplicate
 const COMP_LEVEL_LABELS = {
@@ -52,7 +52,7 @@
   // Stores the corresponding data.
   noteList: Note[] = [];
   driverRankingList: Ranking[] = [];
-  statList: Stats[] = [];
+  statList: Stats2023[] = [];
 
   // Fetch notes on initialization.
   ngOnInit() {
@@ -66,11 +66,11 @@
     if (!this.ascendingSort) {
       this.driverRankingList.sort((a, b) => b.matchNumber() - a.matchNumber());
       this.noteList.sort((a, b) => b.team() - a.team());
-      this.statList.sort((a, b) => b.match() - a.match());
+      this.statList.sort((a, b) => b.matchNumber() - a.matchNumber());
     } else {
       this.driverRankingList.sort((a, b) => a.matchNumber() - b.matchNumber());
       this.noteList.sort((a, b) => a.team() - b.team());
-      this.statList.sort((a, b) => a.match() - b.match());
+      this.statList.sort((a, b) => a.matchNumber() - b.matchNumber());
     }
   }
 
@@ -93,8 +93,8 @@
         this.fetchNotes();
       }
 
-      case 'Stats': {
-        this.fetchStats();
+      case 'Stats2023': {
+        this.fetchStats2023();
       }
 
       case 'DriverRanking': {
@@ -133,12 +133,12 @@
   }
 
   // Fetch all data scouting (stats) data and store in statList.
-  async fetchStats() {
+  async fetchStats2023() {
     this.progressMessage = 'Fetching stats list. Please be patient.';
     this.errorMessage = '';
 
     try {
-      this.statList = await this.viewDataRequestor.fetchStatsList();
+      this.statList = await this.viewDataRequestor.fetchStats2023List();
       this.progressMessage = 'Successfully fetched stats list.';
     } catch (e) {
       this.errorMessage = e;