diff --git a/wrestling_scoreboard_common/lib/src/data.dart b/wrestling_scoreboard_common/lib/src/data.dart index 307e0545..6fa0ed42 100644 --- a/wrestling_scoreboard_common/lib/src/data.dart +++ b/wrestling_scoreboard_common/lib/src/data.dart @@ -3,17 +3,20 @@ export 'data/club.dart'; export 'data/data_object.dart'; export 'data/fight.dart'; export 'data/fight_action.dart'; -export 'data/team_match/league.dart'; export 'data/lineup.dart'; export 'data/membership.dart'; export 'data/participant_state.dart'; export 'data/participation.dart'; export 'data/person.dart'; export 'data/team.dart'; +export 'data/team_match/league.dart'; +export 'data/team_match/league_team_participation.dart'; export 'data/team_match/league_weight_class.dart'; export 'data/team_match/team_match.dart'; export 'data/team_match/team_match_fight.dart'; export 'data/tournament/tournament.dart'; export 'data/tournament/tournament_fight.dart'; +export 'data/tournament/tournament_person.dart'; +export 'data/tournament/tournament_team_participation.dart'; export 'data/weight_class.dart'; export 'data/wrestling_event.dart'; diff --git a/wrestling_scoreboard_common/lib/src/data/data_object.dart b/wrestling_scoreboard_common/lib/src/data/data_object.dart index f9f54e99..3682175f 100644 --- a/wrestling_scoreboard_common/lib/src/data/data_object.dart +++ b/wrestling_scoreboard_common/lib/src/data/data_object.dart @@ -27,6 +27,8 @@ abstract class DataObject { return FightAction.fromJson(json) as T; case League: return League.fromJson(json) as T; + case LeagueTeamParticipation: + return LeagueTeamParticipation.fromJson(json) as T; case LeagueWeightClass: return LeagueWeightClass.fromJson(json) as T; case Lineup: @@ -45,6 +47,14 @@ abstract class DataObject { return TeamMatch.fromJson(json) as T; case TeamMatchFight: return TeamMatchFight.fromJson(json) as T; + case Tournament: + return Tournament.fromJson(json) as T; + case TournamentFight: + return TournamentFight.fromJson(json) as T; + case TournamentPerson: + return TournamentPerson.fromJson(json) as T; + case TournamentTeamParticipation: + return TournamentTeamParticipation.fromJson(json) as T; case WeightClass: return WeightClass.fromJson(json) as T; default: @@ -64,6 +74,8 @@ abstract class DataObject { return (await FightAction.fromRaw(raw, getSingle)) as T; case League: return (await League.fromRaw(raw, getSingle)) as T; + case LeagueTeamParticipation: + return (await LeagueWeightClass.fromRaw(raw, getSingle)) as T; case LeagueWeightClass: return (await LeagueWeightClass.fromRaw(raw, getSingle)) as T; case Lineup: @@ -82,6 +94,12 @@ abstract class DataObject { return (await TeamMatch.fromRaw(raw, getSingle)) as T; case TeamMatchFight: return (await TeamMatchFight.fromRaw(raw, getSingle)) as T; + case Tournament: + return (await Tournament.fromRaw(raw, getSingle)) as T; + case TournamentPerson: + return (await TournamentPerson.fromRaw(raw, getSingle)) as T; + case TournamentTeamParticipation: + return (await TournamentTeamParticipation.fromRaw(raw, getSingle)) as T; case WeightClass: return (await WeightClass.fromRaw(raw)) as T; default: diff --git a/wrestling_scoreboard_common/lib/src/util/data_wrapper.dart b/wrestling_scoreboard_common/lib/src/util/data_wrapper.dart index 5c8090dc..e17b1e46 100644 --- a/wrestling_scoreboard_common/lib/src/util/data_wrapper.dart +++ b/wrestling_scoreboard_common/lib/src/util/data_wrapper.dart @@ -74,6 +74,12 @@ Future handleFromJson(Map json, handleMany: handleMany, handleSingleRaw: handleSingleRaw, handleManyRaw: handleManyRaw); + case LeagueTeamParticipation: + return _handleFromJsonGeneric(json, + handleSingle: handleSingle, + handleMany: handleMany, + handleSingleRaw: handleSingleRaw, + handleManyRaw: handleManyRaw); case Lineup: return _handleFromJsonGeneric(json, handleSingle: handleSingle, @@ -122,6 +128,12 @@ Future handleFromJson(Map json, handleMany: handleMany, handleSingleRaw: handleSingleRaw, handleManyRaw: handleManyRaw); + case TournamentTeamParticipation: + return _handleFromJsonGeneric(json, + handleSingle: handleSingle, + handleMany: handleMany, + handleSingleRaw: handleSingleRaw, + handleManyRaw: handleManyRaw); case WeightClass: return _handleFromJsonGeneric(json, handleSingle: handleSingle, @@ -176,24 +188,6 @@ class ManyDataObject { ManyDataObject({required this.data, this.filterType, this.filterId}); } -const List dataObjectTypes = [ - BoutConfig, - Club, - Fight, - FightAction, - League, - LeagueWeightClass, - Lineup, - Membership, - Participation, - ParticipantState, - Person, - Team, - TeamMatch, - TeamMatchFight, - WeightClass, -]; - String getTableNameFromType(Type t) { switch (t) { case BoutConfig: