-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
52 additions
and
2,880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Mundialito.DAL.GeneralBets; | ||
|
||
namespace Mundialito.Logic; | ||
|
||
public class GeneralBetsService { | ||
|
||
private readonly IDateTimeProvider _dateTimeProvider; | ||
private readonly IGeneralBetsRepository _generalBetsRepository; | ||
private readonly TournamentTimesUtils _tournamentTimesUtils; | ||
|
||
public GeneralBetsService(IDateTimeProvider dateTimeProvider, IGeneralBetsRepository generalBetsRepository, TournamentTimesUtils tournamentTimesUtils) { | ||
_dateTimeProvider = dateTimeProvider; | ||
_generalBetsRepository = generalBetsRepository; | ||
_tournamentTimesUtils = tournamentTimesUtils; | ||
} | ||
|
||
public IEnumerable<GeneralBet> GetGeneralBets() | ||
{ | ||
if (_dateTimeProvider.UTCNow >= _tournamentTimesUtils.GetGeneralBetsCloseTime()) | ||
return _generalBetsRepository.GetGeneralBets(); | ||
return new List<GeneralBet>(); | ||
} | ||
|
||
public GeneralBet? GetUserGeneralBet(string username) | ||
{ | ||
if (_dateTimeProvider.UTCNow >= _tournamentTimesUtils.GetGeneralBetsCloseTime()) | ||
return _generalBetsRepository.GetUserGeneralBet(username); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.