Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixtures for teams playing in same round and using same venue #91

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Axuno.Tools/GermanFederalStates.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

Expand Down Expand Up @@ -68,11 +67,11 @@ public GermanFederalStates()
{
try
{
Contains(this[stateId]);
_ = Contains(this[stateId]);
}
catch
{
throw new Exception(string.Format("GermanFederalStateId \"{0}\" wird in \"{1}\" nicht abgebildet.", stateId, GetType()));
throw new Exception($"GermanFederalStateId \"{stateId}\" is not included in \"{GetType()}\".");
}
}
#endif
Expand All @@ -88,8 +87,8 @@ public GermanFederalStates()
/// <summary>
/// Get a GermanFederalState object.
/// </summary>
/// <param name="nameOrAbbreviation">State abbriviation or state name.</param>
/// <returns>Returns the GermanFederalState for the state abbriviation or state name.</returns>
/// <param name="nameOrAbbreviation">State abbreviation or state name.</param>
/// <returns>Returns the GermanFederalState for the state abbreviation or state name.</returns>
public GermanFederalState this[string nameOrAbbreviation]
{
get
Expand All @@ -100,4 +99,4 @@ public GermanFederalState this[string nameOrAbbreviation]
return this.First(fs => fs.Name == nameOrAbbreviation);
}
}
}
}
4 changes: 2 additions & 2 deletions Axuno.Tools/GermanHolidays.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public bool IsPublicHoliday(GermanFederalStates.Id stateId)

public static bool operator ==(GermanHoliday? h1, GermanHoliday? h2)
{
if (h1 == null || h2 == null) return false;
if (h1 is null || h2 is null) return false;
return h1.Equals(h2);
}

Expand Down Expand Up @@ -162,7 +162,7 @@ public GermanHolidays(int year)
{
// Plausibility check
if (year < 1583 || year > 4099)
throw new Exception("Year must be between 1583 and 4099.");
throw new ArgumentException("Year must be between 1583 and 4099.", nameof(year));

Year = year;
_easterSunday = GetEasterSunday();
Expand Down
159 changes: 0 additions & 159 deletions TournamentManager/TournamentManager/Assets/Holidays.A-Indoor.config

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace TournamentManager.Data;

/// <summary>
/// Class for ExcludedMatchDate related data selections
/// Class for database operations for available match dates.
/// </summary>
public class AvailableMatchDateRepository
{
Expand Down Expand Up @@ -47,8 +47,6 @@ public async Task<EntityCollection<AvailableMatchDateEntity>> GetAvailableMatchD
await da.FetchEntityCollectionAsync(qp, cancellationToken);
da.CloseConnection();

_logger.LogDebug("{count} available match dates found", available.Count);

return available;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class ExcludedMatchDateRepository
public ExcludedMatchDateRepository(MultiTenancy.IDbContext dbContext)
{
_dbContext = dbContext;
_logger.LogDebug("Repository created. {Repository} {Identifier}", nameof(TournamentRepository), dbContext.Tenant?.Identifier);
}

/// <summary>
Expand All @@ -47,8 +48,6 @@ public async Task<EntityCollection<ExcludeMatchDateEntity>> GetExcludedMatchDate
await da.FetchEntityCollectionAsync(qp, cancellationToken);
da.CloseConnection();

_logger.LogDebug("{count} excluded match dates found", excluded.Count);

return excluded;
}

Expand Down Expand Up @@ -98,4 +97,4 @@ public async Task<EntityCollection<ExcludeMatchDateEntity>> GetExcludedMatchDate
.AddWithOr(roundFilter).AddWithOr(teamFilter)).Limit(1),
cancellationToken)).Cast<ExcludeMatchDateEntity>().FirstOrDefault();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TournamentRepository
public TournamentRepository(MultiTenancy.IDbContext dbContext)
{
_dbContext = dbContext;
_logger.LogDebug("{repository} created.", nameof(TournamentRepository));
_logger.LogDebug("Repository created. {Repository} {Identifier}", nameof(TournamentRepository), dbContext.Tenant?.Identifier);
}

[Obsolete("Use GetTournamentAsync instead", false)]
Expand Down Expand Up @@ -95,4 +95,4 @@ public virtual EntityCollection<RoundEntity> GetTournamentRounds(long tournament
await da.FetchEntityCollectionAsync(qp, cancellationToken);
return t.FirstOrDefault();
}
}
}
Loading