class SetTeamStatusReq {
  final String scheduleId;
  final String opponentId;
  final List<TeamScore> teamScore;

  SetTeamStatusReq({
    required this.scheduleId,
    required this.opponentId,
    required this.teamScore,
  });

  factory SetTeamStatusReq.fromJson(Map<String, dynamic> json) =>
      SetTeamStatusReq(
        scheduleId: json['scheduleId'],
        opponentId: json['opponentId'],
        teamScore: List<TeamScore>.from(
          json['teamScore'].map((x) => TeamScore.fromJson(x)),
        ),
      );

  Map<String, dynamic> toJson() => {
    'scheduleId': scheduleId,
    'opponentId': opponentId,
    'teamScore': List<dynamic>.from(teamScore.map((x) => x.toJson())),
  };
}

class TeamScore {
  final String userId;
  final int firstHalfScore;
  final int secondHalfScore;
  final int decisiveScore;
  final bool ifWithdraw;

  TeamScore({
    required this.userId,
    required this.firstHalfScore,
    required this.secondHalfScore,
    required this.decisiveScore,
    required this.ifWithdraw,
  });

  factory TeamScore.fromJson(Map<String, dynamic> json) => TeamScore(
    userId: json['userId'],
    firstHalfScore: json['firstHalfScore'],
    secondHalfScore: json['secondHalfScore'],
    decisiveScore: json['decisiveScore'],
    ifWithdraw: json['ifWithdraw'],
  );

  Map<String, dynamic> toJson() => {
    'userId': userId,
    'firstHalfScore': firstHalfScore,
    'secondHalfScore': secondHalfScore,
    'decisiveScore': decisiveScore,
    'ifWithdraw': ifWithdraw,
  };
}
