public async Task <RoyalePublisher> CreatePublisher(RoyaleYearQuarter yearQuarter, FantasyCriticUser user, string publisherName) { RoyalePublisher publisher = new RoyalePublisher(Guid.NewGuid(), yearQuarter, user, publisherName, null, new List <RoyalePublisherGame>(), 100m); await _royaleRepo.CreatePublisher(publisher); return(publisher); }
public async Task <Maybe <RoyalePublisher> > GetPublisher(RoyaleYearQuarter yearQuarter, FantasyCriticUser user) { string sql = "select * from tbl_royale_publisher where UserID = @userID and Year = @year and Quarter = @quarter;"; using (var connection = new MySqlConnection(_connectionString)) { var entity = await connection.QuerySingleOrDefaultAsync <RoyalePublisherEntity>(sql, new { userID = user.UserID, year = yearQuarter.YearQuarter.Year, quarter = yearQuarter.YearQuarter.Quarter }); if (entity is null) { return(Maybe <RoyalePublisher> .None); } var publisherGames = await GetGamesForPublisher(entity.PublisherID, yearQuarter); var domain = entity.ToDomain(yearQuarter, user, publisherGames); return(domain); } }
public RoyaleYearQuarterViewModel(RoyaleYearQuarter domain) { Year = domain.YearQuarter.Year; Quarter = domain.YearQuarter.Quarter; OpenForPlay = domain.OpenForPlay; Finished = domain.Finished; }
public RoyalePublisherGame ToDomain(RoyaleYearQuarter yearQuarter, MasterGameYear masterGameYear) { if (Timestamp.Kind != DateTimeKind.Utc) { LocalDateTime localDateTime = LocalDateTime.FromDateTime(Timestamp); Instant instant = localDateTime.InZoneStrictly(DateTimeZoneProviders.Tzdb.GetZoneOrNull("America/New_York")).ToInstant(); return(new RoyalePublisherGame(PublisherID, yearQuarter, masterGameYear, instant, AmountSpent, AdvertisingMoney, FantasyPoints)); } return(new RoyalePublisherGame(PublisherID, yearQuarter, masterGameYear, Instant.FromDateTimeUtc(Timestamp), AmountSpent, AdvertisingMoney, FantasyPoints)); }
public RoyalePublisherGame ToDomain(RoyaleYearQuarter yearQuarter, MasterGameYear masterGameYear) { if (Timestamp.Kind != DateTimeKind.Utc) { LocalDateTime localDateTime = LocalDateTime.FromDateTime(Timestamp); Instant instant = localDateTime.InZoneStrictly(TimeExtensions.EasternTimeZone).ToInstant(); return(new RoyalePublisherGame(PublisherID, yearQuarter, masterGameYear, instant, AmountSpent, AdvertisingMoney, FantasyPoints)); } return(new RoyalePublisherGame(PublisherID, yearQuarter, masterGameYear, Instant.FromDateTimeUtc(Timestamp), AmountSpent, AdvertisingMoney, FantasyPoints)); }
public RoyalePublisher(Guid publisherID, RoyaleYearQuarter yearQuarter, FantasyCriticUser user, string publisherName, string?publisherIcon, IEnumerable <RoyalePublisherGame> publisherGames, decimal budget) { PublisherID = publisherID; YearQuarter = yearQuarter; User = user; PublisherName = publisherName; PublisherIcon = publisherIcon; PublisherGames = publisherGames.ToList(); Budget = budget; }
public RoyalePublisherGame(Guid publisherID, RoyaleYearQuarter yearQuarter, MasterGameYear masterGame, Instant timestamp, decimal amountSpent, decimal advertisingMoney, decimal?fantasyPoints) { PublisherID = publisherID; YearQuarter = yearQuarter; MasterGame = masterGame; Timestamp = timestamp; AmountSpent = amountSpent; AdvertisingMoney = advertisingMoney; FantasyPoints = fantasyPoints; }
public PossibleRoyaleMasterGameViewModel(MasterGameYear masterGame, IClock clock, RoyaleYearQuarter yearQuarter, bool alreadyOwned, IEnumerable <MasterGameTag> masterGameTags) { MasterGame = new MasterGameYearViewModel(masterGame, clock); WillReleaseInQuarter = masterGame.WillReleaseInQuarter(yearQuarter.YearQuarter); IsEligible = !LeagueTagExtensions.GetRoyaleEligibilitySettings(masterGameTags).GameIsEligible(masterGame.MasterGame).Any(); AlreadyOwned = alreadyOwned; Cost = masterGame.GetRoyaleGameCost(); }
public Task <Maybe <RoyalePublisher> > GetPublisher(RoyaleYearQuarter yearQuarter, FantasyCriticUser user) { throw new NotImplementedException(); }
public Task <RoyalePublisher?> GetPublisher(RoyaleYearQuarter yearQuarter, FantasyCriticUser user) { return(_royaleRepo.GetPublisher(yearQuarter, user)); }
public Task FinishQuarter(RoyaleYearQuarter supportedQuarter) { return(_royaleRepo.FinishQuarter(supportedQuarter)); }
public RoyalePublisherGame ToDomain(RoyaleYearQuarter yearQuarter, MasterGameYear masterGameYear) { return(new RoyalePublisherGame(PublisherID, yearQuarter, masterGameYear, Timestamp, AmountSpent, AdvertisingMoney, FantasyPoints)); }
public PossibleRoyaleMasterGameViewModel(MasterGameYear masterGame, LocalDate currentDate, RoyaleYearQuarter yearQuarter, bool alreadyOwned, IEnumerable <MasterGameTag> masterGameTags) { MasterGame = new MasterGameYearViewModel(masterGame, currentDate); WillReleaseInQuarter = masterGame.WillReleaseInQuarter(yearQuarter.YearQuarter); AlreadyOwned = alreadyOwned; IsEligible = !LeagueTagExtensions.GetRoyaleClaimErrors(masterGameTags, masterGame.MasterGame, currentDate).Any(); IsReleased = masterGame.MasterGame.IsReleased(currentDate); HasScore = masterGame.MasterGame.CriticScore.HasValue; Cost = masterGame.GetRoyaleGameCost(); }
public PossibleRoyaleMasterGameViewModel(MasterGameYear masterGame, IClock clock, RoyaleYearQuarter yearQuarter, bool alreadyOwned) { MasterGame = new MasterGameYearViewModel(masterGame, clock); WillReleaseInQuarter = masterGame.WillReleaseInQuarter(yearQuarter.YearQuarter); IsEligible = !EligibilitySettings.GetRoyaleEligibilitySettings().GameIsEligible(masterGame.MasterGame).Any(); AlreadyOwned = alreadyOwned; Cost = masterGame.GetRoyaleGameCost(); }
public RoyalePublisher ToDomain(RoyaleYearQuarter royaleYearQuarter, FantasyCriticUser user, IEnumerable <RoyalePublisherGame> publisherGames) { return(new RoyalePublisher(PublisherID, royaleYearQuarter, user, PublisherName, publisherGames, Budget)); }