Skip to content

Commit

Permalink
handle team and match scoring access (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sidhdhi-p authored Apr 12, 2024
1 parent c9350b9 commit f3e8767
Show file tree
Hide file tree
Showing 33 changed files with 367 additions and 123 deletions.
2 changes: 1 addition & 1 deletion data/lib/api/ball_score/ball_score_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BallScoreModel with _$BallScoreModel {
required String bowler_id,
required String batsman_id,
required String non_striker_id,
int? runs_scored,
required int runs_scored,
ExtrasType? extras_type,
int? extras_awarded,
WicketType? wicket_type,
Expand Down
26 changes: 13 additions & 13 deletions data/lib/api/ball_score/ball_score_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mixin _$BallScoreModel {
String get bowler_id => throw _privateConstructorUsedError;
String get batsman_id => throw _privateConstructorUsedError;
String get non_striker_id => throw _privateConstructorUsedError;
int? get runs_scored => throw _privateConstructorUsedError;
int get runs_scored => throw _privateConstructorUsedError;
ExtrasType? get extras_type => throw _privateConstructorUsedError;
int? get extras_awarded => throw _privateConstructorUsedError;
WicketType? get wicket_type => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -57,7 +57,7 @@ abstract class $BallScoreModelCopyWith<$Res> {
String bowler_id,
String batsman_id,
String non_striker_id,
int? runs_scored,
int runs_scored,
ExtrasType? extras_type,
int? extras_awarded,
WicketType? wicket_type,
Expand Down Expand Up @@ -88,7 +88,7 @@ class _$BallScoreModelCopyWithImpl<$Res, $Val extends BallScoreModel>
Object? bowler_id = null,
Object? batsman_id = null,
Object? non_striker_id = null,
Object? runs_scored = freezed,
Object? runs_scored = null,
Object? extras_type = freezed,
Object? extras_awarded = freezed,
Object? wicket_type = freezed,
Expand Down Expand Up @@ -127,10 +127,10 @@ class _$BallScoreModelCopyWithImpl<$Res, $Val extends BallScoreModel>
? _value.non_striker_id
: non_striker_id // ignore: cast_nullable_to_non_nullable
as String,
runs_scored: freezed == runs_scored
runs_scored: null == runs_scored
? _value.runs_scored
: runs_scored // ignore: cast_nullable_to_non_nullable
as int?,
as int,
extras_type: freezed == extras_type
? _value.extras_type
: extras_type // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -183,7 +183,7 @@ abstract class _$$BallScoreModelImplCopyWith<$Res>
String bowler_id,
String batsman_id,
String non_striker_id,
int? runs_scored,
int runs_scored,
ExtrasType? extras_type,
int? extras_awarded,
WicketType? wicket_type,
Expand Down Expand Up @@ -212,7 +212,7 @@ class __$$BallScoreModelImplCopyWithImpl<$Res>
Object? bowler_id = null,
Object? batsman_id = null,
Object? non_striker_id = null,
Object? runs_scored = freezed,
Object? runs_scored = null,
Object? extras_type = freezed,
Object? extras_awarded = freezed,
Object? wicket_type = freezed,
Expand Down Expand Up @@ -251,10 +251,10 @@ class __$$BallScoreModelImplCopyWithImpl<$Res>
? _value.non_striker_id
: non_striker_id // ignore: cast_nullable_to_non_nullable
as String,
runs_scored: freezed == runs_scored
runs_scored: null == runs_scored
? _value.runs_scored
: runs_scored // ignore: cast_nullable_to_non_nullable
as int?,
as int,
extras_type: freezed == extras_type
? _value.extras_type
: extras_type // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -302,7 +302,7 @@ class _$BallScoreModelImpl implements _BallScoreModel {
required this.bowler_id,
required this.batsman_id,
required this.non_striker_id,
this.runs_scored,
required this.runs_scored,
this.extras_type,
this.extras_awarded,
this.wicket_type,
Expand Down Expand Up @@ -330,7 +330,7 @@ class _$BallScoreModelImpl implements _BallScoreModel {
@override
final String non_striker_id;
@override
final int? runs_scored;
final int runs_scored;
@override
final ExtrasType? extras_type;
@override
Expand Down Expand Up @@ -433,7 +433,7 @@ abstract class _BallScoreModel implements BallScoreModel {
required final String bowler_id,
required final String batsman_id,
required final String non_striker_id,
final int? runs_scored,
required final int runs_scored,
final ExtrasType? extras_type,
final int? extras_awarded,
final WicketType? wicket_type,
Expand Down Expand Up @@ -461,7 +461,7 @@ abstract class _BallScoreModel implements BallScoreModel {
@override
String get non_striker_id;
@override
int? get runs_scored;
int get runs_scored;
@override
ExtrasType? get extras_type;
@override
Expand Down
2 changes: 1 addition & 1 deletion data/lib/api/ball_score/ball_score_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions data/lib/api/innings/inning_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,4 @@ enum InningStatus {
final int value;

const InningStatus(this.value);
}

// first inning --> TOSS WINNER TEAM--
// first team score in whole match,
// first team wicket taken in whole match,
// inning status: if toss winner team is doing what they chose than first inning is running
// inning status: if toss winner team is doing opposite from what they chose than second inning is running
// if match complete then both inning complete
}
2 changes: 2 additions & 0 deletions data/lib/api/match/match_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MatchModel with _$MatchModel {
required DateTime start_time,
required BallType ball_type,
required PitchType pitch_type,
required String created_by,
List<UserModel>? umpires,
List<UserModel>? scorers,
List<UserModel>? commentators,
Expand Down Expand Up @@ -82,6 +83,7 @@ class AddEditMatchRequest with _$AddEditMatchRequest {
required DateTime start_time,
required BallType ball_type,
required PitchType pitch_type,
required String created_by,
List<String>? umpire_ids,
List<String>? scorer_ids,
List<String>? commentator_ids,
Expand Down
48 changes: 46 additions & 2 deletions data/lib/api/match/match_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ mixin _$MatchModel {
DateTime get start_time => throw _privateConstructorUsedError;
BallType get ball_type => throw _privateConstructorUsedError;
PitchType get pitch_type => throw _privateConstructorUsedError;
String get created_by => throw _privateConstructorUsedError;
List<UserModel>? get umpires => throw _privateConstructorUsedError;
List<UserModel>? get scorers => throw _privateConstructorUsedError;
List<UserModel>? get commentators => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -68,6 +69,7 @@ abstract class $MatchModelCopyWith<$Res> {
DateTime start_time,
BallType ball_type,
PitchType pitch_type,
String created_by,
List<UserModel>? umpires,
List<UserModel>? scorers,
List<UserModel>? commentators,
Expand Down Expand Up @@ -106,6 +108,7 @@ class _$MatchModelCopyWithImpl<$Res, $Val extends MatchModel>
Object? start_time = null,
Object? ball_type = null,
Object? pitch_type = null,
Object? created_by = null,
Object? umpires = freezed,
Object? scorers = freezed,
Object? commentators = freezed,
Expand Down Expand Up @@ -168,6 +171,10 @@ class _$MatchModelCopyWithImpl<$Res, $Val extends MatchModel>
? _value.pitch_type
: pitch_type // ignore: cast_nullable_to_non_nullable
as PitchType,
created_by: null == created_by
? _value.created_by
: created_by // ignore: cast_nullable_to_non_nullable
as String,
umpires: freezed == umpires
? _value.umpires
: umpires // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -238,6 +245,7 @@ abstract class _$$MatchModelImplCopyWith<$Res>
DateTime start_time,
BallType ball_type,
PitchType pitch_type,
String created_by,
List<UserModel>? umpires,
List<UserModel>? scorers,
List<UserModel>? commentators,
Expand Down Expand Up @@ -275,6 +283,7 @@ class __$$MatchModelImplCopyWithImpl<$Res>
Object? start_time = null,
Object? ball_type = null,
Object? pitch_type = null,
Object? created_by = null,
Object? umpires = freezed,
Object? scorers = freezed,
Object? commentators = freezed,
Expand Down Expand Up @@ -337,6 +346,10 @@ class __$$MatchModelImplCopyWithImpl<$Res>
? _value.pitch_type
: pitch_type // ignore: cast_nullable_to_non_nullable
as PitchType,
created_by: null == created_by
? _value.created_by
: created_by // ignore: cast_nullable_to_non_nullable
as String,
umpires: freezed == umpires
? _value._umpires
: umpires // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -390,6 +403,7 @@ class _$MatchModelImpl implements _MatchModel {
required this.start_time,
required this.ball_type,
required this.pitch_type,
required this.created_by,
final List<UserModel>? umpires,
final List<UserModel>? scorers,
final List<UserModel>? commentators,
Expand Down Expand Up @@ -465,6 +479,8 @@ class _$MatchModelImpl implements _MatchModel {
final BallType ball_type;
@override
final PitchType pitch_type;
@override
final String created_by;
final List<UserModel>? _umpires;
@override
List<UserModel>? get umpires {
Expand Down Expand Up @@ -508,7 +524,7 @@ class _$MatchModelImpl implements _MatchModel {

@override
String toString() {
return 'MatchModel(id: $id, teams: $teams, match_type: $match_type, number_of_over: $number_of_over, over_per_bowler: $over_per_bowler, power_play_overs1: $power_play_overs1, power_play_overs2: $power_play_overs2, power_play_overs3: $power_play_overs3, city: $city, ground: $ground, start_time: $start_time, ball_type: $ball_type, pitch_type: $pitch_type, umpires: $umpires, scorers: $scorers, commentators: $commentators, referee: $referee, match_status: $match_status, toss_decision: $toss_decision, toss_winner_id: $toss_winner_id, current_playing_team_id: $current_playing_team_id)';
return 'MatchModel(id: $id, teams: $teams, match_type: $match_type, number_of_over: $number_of_over, over_per_bowler: $over_per_bowler, power_play_overs1: $power_play_overs1, power_play_overs2: $power_play_overs2, power_play_overs3: $power_play_overs3, city: $city, ground: $ground, start_time: $start_time, ball_type: $ball_type, pitch_type: $pitch_type, created_by: $created_by, umpires: $umpires, scorers: $scorers, commentators: $commentators, referee: $referee, match_status: $match_status, toss_decision: $toss_decision, toss_winner_id: $toss_winner_id, current_playing_team_id: $current_playing_team_id)';
}

@override
Expand Down Expand Up @@ -538,6 +554,8 @@ class _$MatchModelImpl implements _MatchModel {
other.ball_type == ball_type) &&
(identical(other.pitch_type, pitch_type) ||
other.pitch_type == pitch_type) &&
(identical(other.created_by, created_by) ||
other.created_by == created_by) &&
const DeepCollectionEquality().equals(other._umpires, _umpires) &&
const DeepCollectionEquality().equals(other._scorers, _scorers) &&
const DeepCollectionEquality()
Expand Down Expand Up @@ -571,6 +589,7 @@ class _$MatchModelImpl implements _MatchModel {
start_time,
ball_type,
pitch_type,
created_by,
const DeepCollectionEquality().hash(_umpires),
const DeepCollectionEquality().hash(_scorers),
const DeepCollectionEquality().hash(_commentators),
Expand Down Expand Up @@ -610,6 +629,7 @@ abstract class _MatchModel implements MatchModel {
required final DateTime start_time,
required final BallType ball_type,
required final PitchType pitch_type,
required final String created_by,
final List<UserModel>? umpires,
final List<UserModel>? scorers,
final List<UserModel>? commentators,
Expand Down Expand Up @@ -649,6 +669,8 @@ abstract class _MatchModel implements MatchModel {
@override
PitchType get pitch_type;
@override
String get created_by;
@override
List<UserModel>? get umpires;
@override
List<UserModel>? get scorers;
Expand Down Expand Up @@ -1157,6 +1179,7 @@ mixin _$AddEditMatchRequest {
DateTime get start_time => throw _privateConstructorUsedError;
BallType get ball_type => throw _privateConstructorUsedError;
PitchType get pitch_type => throw _privateConstructorUsedError;
String get created_by => throw _privateConstructorUsedError;
List<String>? get umpire_ids => throw _privateConstructorUsedError;
List<String>? get scorer_ids => throw _privateConstructorUsedError;
List<String>? get commentator_ids => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -1192,6 +1215,7 @@ abstract class $AddEditMatchRequestCopyWith<$Res> {
DateTime start_time,
BallType ball_type,
PitchType pitch_type,
String created_by,
List<String>? umpire_ids,
List<String>? scorer_ids,
List<String>? commentator_ids,
Expand Down Expand Up @@ -1228,6 +1252,7 @@ class _$AddEditMatchRequestCopyWithImpl<$Res, $Val extends AddEditMatchRequest>
Object? start_time = null,
Object? ball_type = null,
Object? pitch_type = null,
Object? created_by = null,
Object? umpire_ids = freezed,
Object? scorer_ids = freezed,
Object? commentator_ids = freezed,
Expand Down Expand Up @@ -1290,6 +1315,10 @@ class _$AddEditMatchRequestCopyWithImpl<$Res, $Val extends AddEditMatchRequest>
? _value.pitch_type
: pitch_type // ignore: cast_nullable_to_non_nullable
as PitchType,
created_by: null == created_by
? _value.created_by
: created_by // ignore: cast_nullable_to_non_nullable
as String,
umpire_ids: freezed == umpire_ids
? _value.umpire_ids
: umpire_ids // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -1348,6 +1377,7 @@ abstract class _$$AddEditMatchRequestImplCopyWith<$Res>
DateTime start_time,
BallType ball_type,
PitchType pitch_type,
String created_by,
List<String>? umpire_ids,
List<String>? scorer_ids,
List<String>? commentator_ids,
Expand Down Expand Up @@ -1382,6 +1412,7 @@ class __$$AddEditMatchRequestImplCopyWithImpl<$Res>
Object? start_time = null,
Object? ball_type = null,
Object? pitch_type = null,
Object? created_by = null,
Object? umpire_ids = freezed,
Object? scorer_ids = freezed,
Object? commentator_ids = freezed,
Expand Down Expand Up @@ -1444,6 +1475,10 @@ class __$$AddEditMatchRequestImplCopyWithImpl<$Res>
? _value.pitch_type
: pitch_type // ignore: cast_nullable_to_non_nullable
as PitchType,
created_by: null == created_by
? _value.created_by
: created_by // ignore: cast_nullable_to_non_nullable
as String,
umpire_ids: freezed == umpire_ids
? _value._umpire_ids
: umpire_ids // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -1497,6 +1532,7 @@ class _$AddEditMatchRequestImpl implements _AddEditMatchRequest {
required this.start_time,
required this.ball_type,
required this.pitch_type,
required this.created_by,
final List<String>? umpire_ids,
final List<String>? scorer_ids,
final List<String>? commentator_ids,
Expand Down Expand Up @@ -1575,6 +1611,8 @@ class _$AddEditMatchRequestImpl implements _AddEditMatchRequest {
final BallType ball_type;
@override
final PitchType pitch_type;
@override
final String created_by;
final List<String>? _umpire_ids;
@override
List<String>? get umpire_ids {
Expand Down Expand Up @@ -1618,7 +1656,7 @@ class _$AddEditMatchRequestImpl implements _AddEditMatchRequest {

@override
String toString() {
return 'AddEditMatchRequest(id: $id, teams: $teams, match_type: $match_type, number_of_over: $number_of_over, over_per_bowler: $over_per_bowler, power_play_overs1: $power_play_overs1, power_play_overs2: $power_play_overs2, power_play_overs3: $power_play_overs3, city: $city, ground: $ground, start_time: $start_time, ball_type: $ball_type, pitch_type: $pitch_type, umpire_ids: $umpire_ids, scorer_ids: $scorer_ids, commentator_ids: $commentator_ids, referee_id: $referee_id, match_status: $match_status, toss_decision: $toss_decision, toss_winner_id: $toss_winner_id, current_playing_team_id: $current_playing_team_id)';
return 'AddEditMatchRequest(id: $id, teams: $teams, match_type: $match_type, number_of_over: $number_of_over, over_per_bowler: $over_per_bowler, power_play_overs1: $power_play_overs1, power_play_overs2: $power_play_overs2, power_play_overs3: $power_play_overs3, city: $city, ground: $ground, start_time: $start_time, ball_type: $ball_type, pitch_type: $pitch_type, created_by: $created_by, umpire_ids: $umpire_ids, scorer_ids: $scorer_ids, commentator_ids: $commentator_ids, referee_id: $referee_id, match_status: $match_status, toss_decision: $toss_decision, toss_winner_id: $toss_winner_id, current_playing_team_id: $current_playing_team_id)';
}

@override
Expand Down Expand Up @@ -1648,6 +1686,8 @@ class _$AddEditMatchRequestImpl implements _AddEditMatchRequest {
other.ball_type == ball_type) &&
(identical(other.pitch_type, pitch_type) ||
other.pitch_type == pitch_type) &&
(identical(other.created_by, created_by) ||
other.created_by == created_by) &&
const DeepCollectionEquality()
.equals(other._umpire_ids, _umpire_ids) &&
const DeepCollectionEquality()
Expand Down Expand Up @@ -1684,6 +1724,7 @@ class _$AddEditMatchRequestImpl implements _AddEditMatchRequest {
start_time,
ball_type,
pitch_type,
created_by,
const DeepCollectionEquality().hash(_umpire_ids),
const DeepCollectionEquality().hash(_scorer_ids),
const DeepCollectionEquality().hash(_commentator_ids),
Expand Down Expand Up @@ -1724,6 +1765,7 @@ abstract class _AddEditMatchRequest implements AddEditMatchRequest {
required final DateTime start_time,
required final BallType ball_type,
required final PitchType pitch_type,
required final String created_by,
final List<String>? umpire_ids,
final List<String>? scorer_ids,
final List<String>? commentator_ids,
Expand Down Expand Up @@ -1763,6 +1805,8 @@ abstract class _AddEditMatchRequest implements AddEditMatchRequest {
@override
PitchType get pitch_type;
@override
String get created_by;
@override
List<String>? get umpire_ids;
@override
List<String>? get scorer_ids;
Expand Down
Loading

0 comments on commit f3e8767

Please sign in to comment.