// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;
import java.util.ArrayList;
import java.util.List;

/**
 * Class representing each competition object with user relevant info
 */
public class UserCompetition {
    /** The id of the competition entity in the database*/
    private long id;

    /** The name of competition */	
    private String competitionName;	

    /** The id of the competition organiser */	
    private int organiserId;	
  
    /** The Google email of the organiser */	
    private String organiserEmail;	
  
    /** The unformatted start date (milliseconds)*/	
    private long startDate;	
  
    /** The unformatted start date (milliseconds) */	
    private long endDate;	

    /** The user's data for this competition */
    private CompetitorInfo user;
  
    /** A ranked list of other competitors */
    private List<CompetitorInfo> competitors = new ArrayList<>();	
  
    public UserCompetition(long id, String competitionName, int organiserId, String organiserEmail,	
        long startDate, long endDate, CompetitorInfo user, List<CompetitorInfo> competitors) {	
      this.id = id;	
      this.competitionName = competitionName;	
      this.organiserId = organiserId;	
      this.organiserEmail = organiserEmail;	
      this.startDate = startDate;	
      this.endDate = endDate;	
      this.user = user;
      this.competitors = competitors;	
    }	
}
@@ -1340,16 +1340,86 @@
 fo user;
+%0A%0A    /** The user's rank in this competition */%0A    private int rank;
 %0A  %0A    
@@ -1689,16 +1689,26 @@
 fo user,
+ int rank,
  List%3CCo
@@ -1951,24 +1951,24 @@
 = endDate;%09%0A
-
       this.u
@@ -1979,16 +1979,40 @@
 = user;%0A
+      this.rank = rank;%0A
       th

Store rank of current user only instead of storing rank inside of a ranked list of competitors for no reason