From 55d18101b8fbdeb542bba2679083867585c3195e Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 16:53:11 -0500 Subject: [PATCH 1/9] Add weekly update controller and exported update functions into its own service --- .../Controllers/GamesThisWeekController.cs | 47 +- .../Controllers/PlayerSeasonStatController.cs | 60 +-- .../Controllers/PlayerWeeklyStatController.cs | 100 +---- .../Controllers/PlayersController.cs | 58 +-- .../Controllers/TeamSeasonStatController.cs | 113 +---- .../Controllers/WeeklyUpdateController.cs | 54 +++ .../Services/UpdateSupabaseService.cs | 411 ++++++++++++++++++ 7 files changed, 481 insertions(+), 362 deletions(-) create mode 100644 Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs create mode 100644 Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs b/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs index 2e86a92..1c2655d 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs @@ -12,11 +12,13 @@ public class GamesThisWeekController : ControllerBase { private readonly NflVerseService _nflVerseService; private readonly Client _supabase; + private readonly UpdateSupabaseService _updateSupabaseService; public GamesThisWeekController(NflVerseService nflVerseService, Client supabase) { _nflVerseService = nflVerseService; _supabase = supabase; + _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); } [HttpPost("all")] @@ -76,50 +78,7 @@ public async Task PutAll() { try { - // get current season and week from supabase - var (currentSeason, currentWeek) = await ControllerHelpers.GetCurrentSeasonAndWeekAsync(_supabase); - - // get game data from nfl verse service - var games = await _nflVerseService.GetAllGamesThisWeekAsync(currentSeason, currentWeek); - - if (games == null || !games.Any()) - { - return BadRequest(new { message = "No games found for current week." }); - } - - // map GameThisWeekCsv to GameThisWeek supabase model - var gamesToInsert = games.Select(g => new GameThisWeek - { - Id = Guid.NewGuid(), - HomeTeam = g.HomeTeam, - AwayTeam = g.AwayTeam, - Weekday = g.Weekday, - GameDateTime = g.GameDateTime, - StadiumName = g.StadiumName, - StadiumStyle = g.StadiumStyle, - IsDivisionalGame = g.IsDivisionalGame, - HomeRestDays = g.HomeRestDays, - AwayRestDays = g.AwayRestDays, - HomeMoneyline = g.HomeMoneyline, - AwayMoneyline = g.AwayMoneyline, - HomeSpreadOdds = g.HomeSpreadOdds, - AwaySpreadOdds = g.AwaySpreadOdds, - SpreadLine = g.SpreadLine, - TotalLine = g.TotalLine, - UnderOdds = g.UnderOdds, - OverOdds = g.OverOdds - }).ToList(); - - // clear the games this week table and repopulate it - await _supabase - .From() - .Where(g => g.Id != null) - .Delete(); - - await _supabase - .From() - .Insert(gamesToInsert); - + await _updateSupabaseService.UpdateGamesThisWeekAsync(); return Ok(new { message = "Successfully updated all games this week" }); } catch (Exception ex) diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs b/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs index 15abdad..79ef828 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs @@ -12,12 +12,14 @@ public class PlayerSeasonStatController: ControllerBase { private readonly NflVerseService _nflVerseService; private readonly Client _supabase; + private readonly UpdateSupabaseService _updateSupabaseService; // injects NflVerseService via dependency injection public PlayerSeasonStatController(NflVerseService nflVerseService, Client supabase) { _nflVerseService = nflVerseService; _supabase = supabase; + _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); } // DELETE route for testing @@ -125,63 +127,7 @@ public async Task PutAll() { try { - // fetch offensive players using service - var seasonStats = await _nflVerseService.GetAllOffensivePlayerSeasonStatsAsync(); - - if (seasonStats == null || !seasonStats.Any()) - { - return BadRequest("No season stats found to insert."); - } - - // get pairs of player_id and their season_stats_id - var playerIds = seasonStats.Select(s => s.PlayerId).ToList(); - - var playersResponse = await _supabase - .From() - .Select(p => new object[] { p.Id, p.SeasonStatsId }) - .Filter("id", Supabase.Postgrest.Constants.Operator.In, playerIds) - .Get(); - - var playerStatMap = playersResponse.Models - .Where(p => p.SeasonStatsId != null) - .ToDictionary(p => p.Id, p => p.SeasonStatsId.Value); - - // Build list of updates - var updates = seasonStats.Select(s => new - { - season_stats_id = playerStatMap[s.PlayerId], - completions = ControllerHelpers.NullIfZero(s.Completions), - passing_attempts = ControllerHelpers.NullIfZero(s.PassingAttempts), - passing_yards = ControllerHelpers.NullIfZero(s.PassingYards), - passing_tds = ControllerHelpers.NullIfZero(s.PassingTds), - interceptions_against = ControllerHelpers.NullIfZero(s.InterceptionsAgainst), - sacks_against = ControllerHelpers.NullIfZero(s.SacksAgainst), - fumbles_against = ControllerHelpers.NullIfZero(s.FumblesAgainst), - passing_first_downs = ControllerHelpers.NullIfZero(s.PassingFirstDowns), - passing_epa = ControllerHelpers.NullIfZero(s.PassingEpa), - carries = ControllerHelpers.NullIfZero(s.Carries), - rushing_yards = ControllerHelpers.NullIfZero(s.RushingYards), - rushing_tds = ControllerHelpers.NullIfZero(s.RushingTds), - rushing_first_downs = ControllerHelpers.NullIfZero(s.RushingFirstDowns), - rushing_epa = ControllerHelpers.NullIfZero(s.RushingEpa), - receptions = ControllerHelpers.NullIfZero(s.Receptions), - targets = ControllerHelpers.NullIfZero(s.Targets), - receiving_yards = ControllerHelpers.NullIfZero(s.ReceivingYards), - receiving_tds = ControllerHelpers.NullIfZero(s.ReceivingTds), - receiving_first_downs = ControllerHelpers.NullIfZero(s.ReceivingFirstDowns), - receiving_epa = ControllerHelpers.NullIfZero(s.ReceivingEpa), - fg_made_list = s.FgMadeList, - fg_missed_list = s.FgMissedList, - fg_blocked_list = s.FgBlockedList, - pat_attempts = ControllerHelpers.NullIfZero(s.PadAttempts), - pat_percent = ControllerHelpers.NullIfZero(s.PatPercent), - fantasy_points = s.FantasyPoints, - fantasy_points_ppr = s.FantasyPointsPpr - }).ToList(); - - // Call RPC to update all at once - await _supabase.Rpc("batch_update_player_season_stats", new { updates }); - + await _updateSupabaseService.UpdateAllPlayerSeasonStatsAsync(); return Ok(new { message = "Season stats updated successfully!" }); } catch (Exception ex) diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs b/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs index 125219c..b825926 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs @@ -12,12 +12,14 @@ public class PlayerWeeklyStatController : ControllerBase { private readonly NflVerseService _nflVerseService; private readonly Client _supabase; + private readonly UpdateSupabaseService _updateSupabaseService; // injects NflVerseService via dependency injection public PlayerWeeklyStatController(NflVerseService nflVerseService, Client supabase) { _nflVerseService = nflVerseService; _supabase = supabase; + _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); } // POST route for adding all weekly player stats up to the most recent week @@ -27,102 +29,8 @@ public async Task PostAll() { try { - var weeklyStats = await _nflVerseService.GetAllOffensivePlayerWeeklyStatsAsync(); - - if (weeklyStats == null || !weeklyStats.Any()) - { - return BadRequest("No season stats found to insert."); - } - - // Get the most latest week's data stored in the db - var latestWeekResponse = await _supabase - .From() - .Select("week") - .Order("week", Supabase.Postgrest.Constants.Ordering.Descending) - .Limit(1) - .Get(); - - // set the week to 0 if there are none in the db currently - var latestWeek = latestWeekResponse.Models.FirstOrDefault()?.Week ?? 0; - - // find the latest week in new data - int newLatestWeek = weeklyStats.Max(s => s.Week); - - // only insert the weeks AFTER the last recorded one - var newStats = weeklyStats - .Where(s => s.Week > latestWeek) - .ToList(); - - if (!newStats.Any()) - { - return Ok(new { message = $"No new weekly stats to insert (latest week: {latestWeek})" }); - } - - // convert the newStats to PlayerStats model while generating list of WeeklyPlayerStat models - List weeklyPlayerStats = new List(); - - var playerStats = newStats - .Select(p => - { - var id = Guid.NewGuid(); - - // create and insert new WeeklyPlayerStat model - var weeklyStat = new WeeklyPlayerStat - { - Id = Guid.NewGuid(), - PlayerStatsId = id, - PlayerId = p.PlayerId, - Week = p.Week, - SeasonStartYear = p.SeasonStartYear, - }; - - weeklyPlayerStats.Add(weeklyStat); - - return new PlayerStat - { - Id = id, - Completions = ControllerHelpers.NullIfZero(p.Completions), - PassingAttempts = ControllerHelpers.NullIfZero(p.PassingAttempts), - PassingYards = ControllerHelpers.NullIfZero(p.PassingYards), - PassingTds = ControllerHelpers.NullIfZero(p.PassingTds), - InterceptionsAgainst = ControllerHelpers.NullIfZero(p.InterceptionsAgainst), - SacksAgainst = ControllerHelpers.NullIfZero(p.SacksAgainst), - FumblesAgainst = ControllerHelpers.NullIfZero(p.FumblesAgainst), - PassingFirstDowns = ControllerHelpers.NullIfZero(p.PassingFirstDowns), - PassingEpa = ControllerHelpers.NullIfZero(p.PassingEpa), - Carries = ControllerHelpers.NullIfZero(p.Carries), - RushingYards = ControllerHelpers.NullIfZero(p.RushingYards), - RushingTds = ControllerHelpers.NullIfZero(p.RushingTds), - RushingFirstDowns = ControllerHelpers.NullIfZero(p.RushingFirstDowns), - RushingEpa = ControllerHelpers.NullIfZero(p.RushingEpa), - Receptions = ControllerHelpers.NullIfZero(p.Receptions), - Targets = ControllerHelpers.NullIfZero(p.Targets), - ReceivingYards = ControllerHelpers.NullIfZero(p.ReceivingYards), - ReceivingTds = ControllerHelpers.NullIfZero(p.ReceivingTds), - ReceivingFirstDowns = ControllerHelpers.NullIfZero(p.ReceivingFirstDowns), - ReceivingEpa = ControllerHelpers.NullIfZero(p.ReceivingEpa), - FgMadeList = p.FgMadeList, - FgMissedList = p.FgMissedList, - FgBlockedList = p.FgBlockedList, - PadAttempts = ControllerHelpers.NullIfZero(p.PadAttempts), - PatPercent = ControllerHelpers.NullIfZero(p.PatPercent), - FantasyPoints = p.FantasyPoints, - FantasyPointsPpr = p.FantasyPointsPpr - }; - }) - .ToList(); - - // insert PlayerStat models into player_stats table - var insertedStatsResponse = await _supabase - .From() - .Insert(playerStats); - - // insert new relational record into weekly_player_stats table - var insertedWeeklyResponse = await _supabase - .From() - .Insert(weeklyPlayerStats); - - return Ok(new { message = $"Inserted weekly stats successfully for weeks {latestWeek + 1}–{newStats.Max(s => s.Week)}" }); + var (startWeek, endWeek) = await _updateSupabaseService.UpdateStatsFromLastThreeWeeksAsync(); + return Ok(new { message = $"Inserted weekly stats successfully for weeks {startWeek}–{endWeek}" }); } catch (Exception ex) { diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs b/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs index a8272e4..3d53617 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs @@ -12,12 +12,14 @@ public class PlayersController: ControllerBase { private readonly NflVerseService _nflVerseService; private readonly Client _supabase; + private readonly UpdateSupabaseService _updateSupabaseService; // injects NflVerseService via dependency injection public PlayersController(NflVerseService nflVerseService, Client supabase) { _nflVerseService = nflVerseService; _supabase = supabase; + _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); } // ALL PLAYERS ROUTES @@ -139,61 +141,7 @@ public async Task PutAll() { try { - // get all player ids from supabase - var response = await _supabase - .From() - .Get(); - - if (response.Models == null || !response.Models.Any()) - { - return NotFound("No players found in database."); - } - - var existingPlayers = response.Models; - var playerLookup = existingPlayers.ToDictionary(p => p.Id, StringComparer.OrdinalIgnoreCase); - - // get the current season and week from supabase - var (currentSeason, currentWeek) = await ControllerHelpers.GetCurrentSeasonAndWeekAsync(_supabase); - - // get all player information from nflverse service - var playerInformation = await _nflVerseService.GetAllPlayerInformationAsync(currentSeason); - - if (playerInformation == null || !playerInformation.Any()) - { - return NotFound("No player information found."); - } - - // merge info only for players that exist in Supabase - var filteredPlayerWithInfo = playerInformation - .Where(info => !string.IsNullOrWhiteSpace(info.Id) && playerLookup.ContainsKey(info.Id)) - .Select(info => - { - var existingPlayer = playerLookup[info.Id]; - return new Player - { - Id = existingPlayer.Id, - Name = existingPlayer.Name, - HeadshotUrl = existingPlayer.HeadshotUrl, - Position = existingPlayer.Position, - Status = info.Status, - StatusDescription = info.ShortDescription, - TeamId = info.LatestTeam, - SeasonStatsId = existingPlayer.SeasonStatsId - }; - }) - .ToList(); - - if (!filteredPlayerWithInfo.Any()) - { - return BadRequest("No matching players to update."); - } - - // update Supabase players table - var updateResponse = await _supabase - .From() - .OnConflict(x => x.Id) - .Upsert(filteredPlayerWithInfo); - + await _updateSupabaseService.UpdateAllPlayerNonStatDataAsync(); return Ok(new { message = "Player information updated successfully!" }); } catch (Exception ex) diff --git a/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs b/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs index cbead8a..fc2e0f6 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs @@ -10,11 +10,13 @@ public class TeamSeasonStatController : ControllerBase { private readonly NflVerseService _nflVerseService; private readonly Client _supabase; + private readonly UpdateSupabaseService _updateSupabaseService; public TeamSeasonStatController(NflVerseService nflVerseService, Client supabase) { _nflVerseService = nflVerseService; _supabase = supabase; + _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); } [HttpPost("all")] @@ -22,116 +24,7 @@ public async Task PostAll() { try { - // fetch team stats using service - var stats = await _nflVerseService.GetAllTeamSeasonStatsAsync(); - if (stats == null || !stats.Any()) - { - return BadRequest("No team stats found to insert."); - } - - // break up the stats into offensive and defensive stats, keeping track of the new ids - List offensiveStats = new List(); - List defensiveStats = new List(); - Dictionary teamOffensiveStatIdMap = new Dictionary(); - Dictionary teamDefensiveStatIdMap = new Dictionary(); - - - foreach (var stat in stats) - { - if (stat == null) continue; - - // add the ids to the corresponding maps - Guid offensiveId = Guid.NewGuid(); - Guid defensiveId = Guid.NewGuid(); - teamOffensiveStatIdMap[stat.Team] = offensiveId; - teamDefensiveStatIdMap[stat.Team] = defensiveId; - - // parse out the offensive stats and add to list - var offensiveStat = new TeamOffensiveStat - { - Id = offensiveId, - Completions = ControllerHelpers.NullIfZero(stat.Completions), - Attempts = ControllerHelpers.NullIfZero(stat.Attempts), - PassingYards = ControllerHelpers.NullIfZero(stat.PassingYards), - PassingTds = ControllerHelpers.NullIfZero(stat.PassingTds), - PassingInterceptions = ControllerHelpers.NullIfZero(stat.PassingInterceptions), - SacksAgainst = ControllerHelpers.NullIfZero(stat.SacksAgainst), - FumblesAgainst = ControllerHelpers.NullIfZero(stat.FumblesAgainst), - Carries = ControllerHelpers.NullIfZero(stat.Carries), - RushingYards = ControllerHelpers.NullIfZero(stat.RushingYards), - RushingTds = ControllerHelpers.NullIfZero(stat.RushingTds), - Receptions = ControllerHelpers.NullIfZero(stat.Receptions), - Targets = ControllerHelpers.NullIfZero(stat.Targets), - ReceivingYards = ControllerHelpers.NullIfZero(stat.ReceivingYards), - ReceivingTds = ControllerHelpers.NullIfZero(stat.ReceivingTds) - }; - - offensiveStats.Add(offensiveStat); - - // parse out the defensive stats and add to list - var defensiveStat = new TeamDefensiveStat - { - Id = defensiveId, - TacklesForLoss = ControllerHelpers.NullIfZero(stat.TacklesForLoss), - TacklesForLossYards = ControllerHelpers.NullIfZero(stat.TacklesForLossYards), - FumblesFor = ControllerHelpers.NullIfZero(stat.FumblesFor), - SacksFor = ControllerHelpers.NullIfZero(stat.SacksFor), - SackYardsFor = ControllerHelpers.NullIfZero(stat.SackYardsFor), - InterceptionsFor = ControllerHelpers.NullIfZero(stat.InterceptionsFor), - InterceptionYardsFor = ControllerHelpers.NullIfZero(stat.InterceptionYardsFor), - DefTds = ControllerHelpers.NullIfZero(stat.DefTds), - Safeties = ControllerHelpers.NullIfZero(stat.Safeties), - PassDefended = ControllerHelpers.NullIfZero(stat.PassDefended) - }; - - defensiveStats.Add(defensiveStat); - } - - // get existing teams from supabase - var teamsResponse = await _supabase - .From() - .Get(); - - if (teamsResponse.Models == null || !teamsResponse.Models.Any()) - { - return NotFound("No teams found in the database"); - } - - var existingTeams = teamsResponse.Models; - - // create updated teams list - var updatedTeams = existingTeams - .Where(t => teamOffensiveStatIdMap.ContainsKey(t.Id)) - .Select(t => - new Team - { - Id = t.Id, - Name = t.Name, - Conference = t.Conference, - Division = t.Division, - LogoUrl = t.LogoUrl, - OffensiveStatsId = teamOffensiveStatIdMap[t.Id], - DefensiveStatsId = teamDefensiveStatIdMap[t.Id] - } - ) - .ToList(); - - // insert the offensive stats - await _supabase - .From() - .Insert(offensiveStats); - - // insert the defensive stats - await _supabase - .From() - .Insert(defensiveStats); - - // update the team records to reference the stats - await _supabase - .From() - .OnConflict(x => x.Id) - .Upsert(updatedTeams); - + await _updateSupabaseService.UpdateAllTeamSeasonStatsAsync(); return Ok(new { message = "Team stats inserted successfully!" }); } catch (Exception ex) diff --git a/Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs b/Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs new file mode 100644 index 0000000..bb7c823 --- /dev/null +++ b/Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs @@ -0,0 +1,54 @@ +using Fantasy_Football_Assistant_Manager.Services; +using Fantasy_Football_Assistant_Manager.Models.Supabase; +using Fantasy_Football_Assistant_Manager.Utils; +using Microsoft.AspNetCore.Mvc; +using Supabase; +using Microsoft.AspNetCore.Razor.TagHelpers; + + +namespace Fantasy_Football_Assistant_Manager.Controllers; + +[ApiController] +[Route("api/[controller]")] +public class WeeklyUpdateController: ControllerBase +{ + private readonly NflVerseService _nflVerseService; + private readonly Client _supabase; + private readonly UpdateSupabaseService _updateSupabaseService; + + public WeeklyUpdateController(NflVerseService nflVerseService, Client supabase) + { + _nflVerseService = nflVerseService; + _supabase = supabase; + _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); + } + + // PUT route which updates all relevant databases + [HttpPut] + public async Task Put() + { + try + { + // update weekly player stats (add the new week) + await _updateSupabaseService.UpdateStatsFromLastThreeWeeksAsync(); + + // update the season player stats + await _updateSupabaseService.UpdateAllPlayerSeasonStatsAsync(); + + // update the non stat data for players (e.g. status) + await _updateSupabaseService.UpdateAllPlayerNonStatDataAsync(); + + // update the team season stats + await _updateSupabaseService.UpdateAllTeamSeasonStatsAsync(); + + // update the games this week (delete and add new games) + await _updateSupabaseService.UpdateGamesThisWeekAsync(); + + return Ok(); + } + catch (Exception ex) + { + return StatusCode(500, $"Error performing the weekly update: {ex.Message}"); + } + } +} diff --git a/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs b/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs new file mode 100644 index 0000000..1c3c310 --- /dev/null +++ b/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs @@ -0,0 +1,411 @@ +using Fantasy_Football_Assistant_Manager.Models.Supabase; +using Fantasy_Football_Assistant_Manager.Utils; +using Supabase; + +namespace Fantasy_Football_Assistant_Manager.Services; + +public class UpdateSupabaseService +{ + private readonly NflVerseService _nflVerseService; + private readonly Client _supabase; + + public UpdateSupabaseService(NflVerseService nflVerseService, Client supabase) + { + _nflVerseService = nflVerseService; + _supabase = supabase; + } + + // insert the last three weeks + public async Task<(int startWeek, int endWeek)> UpdateStatsFromLastThreeWeeksAsync() + { + // get all weekly stats + var weeklyStats = await _nflVerseService.GetAllOffensivePlayerWeeklyStatsAsync(); + if (weeklyStats == null || !weeklyStats.Any()) + { + throw new Exception("No season stats found to insert."); + } + + // Get the most latest week's data stored in the db + var latestWeekResponse = await _supabase + .From() + .Select("week") + .Order("week", Supabase.Postgrest.Constants.Ordering.Descending) + .Limit(1) + .Get(); + + // set the week to 0 if there are none in the db currently + var latestWeek = latestWeekResponse.Models.FirstOrDefault()?.Week ?? 0; + + // find the latest week in new data + int newLatestWeek = weeklyStats.Max(s => s.Week); + + // only insert the last 3 weeks + var newStats = weeklyStats + .Where(s => s.Week > latestWeek) + .ToList(); + + // add new stats if they exist + if (newStats.Any()) + { + // convert the newStats to PlayerStats model while generating list of WeeklyPlayerStat models + List weeklyPlayerStats = new List(); + + var playerStats = newStats + .Select(p => + { + var id = Guid.NewGuid(); + + // create and insert new WeeklyPlayerStat model + var weeklyStat = new WeeklyPlayerStat + { + Id = Guid.NewGuid(), + PlayerStatsId = id, + PlayerId = p.PlayerId, + Week = p.Week, + SeasonStartYear = p.SeasonStartYear, + }; + + weeklyPlayerStats.Add(weeklyStat); + + return new PlayerStat + { + Id = id, + Completions = ControllerHelpers.NullIfZero(p.Completions), + PassingAttempts = ControllerHelpers.NullIfZero(p.PassingAttempts), + PassingYards = ControllerHelpers.NullIfZero(p.PassingYards), + PassingTds = ControllerHelpers.NullIfZero(p.PassingTds), + InterceptionsAgainst = ControllerHelpers.NullIfZero(p.InterceptionsAgainst), + SacksAgainst = ControllerHelpers.NullIfZero(p.SacksAgainst), + FumblesAgainst = ControllerHelpers.NullIfZero(p.FumblesAgainst), + PassingFirstDowns = ControllerHelpers.NullIfZero(p.PassingFirstDowns), + PassingEpa = ControllerHelpers.NullIfZero(p.PassingEpa), + Carries = ControllerHelpers.NullIfZero(p.Carries), + RushingYards = ControllerHelpers.NullIfZero(p.RushingYards), + RushingTds = ControllerHelpers.NullIfZero(p.RushingTds), + RushingFirstDowns = ControllerHelpers.NullIfZero(p.RushingFirstDowns), + RushingEpa = ControllerHelpers.NullIfZero(p.RushingEpa), + Receptions = ControllerHelpers.NullIfZero(p.Receptions), + Targets = ControllerHelpers.NullIfZero(p.Targets), + ReceivingYards = ControllerHelpers.NullIfZero(p.ReceivingYards), + ReceivingTds = ControllerHelpers.NullIfZero(p.ReceivingTds), + ReceivingFirstDowns = ControllerHelpers.NullIfZero(p.ReceivingFirstDowns), + ReceivingEpa = ControllerHelpers.NullIfZero(p.ReceivingEpa), + FgMadeList = p.FgMadeList, + FgMissedList = p.FgMissedList, + FgBlockedList = p.FgBlockedList, + PadAttempts = ControllerHelpers.NullIfZero(p.PadAttempts), + PatPercent = ControllerHelpers.NullIfZero(p.PatPercent), + FantasyPoints = p.FantasyPoints, + FantasyPointsPpr = p.FantasyPointsPpr + }; + }) + .ToList(); + + // insert PlayerStat models into player_stats table + var insertedStatsResponse = await _supabase + .From() + .Insert(playerStats); + + // insert new relational record into weekly_player_stats table + var insertedWeeklyResponse = await _supabase + .From() + .Insert(weeklyPlayerStats); + } + + // find the range of the last 3 weeks + int startWeek = Math.Max(newLatestWeek - 2, 1); + + // delete all old weekly stats + await _supabase.Rpc("delete_old_week_stats", new { min_week = startWeek }); + + return (startWeek, newLatestWeek); + } + + // update all player's season stats + public async Task UpdateAllPlayerSeasonStatsAsync() + { + // fetch offensive players using service + var seasonStats = await _nflVerseService.GetAllOffensivePlayerSeasonStatsAsync(); + if (seasonStats == null || !seasonStats.Any()) + { + throw new Exception("No season stats found to insert."); + } + + // get pairs of player_id and their season_stats_id + var playerIds = seasonStats.Select(s => s.PlayerId).ToList(); + + var playersResponse = await _supabase + .From() + .Select(p => new object[] { p.Id, p.SeasonStatsId }) + .Filter("id", Supabase.Postgrest.Constants.Operator.In, playerIds) + .Get(); + + var playerStatMap = playersResponse.Models + .Where(p => p.SeasonStatsId != null) + .ToDictionary(p => p.Id, p => p.SeasonStatsId.Value); + + // Build list of updates + var updates = seasonStats.Select(s => new + { + season_stats_id = playerStatMap[s.PlayerId], + completions = ControllerHelpers.NullIfZero(s.Completions), + passing_attempts = ControllerHelpers.NullIfZero(s.PassingAttempts), + passing_yards = ControllerHelpers.NullIfZero(s.PassingYards), + passing_tds = ControllerHelpers.NullIfZero(s.PassingTds), + interceptions_against = ControllerHelpers.NullIfZero(s.InterceptionsAgainst), + sacks_against = ControllerHelpers.NullIfZero(s.SacksAgainst), + fumbles_against = ControllerHelpers.NullIfZero(s.FumblesAgainst), + passing_first_downs = ControllerHelpers.NullIfZero(s.PassingFirstDowns), + passing_epa = ControllerHelpers.NullIfZero(s.PassingEpa), + carries = ControllerHelpers.NullIfZero(s.Carries), + rushing_yards = ControllerHelpers.NullIfZero(s.RushingYards), + rushing_tds = ControllerHelpers.NullIfZero(s.RushingTds), + rushing_first_downs = ControllerHelpers.NullIfZero(s.RushingFirstDowns), + rushing_epa = ControllerHelpers.NullIfZero(s.RushingEpa), + receptions = ControllerHelpers.NullIfZero(s.Receptions), + targets = ControllerHelpers.NullIfZero(s.Targets), + receiving_yards = ControllerHelpers.NullIfZero(s.ReceivingYards), + receiving_tds = ControllerHelpers.NullIfZero(s.ReceivingTds), + receiving_first_downs = ControllerHelpers.NullIfZero(s.ReceivingFirstDowns), + receiving_epa = ControllerHelpers.NullIfZero(s.ReceivingEpa), + fg_made_list = s.FgMadeList, + fg_missed_list = s.FgMissedList, + fg_blocked_list = s.FgBlockedList, + pat_attempts = ControllerHelpers.NullIfZero(s.PadAttempts), + pat_percent = ControllerHelpers.NullIfZero(s.PatPercent), + fantasy_points = s.FantasyPoints, + fantasy_points_ppr = s.FantasyPointsPpr + }).ToList(); + + // Call RPC to update all at once + await _supabase.Rpc("batch_update_player_season_stats", new { updates }); + + return; + } + + // update all player's non stat data + public async Task UpdateAllPlayerNonStatDataAsync() + { + // get all player ids from supabase + var response = await _supabase + .From() + .Get(); + if (response.Models == null || !response.Models.Any()) + { + throw new Exception("No players found in database."); + } + + var existingPlayers = response.Models; + var playerLookup = existingPlayers.ToDictionary(p => p.Id, StringComparer.OrdinalIgnoreCase); + + // get the current season and week from supabase + var (currentSeason, currentWeek) = await ControllerHelpers.GetCurrentSeasonAndWeekAsync(_supabase); + + // get all player information from nflverse service + var playerInformation = await _nflVerseService.GetAllPlayerInformationAsync(currentSeason); + + if (playerInformation == null || !playerInformation.Any()) + { + throw new Exception("No player information found."); + } + + // merge info only for players that exist in Supabase + var filteredPlayerWithInfo = playerInformation + .Where(info => !string.IsNullOrWhiteSpace(info.Id) && playerLookup.ContainsKey(info.Id)) + .Select(info => + { + var existingPlayer = playerLookup[info.Id]; + return new Player + { + Id = existingPlayer.Id, + Name = existingPlayer.Name, + HeadshotUrl = existingPlayer.HeadshotUrl, + Position = existingPlayer.Position, + Status = info.Status, + StatusDescription = info.ShortDescription, + TeamId = info.LatestTeam, + SeasonStatsId = existingPlayer.SeasonStatsId + }; + }) + .ToList(); + + if (!filteredPlayerWithInfo.Any()) + { + throw new Exception("No matching players to update."); + } + + // update Supabase players table + var updateResponse = await _supabase + .From() + .OnConflict(x => x.Id) + .Upsert(filteredPlayerWithInfo); + + return; + } + + // update team offensive stats + public async Task UpdateAllTeamSeasonStatsAsync() + { + // fetch team stats using service + var stats = await _nflVerseService.GetAllTeamSeasonStatsAsync(); + if (stats == null || !stats.Any()) + { + throw new Exception("No team stats found to insert."); + } + + // break up the stats into offensive and defensive stats, keeping track of the new ids + List offensiveStats = new List(); + List defensiveStats = new List(); + Dictionary teamOffensiveStatIdMap = new Dictionary(); + Dictionary teamDefensiveStatIdMap = new Dictionary(); + + + foreach (var stat in stats) + { + if (stat == null) continue; + + // add the ids to the corresponding maps + Guid offensiveId = Guid.NewGuid(); + Guid defensiveId = Guid.NewGuid(); + teamOffensiveStatIdMap[stat.Team] = offensiveId; + teamDefensiveStatIdMap[stat.Team] = defensiveId; + + // parse out the offensive stats and add to list + var offensiveStat = new TeamOffensiveStat + { + Id = offensiveId, + Completions = ControllerHelpers.NullIfZero(stat.Completions), + Attempts = ControllerHelpers.NullIfZero(stat.Attempts), + PassingYards = ControllerHelpers.NullIfZero(stat.PassingYards), + PassingTds = ControllerHelpers.NullIfZero(stat.PassingTds), + PassingInterceptions = ControllerHelpers.NullIfZero(stat.PassingInterceptions), + SacksAgainst = ControllerHelpers.NullIfZero(stat.SacksAgainst), + FumblesAgainst = ControllerHelpers.NullIfZero(stat.FumblesAgainst), + Carries = ControllerHelpers.NullIfZero(stat.Carries), + RushingYards = ControllerHelpers.NullIfZero(stat.RushingYards), + RushingTds = ControllerHelpers.NullIfZero(stat.RushingTds), + Receptions = ControllerHelpers.NullIfZero(stat.Receptions), + Targets = ControllerHelpers.NullIfZero(stat.Targets), + ReceivingYards = ControllerHelpers.NullIfZero(stat.ReceivingYards), + ReceivingTds = ControllerHelpers.NullIfZero(stat.ReceivingTds) + }; + + offensiveStats.Add(offensiveStat); + + // parse out the defensive stats and add to list + var defensiveStat = new TeamDefensiveStat + { + Id = defensiveId, + TacklesForLoss = ControllerHelpers.NullIfZero(stat.TacklesForLoss), + TacklesForLossYards = ControllerHelpers.NullIfZero(stat.TacklesForLossYards), + FumblesFor = ControllerHelpers.NullIfZero(stat.FumblesFor), + SacksFor = ControllerHelpers.NullIfZero(stat.SacksFor), + SackYardsFor = ControllerHelpers.NullIfZero(stat.SackYardsFor), + InterceptionsFor = ControllerHelpers.NullIfZero(stat.InterceptionsFor), + InterceptionYardsFor = ControllerHelpers.NullIfZero(stat.InterceptionYardsFor), + DefTds = ControllerHelpers.NullIfZero(stat.DefTds), + Safeties = ControllerHelpers.NullIfZero(stat.Safeties), + PassDefended = ControllerHelpers.NullIfZero(stat.PassDefended) + }; + + defensiveStats.Add(defensiveStat); + } + + // get existing teams from supabase + var teamsResponse = await _supabase + .From() + .Get(); + + if (teamsResponse.Models == null || !teamsResponse.Models.Any()) + { + throw new Exception("No teams found in the database"); + } + + var existingTeams = teamsResponse.Models; + + // create updated teams list + var updatedTeams = existingTeams + .Where(t => teamOffensiveStatIdMap.ContainsKey(t.Id)) + .Select(t => + new Team + { + Id = t.Id, + Name = t.Name, + Conference = t.Conference, + Division = t.Division, + LogoUrl = t.LogoUrl, + OffensiveStatsId = teamOffensiveStatIdMap[t.Id], + DefensiveStatsId = teamDefensiveStatIdMap[t.Id] + } + ) + .ToList(); + + // insert the offensive stats + await _supabase + .From() + .Insert(offensiveStats); + + // insert the defensive stats + await _supabase + .From() + .Insert(defensiveStats); + + // update the team records to reference the stats + await _supabase + .From() + .OnConflict(x => x.Id) + .Upsert(updatedTeams); + + return; + } + + // update games this week + public async Task UpdateGamesThisWeekAsync() + { + // get current season and week from supabase + var (currentSeason, currentWeek) = await ControllerHelpers.GetCurrentSeasonAndWeekAsync(_supabase); + + // get game data from nfl verse service + var games = await _nflVerseService.GetAllGamesThisWeekAsync(currentSeason, currentWeek); + + if (games == null || !games.Any()) + { + throw new Exception("No games found for current week."); + } + + // map GameThisWeekCsv to GameThisWeek supabase model + var gamesToInsert = games.Select(g => new GameThisWeek + { + Id = Guid.NewGuid(), + HomeTeam = g.HomeTeam, + AwayTeam = g.AwayTeam, + Weekday = g.Weekday, + GameDateTime = g.GameDateTime, + StadiumName = g.StadiumName, + StadiumStyle = g.StadiumStyle, + IsDivisionalGame = g.IsDivisionalGame, + HomeRestDays = g.HomeRestDays, + AwayRestDays = g.AwayRestDays, + HomeMoneyline = g.HomeMoneyline, + AwayMoneyline = g.AwayMoneyline, + HomeSpreadOdds = g.HomeSpreadOdds, + AwaySpreadOdds = g.AwaySpreadOdds, + SpreadLine = g.SpreadLine, + TotalLine = g.TotalLine, + UnderOdds = g.UnderOdds, + OverOdds = g.OverOdds + }).ToList(); + + // clear the games this week table and repopulate it + await _supabase + .From() + .Where(g => g.Id != null) + .Delete(); + + await _supabase + .From() + .Insert(gamesToInsert); + + return; + } +} From 247c9ebbaa13f631bc86b5bd23977f0e33c09000 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 16:55:29 -0500 Subject: [PATCH 2/9] Add daily update route --- ...eController.cs => AutoUpdateController.cs} | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) rename Fantasy-Football-Assistant-Manager/Controllers/{WeeklyUpdateController.cs => AutoUpdateController.cs} (61%) diff --git a/Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs b/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs similarity index 61% rename from Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs rename to Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs index bb7c823..98c14bf 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/WeeklyUpdateController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs @@ -1,31 +1,28 @@ using Fantasy_Football_Assistant_Manager.Services; -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Utils; using Microsoft.AspNetCore.Mvc; using Supabase; -using Microsoft.AspNetCore.Razor.TagHelpers; namespace Fantasy_Football_Assistant_Manager.Controllers; [ApiController] [Route("api/[controller]")] -public class WeeklyUpdateController: ControllerBase +public class AutoUpdateController: ControllerBase { private readonly NflVerseService _nflVerseService; private readonly Client _supabase; private readonly UpdateSupabaseService _updateSupabaseService; - public WeeklyUpdateController(NflVerseService nflVerseService, Client supabase) + public AutoUpdateController(NflVerseService nflVerseService, Client supabase) { _nflVerseService = nflVerseService; _supabase = supabase; _updateSupabaseService = new UpdateSupabaseService(_nflVerseService, _supabase); } - // PUT route which updates all relevant databases - [HttpPut] - public async Task Put() + // PUT route for weekly updates + [HttpPut("weekly")] + public async Task PutWeekly() { try { @@ -51,4 +48,24 @@ public async Task Put() return StatusCode(500, $"Error performing the weekly update: {ex.Message}"); } } + + // PUT route for daily updates (player injury status, game odds) + [HttpPut("daily")] + public async Task PutDaily() + { + try + { + // update the non stat data for players (e.g. status) + await _updateSupabaseService.UpdateAllPlayerNonStatDataAsync(); + + // update the games this week (delete and add new games) + await _updateSupabaseService.UpdateGamesThisWeekAsync(); + + return Ok(); + } + catch (Exception ex) + { + return StatusCode(500, $"Error performing the weekly update: {ex.Message}"); + } + } } From 8c6ce02be16e69659b662148d2d1a4b8e3dd50a0 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 17:16:16 -0500 Subject: [PATCH 3/9] Rename project to FFOracle-Backend --- .github/workflows/main_fforacle.yml | 4 +- .../Controllers/AutoUpdateController.cs | 4 +- .../Controllers/ChatGPTController.cs | 4 +- .../Controllers/GamesThisWeekController.cs | 8 +- .../Controllers/PlayerSeasonStatController.cs | 8 +- .../Controllers/PlayerWeeklyStatController.cs | 8 +- .../Controllers/PlayersController.cs | 8 +- .../Controllers/StripeController.cs | 83 +++++----- .../Controllers/StripeWebhookController.cs | 145 +++++++++--------- .../Controllers/SupaBaseController.cs | 4 +- .../Controllers/TeamController.cs | 6 +- .../Controllers/TeamSeasonStatController.cs | 8 +- .../Controllers/UsersController.cs | 4 +- .../DTOs/CreateUserRequest.cs | 2 +- .../DTOs/Player.cs | 2 +- .../DTOs/PlayerStat.cs | 2 +- .../DTOs/RosterSetting.cs | 3 +- .../DTOs/ScoringSetting.cs | 3 +- .../DTOs/Team.cs | 2 +- .../DTOs/TeamDefensiveStat.cs | 2 +- .../DTOs/TeamMember.cs | 2 +- .../DTOs/TeamOffensiveStat.cs | 2 +- .../DTOs/User.cs | 2 +- .../DTOs/WeeklyPlayerStat.cs | 2 +- ...sistant-Manager.csproj => FFOracle.csproj} | 4 +- ...all-Assistant-Manager.sln => FFOracle.sln} | 4 +- .../Mappings/GameThisWeekCsvMap.cs | 4 +- .../Mappings/PlayerInformationCsvMap.cs | 4 +- .../Mappings/PlayerMap.cs | 4 +- .../Mappings/PlayerStatCsvMap.cs | 4 +- .../Mappings/TeamDataCsvMap.cs | 4 +- .../Mappings/TeamSeasonStatCsvMap.cs | 4 +- .../Models/Csv/GameThisWeekCsv.cs | 2 +- .../Models/Csv/PlayerInformationCsv.cs | 2 +- .../Models/Csv/PlayerStatCsv.cs | 2 +- .../Models/Csv/TeamDataCsv.cs | 2 +- .../Models/Csv/TeamSeasonStatCsv.cs | 2 +- .../Models/Supabase/AppState.cs | 2 +- .../Models/Supabase/GameThisWeek.cs | 2 +- .../Models/Supabase/Player.cs | 2 +- .../Models/Supabase/PlayerStat.cs | 2 +- .../Models/Supabase/RosterSetting.cs | 2 +- .../Models/Supabase/ScoringSetting.cs | 2 +- .../Models/Supabase/Team.cs | 2 +- .../Models/Supabase/TeamDefensiveStat.cs | 2 +- .../Models/Supabase/TeamMember.cs | 2 +- .../Models/Supabase/TeamOffensiveStat.cs | 2 +- .../Models/Supabase/User.cs | 2 +- .../Models/Supabase/WeeklyPlayerStat.cs | 4 +- Fantasy-Football-Assistant-Manager/Program.cs | 2 +- .../Services/ChatGPTService.cs | 2 +- .../Services/NflVerseService.cs | 8 +- .../Services/UpdateSupabaseService.cs | 6 +- .../Utils/ControllerHelpers.cs | 6 +- 54 files changed, 203 insertions(+), 207 deletions(-) rename Fantasy-Football-Assistant-Manager/{Fantasy-Football-Assistant-Manager.csproj => FFOracle.csproj} (84%) rename Fantasy-Football-Assistant-Manager/{Fantasy-Football-Assistant-Manager.sln => FFOracle.sln} (80%) diff --git a/.github/workflows/main_fforacle.yml b/.github/workflows/main_fforacle.yml index 67d899f..153218a 100644 --- a/.github/workflows/main_fforacle.yml +++ b/.github/workflows/main_fforacle.yml @@ -24,10 +24,10 @@ jobs: dotnet-version: "8.x" - name: Build project - run: dotnet build Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.csproj --configuration Release + run: dotnet build FFOracle/FFOracle.csproj --configuration Release - name: Publish project - run: dotnet publish Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.csproj -c Release -o ./publish + run: dotnet publish FFOracle/FFOracle.csproj -c Release -o ./publish - name: Upload artifact for deployment uses: actions/upload-artifact@v4 diff --git a/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs b/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs index 98c14bf..1c3180b 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs @@ -1,9 +1,9 @@ -using Fantasy_Football_Assistant_Manager.Services; +using FFOracle.Services; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/ChatGPTController.cs b/Fantasy-Football-Assistant-Manager/Controllers/ChatGPTController.cs index 7a2d05c..2c61401 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/ChatGPTController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/ChatGPTController.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Fantasy_Football_Assistant_Manager.Services; +using FFOracle.Services; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs b/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs index 1c2655d..1e507c4 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs @@ -1,10 +1,10 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Services; -using Fantasy_Football_Assistant_Manager.Utils; +using FFOracle.Models.Supabase; +using FFOracle.Services; +using FFOracle.Utils; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs b/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs index 79ef828..0ebfb73 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs @@ -1,10 +1,10 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Services; -using Fantasy_Football_Assistant_Manager.Utils; +using FFOracle.Models.Supabase; +using FFOracle.Services; +using FFOracle.Utils; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs b/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs index b825926..68d8125 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs @@ -1,10 +1,10 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Services; -using Fantasy_Football_Assistant_Manager.Utils; +using FFOracle.Models.Supabase; +using FFOracle.Services; +using FFOracle.Utils; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs b/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs index 3d53617..d41d7a2 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs @@ -1,10 +1,10 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Services; -using Fantasy_Football_Assistant_Manager.Utils; +using FFOracle.Models.Supabase; +using FFOracle.Services; +using FFOracle.Utils; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/StripeController.cs b/Fantasy-Football-Assistant-Manager/Controllers/StripeController.cs index 1266f80..462f516 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/StripeController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/StripeController.cs @@ -1,53 +1,52 @@ using Microsoft.AspNetCore.Mvc; using Stripe; -namespace Fantasy_Football_Assistant_Manager.Controllers +namespace FFOracle.Controllers; + + +[ApiController] //establishes that class will handle API requests +[Route("api/[controller]")] //establishes this controller's base URL path +public class StripeController : Controller //Controller class gives access to objects/methods needed to handle HTTP { + private readonly IConfiguration _config; //accesses appsettings information, including keys - [ApiController] //establishes that class will handle API requests - [Route("api/[controller]")] //establishes this controller's base URL path - public class StripeController : Controller //Controller class gives access to objects/methods needed to handle HTTP + //constructor + public StripeController(IConfiguration config) { - private readonly IConfiguration _config; //accesses appsettings information, including keys - - //constructor - public StripeController(IConfiguration config) - { - _config = config; - } - - //endpoint for creating a payment intent - //The [FromBody] tag tells the code that this method will receive data from a passed in JSON file. - // The file contents are then automatically mapped to the attributes of the argument type. - [HttpPost("create-payment-intent")] //establishes that post requests will come in at this URL - public async Task CreatePaymentIntent([FromBody] PaymentRequest request) - { - //The payment intent is an object that is carried across the entire payment process. - //It holds information about a specific payment and tracks the status of that payment. - - StripeConfiguration.ApiKey = _config["Stripe:SecretKey"]; //provide API key - - //Collect information on the new payment - var options = new PaymentIntentCreateOptions - { - Amount = request.Amount, // amount to pay; for USD, it is in cents - Currency = "usd", //currency denomination - PaymentMethodTypes = new List { "card" }, //payment types to offer - }; - - var service = new PaymentIntentService(); //PaymentIntentService is a class for interfacing with the API - var paymentIntent = await service.CreateAsync(options); //request a new payment intent from the Stripe servers - - //return a success response. Do not pass the payment intent to the client, just sent the client secret. - //The client secret is a frontend-safe identifier for a transaction/payment intent. - return Ok(new { clientSecret = paymentIntent.ClientSecret }); - } + _config = config; } - //class to contain payment quantity information. Populated by JSON sent from client and passed - // to controller as input. - public class PaymentRequest + //endpoint for creating a payment intent + //The [FromBody] tag tells the code that this method will receive data from a passed in JSON file. + // The file contents are then automatically mapped to the attributes of the argument type. + [HttpPost("create-payment-intent")] //establishes that post requests will come in at this URL + public async Task CreatePaymentIntent([FromBody] PaymentRequest request) { - public long Amount { get; set; } + //The payment intent is an object that is carried across the entire payment process. + //It holds information about a specific payment and tracks the status of that payment. + + StripeConfiguration.ApiKey = _config["Stripe:SecretKey"]; //provide API key + + //Collect information on the new payment + var options = new PaymentIntentCreateOptions + { + Amount = request.Amount, // amount to pay; for USD, it is in cents + Currency = "usd", //currency denomination + PaymentMethodTypes = new List { "card" }, //payment types to offer + }; + + var service = new PaymentIntentService(); //PaymentIntentService is a class for interfacing with the API + var paymentIntent = await service.CreateAsync(options); //request a new payment intent from the Stripe servers + + //return a success response. Do not pass the payment intent to the client, just sent the client secret. + //The client secret is a frontend-safe identifier for a transaction/payment intent. + return Ok(new { clientSecret = paymentIntent.ClientSecret }); } } + +//class to contain payment quantity information. Populated by JSON sent from client and passed +// to controller as input. +public class PaymentRequest +{ + public long Amount { get; set; } +} diff --git a/Fantasy-Football-Assistant-Manager/Controllers/StripeWebhookController.cs b/Fantasy-Football-Assistant-Manager/Controllers/StripeWebhookController.cs index 0606f8e..2e1ed21 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/StripeWebhookController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/StripeWebhookController.cs @@ -2,92 +2,91 @@ using Stripe; using static Microsoft.IO.RecyclableMemoryStreamManager; -namespace Fantasy_Football_Assistant_Manager.Controllers +namespace FFOracle.Controllers; + +[ApiController] +[Route("api/[controller]")] +public class StripeWebhookController : Controller { - [ApiController] - [Route("api/[controller]")] - public class StripeWebhookController : Controller + + private readonly ILogger _logger; //a logger I'll use to indicate successful payments + private readonly IConfiguration _config; //accesses appsettings info + + //constructor to initialize the stored logger and config + public StripeWebhookController(ILogger logger, IConfiguration config) { + _logger = logger; + _config = config; + } - private readonly ILogger _logger; //a logger I'll use to indicate successful payments - private readonly IConfiguration _config; //accesses appsettings info + [HttpPost("check-payment-completion")] + public async Task HandleStripeWebhook() + { + //Read the request body + var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync(); - //constructor to initialize the stored logger and config - public StripeWebhookController(ILogger logger, IConfiguration config) + //retrieve the webhook secret. + //As of now, WE HAVE NO WEBHOOK ENDPOINT WITH STRIPE. That requires a proper public URL for our + // backend. I have used the stripe CLI to make a temporary bridge from which we can get responses. + var webhookSecret = _config["Stripe:WebhookSecret"]; + //verify that it's actually there + if (string.IsNullOrEmpty(webhookSecret)) { - _logger = logger; - _config = config; + _logger.LogError("Stripe WebhookSecret is not configured."); + return BadRequest("Webhook secret not configured."); } - [HttpPost("check-payment-completion")] - public async Task HandleStripeWebhook() + try { - //Read the request body - var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync(); + //Parse the message into an Event object and ensure it's a valid stripe message + var stripeEvent = EventUtility.ConstructEvent( + json, + Request.Headers["Stripe-Signature"], //use this to verify that it has the stripe header + webhookSecret + ); - //retrieve the webhook secret. - //As of now, WE HAVE NO WEBHOOK ENDPOINT WITH STRIPE. That requires a proper public URL for our - // backend. I have used the stripe CLI to make a temporary bridge from which we can get responses. - var webhookSecret = _config["Stripe:WebhookSecret"]; - //verify that it's actually there - if (string.IsNullOrEmpty(webhookSecret)) + //Each case of the switch statement handles a different event type. + switch (stripeEvent.Type) { - _logger.LogError("Stripe WebhookSecret is not configured."); - return BadRequest("Webhook secret not configured."); - } - - try - { - //Parse the message into an Event object and ensure it's a valid stripe message - var stripeEvent = EventUtility.ConstructEvent( - json, - Request.Headers["Stripe-Signature"], //use this to verify that it has the stripe header - webhookSecret - ); - - //Each case of the switch statement handles a different event type. - switch (stripeEvent.Type) - { - case "payment_intent.succeeded": - { - //for now, just log the success - var paymentIntent = stripeEvent.Data.Object as PaymentIntent; - _logger.LogInformation("PaymentIntent succeeded: {Id}, amount: {Amount}", paymentIntent.Id, paymentIntent.Amount); - //This is where DB would be updated - break; - } - - case "payment_intent.payment_failed": - { - //for now, just log the failure - var paymentIntent = stripeEvent.Data.Object as PaymentIntent; - _logger.LogWarning("PaymentIntent failed: {Id}", paymentIntent.Id); - //This is where a user notification might be called - break; - } - //I can add other events here as needed, but for now we only need those two - - //Log any event aside from the ones expected - default: - _logger.LogInformation("Unhandled Stripe event type: {Type}", stripeEvent.Type); + case "payment_intent.succeeded": + { + //for now, just log the success + var paymentIntent = stripeEvent.Data.Object as PaymentIntent; + _logger.LogInformation("PaymentIntent succeeded: {Id}, amount: {Amount}", paymentIntent.Id, paymentIntent.Amount); + //This is where DB would be updated break; - } + } - //This response tells stripe the message was received - return Ok(); - } - catch (StripeException ex) - { - //If anything goes wrong in validating the message, log it and tell stripe a bad message was received - _logger.LogError(ex, "Stripe webhook handling failed: {Message}", ex.Message); - return BadRequest(); - } - catch (System.Exception ex) - { - //Catch other errors - _logger.LogError(ex, "Unexpected error handling Stripe webhook"); - return StatusCode(500); + case "payment_intent.payment_failed": + { + //for now, just log the failure + var paymentIntent = stripeEvent.Data.Object as PaymentIntent; + _logger.LogWarning("PaymentIntent failed: {Id}", paymentIntent.Id); + //This is where a user notification might be called + break; + } + //I can add other events here as needed, but for now we only need those two + + //Log any event aside from the ones expected + default: + _logger.LogInformation("Unhandled Stripe event type: {Type}", stripeEvent.Type); + break; } + + //This response tells stripe the message was received + return Ok(); + } + catch (StripeException ex) + { + //If anything goes wrong in validating the message, log it and tell stripe a bad message was received + _logger.LogError(ex, "Stripe webhook handling failed: {Message}", ex.Message); + return BadRequest(); + } + catch (System.Exception ex) + { + //Catch other errors + _logger.LogError(ex, "Unexpected error handling Stripe webhook"); + return StatusCode(500); } } } diff --git a/Fantasy-Football-Assistant-Manager/Controllers/SupaBaseController.cs b/Fantasy-Football-Assistant-Manager/Controllers/SupaBaseController.cs index 7ca8ea1..1d6fd02 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/SupaBaseController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/SupaBaseController.cs @@ -1,8 +1,8 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; +using FFOracle.Models.Supabase; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/TeamController.cs b/Fantasy-Football-Assistant-Manager/Controllers/TeamController.cs index cb29613..e788e00 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/TeamController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/TeamController.cs @@ -1,10 +1,10 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Services; +using FFOracle.Models.Supabase; +using FFOracle.Services; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs b/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs index fc2e0f6..587ad2e 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs @@ -1,10 +1,10 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Services; -using Fantasy_Football_Assistant_Manager.Utils; +using FFOracle.Models.Supabase; +using FFOracle.Services; +using FFOracle.Utils; using Microsoft.AspNetCore.Mvc; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; public class TeamSeasonStatController : ControllerBase { diff --git a/Fantasy-Football-Assistant-Manager/Controllers/UsersController.cs b/Fantasy-Football-Assistant-Manager/Controllers/UsersController.cs index fad0ad8..cd8d5d0 100644 --- a/Fantasy-Football-Assistant-Manager/Controllers/UsersController.cs +++ b/Fantasy-Football-Assistant-Manager/Controllers/UsersController.cs @@ -1,7 +1,7 @@ -using Fantasy_Football_Assistant_Manager.DTOs; +using FFOracle.DTOs; using Microsoft.AspNetCore.Mvc; -namespace Fantasy_Football_Assistant_Manager.Controllers; +namespace FFOracle.Controllers; [ApiController] [Route("api/[controller]")] diff --git a/Fantasy-Football-Assistant-Manager/DTOs/CreateUserRequest.cs b/Fantasy-Football-Assistant-Manager/DTOs/CreateUserRequest.cs index 3047240..b6096b6 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/CreateUserRequest.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/CreateUserRequest.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class CreateUserRequest { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/Player.cs b/Fantasy-Football-Assistant-Manager/DTOs/Player.cs index 6d970f5..e55fdb0 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/Player.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/Player.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class Player { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/PlayerStat.cs b/Fantasy-Football-Assistant-Manager/DTOs/PlayerStat.cs index 6d7504a..a7ee704 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/PlayerStat.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/PlayerStat.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class PlayerStat { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/RosterSetting.cs b/Fantasy-Football-Assistant-Manager/DTOs/RosterSetting.cs index d985072..6ba2cfa 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/RosterSetting.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/RosterSetting.cs @@ -1,7 +1,6 @@ -using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class RosterSetting { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/ScoringSetting.cs b/Fantasy-Football-Assistant-Manager/DTOs/ScoringSetting.cs index 2c59819..f4c61b9 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/ScoringSetting.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/ScoringSetting.cs @@ -1,7 +1,6 @@ -using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class ScoringSetting { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/Team.cs b/Fantasy-Football-Assistant-Manager/DTOs/Team.cs index b3b3642..3355082 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/Team.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/Team.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class Team { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/TeamDefensiveStat.cs b/Fantasy-Football-Assistant-Manager/DTOs/TeamDefensiveStat.cs index 42ddba3..e9bf53a 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/TeamDefensiveStat.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/TeamDefensiveStat.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class TeamDefensiveStat { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/TeamMember.cs b/Fantasy-Football-Assistant-Manager/DTOs/TeamMember.cs index 79e0739..ccdc559 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/TeamMember.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/TeamMember.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class TeamMember { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/TeamOffensiveStat.cs b/Fantasy-Football-Assistant-Manager/DTOs/TeamOffensiveStat.cs index ee135e9..8c3fd56 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/TeamOffensiveStat.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/TeamOffensiveStat.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class TeamOffensiveStat { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/User.cs b/Fantasy-Football-Assistant-Manager/DTOs/User.cs index 1efeb5d..e3ab7ba 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/User.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/User.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class User { diff --git a/Fantasy-Football-Assistant-Manager/DTOs/WeeklyPlayerStat.cs b/Fantasy-Football-Assistant-Manager/DTOs/WeeklyPlayerStat.cs index 346293e..cf1688a 100644 --- a/Fantasy-Football-Assistant-Manager/DTOs/WeeklyPlayerStat.cs +++ b/Fantasy-Football-Assistant-Manager/DTOs/WeeklyPlayerStat.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.DTOs; +namespace FFOracle.DTOs; public class WeeklyPlayerStat { diff --git a/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.csproj b/Fantasy-Football-Assistant-Manager/FFOracle.csproj similarity index 84% rename from Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.csproj rename to Fantasy-Football-Assistant-Manager/FFOracle.csproj index 1836303..aba93e2 100644 --- a/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.csproj +++ b/Fantasy-Football-Assistant-Manager/FFOracle.csproj @@ -1,10 +1,10 @@ - + net8.0 enable enable - Fantasy_Football_Assistant_Manager + FFOracle diff --git a/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.sln b/Fantasy-Football-Assistant-Manager/FFOracle.sln similarity index 80% rename from Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.sln rename to Fantasy-Football-Assistant-Manager/FFOracle.sln index d97eb82..87b2551 100644 --- a/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.sln +++ b/Fantasy-Football-Assistant-Manager/FFOracle.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.14.36414.22 d17.14 +VisualStudioVersion = 17.14.36414.22 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fantasy-Football-Assistant-Manager", "Fantasy-Football-Assistant-Manager.csproj", "{09D8563A-CBBB-4BEC-A6D6-2B1CF117E91D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FFOracle", "FFOracle.csproj", "{09D8563A-CBBB-4BEC-A6D6-2B1CF117E91D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Fantasy-Football-Assistant-Manager/Mappings/GameThisWeekCsvMap.cs b/Fantasy-Football-Assistant-Manager/Mappings/GameThisWeekCsvMap.cs index 3bd5b1b..56d8152 100644 --- a/Fantasy-Football-Assistant-Manager/Mappings/GameThisWeekCsvMap.cs +++ b/Fantasy-Football-Assistant-Manager/Mappings/GameThisWeekCsvMap.cs @@ -1,8 +1,8 @@ using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Models.Csv; +using FFOracle.Models.Csv; using System.Globalization; -namespace Fantasy_Football_Assistant_Manager.Mappings; +namespace FFOracle.Mappings; public class GameThisWeekCsvMap: ClassMap { diff --git a/Fantasy-Football-Assistant-Manager/Mappings/PlayerInformationCsvMap.cs b/Fantasy-Football-Assistant-Manager/Mappings/PlayerInformationCsvMap.cs index 2c558db..62c0c3e 100644 --- a/Fantasy-Football-Assistant-Manager/Mappings/PlayerInformationCsvMap.cs +++ b/Fantasy-Football-Assistant-Manager/Mappings/PlayerInformationCsvMap.cs @@ -1,7 +1,7 @@ using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Models.Csv; +using FFOracle.Models.Csv; -namespace Fantasy_Football_Assistant_Manager.Mappings; +namespace FFOracle.Mappings; public class PlayerInformationCsvMap : ClassMap { diff --git a/Fantasy-Football-Assistant-Manager/Mappings/PlayerMap.cs b/Fantasy-Football-Assistant-Manager/Mappings/PlayerMap.cs index 8ccccb2..6ba1ebb 100644 --- a/Fantasy-Football-Assistant-Manager/Mappings/PlayerMap.cs +++ b/Fantasy-Football-Assistant-Manager/Mappings/PlayerMap.cs @@ -1,7 +1,7 @@ using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Models.Supabase; +using FFOracle.Models.Supabase; -namespace Fantasy_Football_Assistant_Manager.Mappings; +namespace FFOracle.Mappings; public class PlayerMap: ClassMap { diff --git a/Fantasy-Football-Assistant-Manager/Mappings/PlayerStatCsvMap.cs b/Fantasy-Football-Assistant-Manager/Mappings/PlayerStatCsvMap.cs index 183dbf3..2c0b85a 100644 --- a/Fantasy-Football-Assistant-Manager/Mappings/PlayerStatCsvMap.cs +++ b/Fantasy-Football-Assistant-Manager/Mappings/PlayerStatCsvMap.cs @@ -1,7 +1,7 @@ using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Models.Csv; +using FFOracle.Models.Csv; -namespace Fantasy_Football_Assistant_Manager.Mappings; +namespace FFOracle.Mappings; public class PlayerStatCsvMap: ClassMap { diff --git a/Fantasy-Football-Assistant-Manager/Mappings/TeamDataCsvMap.cs b/Fantasy-Football-Assistant-Manager/Mappings/TeamDataCsvMap.cs index 5a95746..813b4a6 100644 --- a/Fantasy-Football-Assistant-Manager/Mappings/TeamDataCsvMap.cs +++ b/Fantasy-Football-Assistant-Manager/Mappings/TeamDataCsvMap.cs @@ -1,7 +1,7 @@ using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Models.Csv; +using FFOracle.Models.Csv; -namespace Fantasy_Football_Assistant_Manager.Mappings; +namespace FFOracle.Mappings; public class TeamDataCsvMap: ClassMap { diff --git a/Fantasy-Football-Assistant-Manager/Mappings/TeamSeasonStatCsvMap.cs b/Fantasy-Football-Assistant-Manager/Mappings/TeamSeasonStatCsvMap.cs index e9dd690..7e56fab 100644 --- a/Fantasy-Football-Assistant-Manager/Mappings/TeamSeasonStatCsvMap.cs +++ b/Fantasy-Football-Assistant-Manager/Mappings/TeamSeasonStatCsvMap.cs @@ -1,7 +1,7 @@ using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Models.Csv; +using FFOracle.Models.Csv; -namespace Fantasy_Football_Assistant_Manager.Mappings; +namespace FFOracle.Mappings; public class TeamSeasonStatCsvMap: ClassMap { diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/GameThisWeekCsv.cs b/Fantasy-Football-Assistant-Manager/Models/Csv/GameThisWeekCsv.cs index b446fa3..1cd02af 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Csv/GameThisWeekCsv.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Csv/GameThisWeekCsv.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.Models.Csv; +namespace FFOracle.Models.Csv; public class GameThisWeekCsv { diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerInformationCsv.cs b/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerInformationCsv.cs index 904d43f..5b8e9fa 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerInformationCsv.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerInformationCsv.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.Models.Csv; +namespace FFOracle.Models.Csv; public class PlayerInformationCsv { diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerStatCsv.cs b/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerStatCsv.cs index 1f76b7b..c87773c 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerStatCsv.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerStatCsv.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.Models.Csv; +namespace FFOracle.Models.Csv; // class used for parsing the CSV public class PlayerStatCsv diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/TeamDataCsv.cs b/Fantasy-Football-Assistant-Manager/Models/Csv/TeamDataCsv.cs index dec244d..5399b23 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Csv/TeamDataCsv.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Csv/TeamDataCsv.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.Models.Csv; +namespace FFOracle.Models.Csv; public class TeamDataCsv { diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/TeamSeasonStatCsv.cs b/Fantasy-Football-Assistant-Manager/Models/Csv/TeamSeasonStatCsv.cs index b0a1430..b7aa80f 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Csv/TeamSeasonStatCsv.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Csv/TeamSeasonStatCsv.cs @@ -1,4 +1,4 @@ -namespace Fantasy_Football_Assistant_Manager.Models.Csv; +namespace FFOracle.Models.Csv; public class TeamSeasonStatCsv { diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/AppState.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/AppState.cs index 81d7e39..5e75c29 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/AppState.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/AppState.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("app_state")] public class AppState: BaseModel diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/GameThisWeek.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/GameThisWeek.cs index 287ddd5..644f956 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/GameThisWeek.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/GameThisWeek.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("games_this_week")] diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/Player.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/Player.cs index 17067c7..dea30b0 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/Player.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/Player.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("players")] public class Player: BaseModel diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/PlayerStat.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/PlayerStat.cs index ad97adf..21f556f 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/PlayerStat.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/PlayerStat.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("player_stats")] public class PlayerStat : BaseModel diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/RosterSetting.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/RosterSetting.cs index ba9321f..934a82a 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/RosterSetting.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/RosterSetting.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("roster_settings")] diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/ScoringSetting.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/ScoringSetting.cs index 3aa66cb..5ea24ff 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/ScoringSetting.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/ScoringSetting.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; // model for league scoring settings [Table("scoring_settings")] diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/Team.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/Team.cs index 78021f5..9e1a32a 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/Team.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/Team.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("teams")] public class Team : BaseModel diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamDefensiveStat.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamDefensiveStat.cs index d6f1c53..ad3baae 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamDefensiveStat.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamDefensiveStat.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; // used to store a team's defensive stats [Table("team_defensive_stats")] diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamMember.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamMember.cs index a8c10b1..85bb74d 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamMember.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamMember.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; // relationship table mapping players to user's rosters public class TeamMember: BaseModel diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamOffensiveStat.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamOffensiveStat.cs index bd66679..b1f0584 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamOffensiveStat.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamOffensiveStat.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; // stats used when finding DEF to start by matchup [Table("team_offensive_stats")] diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/User.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/User.cs index ee17ec0..9464b69 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/User.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/User.cs @@ -2,7 +2,7 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; [Table("users")] public class User: BaseModel diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/WeeklyPlayerStat.cs b/Fantasy-Football-Assistant-Manager/Models/Supabase/WeeklyPlayerStat.cs index 661d6fd..77a4f1a 100644 --- a/Fantasy-Football-Assistant-Manager/Models/Supabase/WeeklyPlayerStat.cs +++ b/Fantasy-Football-Assistant-Manager/Models/Supabase/WeeklyPlayerStat.cs @@ -2,9 +2,9 @@ using Supabase.Postgrest.Attributes; using System.Text.Json.Serialization; -namespace Fantasy_Football_Assistant_Manager.Models.Supabase; +namespace FFOracle.Models.Supabase; -// stores a player's stats for a single week +// stores a player's stats for a single week [Table("weekly_player_stats")] public class WeeklyPlayerStat: BaseModel { diff --git a/Fantasy-Football-Assistant-Manager/Program.cs b/Fantasy-Football-Assistant-Manager/Program.cs index 93cd2ae..0cadc05 100644 --- a/Fantasy-Football-Assistant-Manager/Program.cs +++ b/Fantasy-Football-Assistant-Manager/Program.cs @@ -1,4 +1,4 @@ -using Fantasy_Football_Assistant_Manager.Services; +using FFOracle.Services; using Supabase; //using Supabase.Postgrest.Models; diff --git a/Fantasy-Football-Assistant-Manager/Services/ChatGPTService.cs b/Fantasy-Football-Assistant-Manager/Services/ChatGPTService.cs index eb78490..24d1a9b 100644 --- a/Fantasy-Football-Assistant-Manager/Services/ChatGPTService.cs +++ b/Fantasy-Football-Assistant-Manager/Services/ChatGPTService.cs @@ -1,6 +1,6 @@ using OpenAI.Chat; -namespace Fantasy_Football_Assistant_Manager.Services; +namespace FFOracle.Services; public class ChatGPTService { diff --git a/Fantasy-Football-Assistant-Manager/Services/NflVerseService.cs b/Fantasy-Football-Assistant-Manager/Services/NflVerseService.cs index 34e88b2..a3ec41e 100644 --- a/Fantasy-Football-Assistant-Manager/Services/NflVerseService.cs +++ b/Fantasy-Football-Assistant-Manager/Services/NflVerseService.cs @@ -1,12 +1,12 @@ using CsvHelper; using CsvHelper.Configuration; -using Fantasy_Football_Assistant_Manager.Mappings; -using Fantasy_Football_Assistant_Manager.Models.Csv; -using Fantasy_Football_Assistant_Manager.Models.Supabase; +using FFOracle.Mappings; +using FFOracle.Models.Csv; +using FFOracle.Models.Supabase; using System.Globalization; using System.IO.Compression; -namespace Fantasy_Football_Assistant_Manager.Services; +namespace FFOracle.Services; public class NflVerseService { diff --git a/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs b/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs index 1c3c310..c0fa9ff 100644 --- a/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs +++ b/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs @@ -1,8 +1,8 @@ -using Fantasy_Football_Assistant_Manager.Models.Supabase; -using Fantasy_Football_Assistant_Manager.Utils; +using FFOracle.Models.Supabase; +using FFOracle.Utils; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Services; +namespace FFOracle.Services; public class UpdateSupabaseService { diff --git a/Fantasy-Football-Assistant-Manager/Utils/ControllerHelpers.cs b/Fantasy-Football-Assistant-Manager/Utils/ControllerHelpers.cs index 36de2b2..e523c17 100644 --- a/Fantasy-Football-Assistant-Manager/Utils/ControllerHelpers.cs +++ b/Fantasy-Football-Assistant-Manager/Utils/ControllerHelpers.cs @@ -1,8 +1,8 @@ -using Fantasy_Football_Assistant_Manager.Models; -using Fantasy_Football_Assistant_Manager.Models.Supabase; +using FFOracle.Models; +using FFOracle.Models.Supabase; using Supabase; -namespace Fantasy_Football_Assistant_Manager.Utils; +namespace FFOracle.Utils; public class ControllerHelpers { From 2c656a3d56060082085af81306fed3c6407bea54 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 17:17:00 -0500 Subject: [PATCH 4/9] rename project folder --- .../Controllers/AutoUpdateController.cs | 0 .../Controllers/ChatGPTController.cs | 0 .../Controllers/GamesThisWeekController.cs | 0 .../Controllers/PlayerSeasonStatController.cs | 0 .../Controllers/PlayerWeeklyStatController.cs | 0 .../Controllers/PlayersController.cs | 0 .../Controllers/StripeController.cs | 0 .../Controllers/StripeWebhookController.cs | 0 .../Controllers/SupaBaseController.cs | 0 .../Controllers/TeamController.cs | 0 .../Controllers/TeamSeasonStatController.cs | 0 .../Controllers/UsersController.cs | 0 .../DTOs/CreateUserRequest.cs | 0 .../DTOs/Player.cs | 0 .../DTOs/PlayerStat.cs | 0 .../DTOs/RosterSetting.cs | 0 .../DTOs/ScoringSetting.cs | 0 .../DTOs/Team.cs | 0 .../DTOs/TeamDefensiveStat.cs | 0 .../DTOs/TeamMember.cs | 0 .../DTOs/TeamOffensiveStat.cs | 0 .../DTOs/User.cs | 0 .../DTOs/WeeklyPlayerStat.cs | 0 .../FFOracle.csproj | 0 .../FFOracle.sln | 0 .../Mappings/GameThisWeekCsvMap.cs | 0 .../Mappings/PlayerInformationCsvMap.cs | 0 .../Mappings/PlayerMap.cs | 0 .../Mappings/PlayerStatCsvMap.cs | 0 .../Mappings/TeamDataCsvMap.cs | 0 .../Mappings/TeamSeasonStatCsvMap.cs | 0 .../Models/Csv/GameThisWeekCsv.cs | 0 .../Models/Csv/PlayerInformationCsv.cs | 0 .../Models/Csv/PlayerStatCsv.cs | 0 .../Models/Csv/TeamDataCsv.cs | 0 .../Models/Csv/TeamSeasonStatCsv.cs | 0 .../Models/Supabase/AppState.cs | 0 .../Models/Supabase/GameThisWeek.cs | 0 .../Models/Supabase/Player.cs | 0 .../Models/Supabase/PlayerStat.cs | 0 .../Models/Supabase/RosterSetting.cs | 0 .../Models/Supabase/ScoringSetting.cs | 0 .../Models/Supabase/Team.cs | 0 .../Models/Supabase/TeamDefensiveStat.cs | 0 .../Models/Supabase/TeamMember.cs | 0 .../Models/Supabase/TeamOffensiveStat.cs | 0 .../Models/Supabase/User.cs | 0 .../Models/Supabase/WeeklyPlayerStat.cs | 0 {Fantasy-Football-Assistant-Manager => FFOracle}/Program.cs | 0 .../Properties/PublishProfiles/fforacle - Web Deploy.pubxml | 0 .../fforacle - Web Deploy/profile.arm.json | 0 .../Properties/launchSettings.json | 0 .../Services/ChatGPTService.cs | 0 .../Services/NflVerseService.cs | 0 .../Services/UpdateSupabaseService.cs | 0 .../Utils/ControllerHelpers.cs | 0 .../Fantasy-Football-Assistant-Manager.http | 6 ------ 57 files changed, 6 deletions(-) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/AutoUpdateController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/ChatGPTController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/GamesThisWeekController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/PlayerSeasonStatController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/PlayerWeeklyStatController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/PlayersController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/StripeController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/StripeWebhookController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/SupaBaseController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/TeamController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/TeamSeasonStatController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Controllers/UsersController.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/CreateUserRequest.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/Player.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/PlayerStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/RosterSetting.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/ScoringSetting.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/Team.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/TeamDefensiveStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/TeamMember.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/TeamOffensiveStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/User.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/DTOs/WeeklyPlayerStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/FFOracle.csproj (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/FFOracle.sln (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Mappings/GameThisWeekCsvMap.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Mappings/PlayerInformationCsvMap.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Mappings/PlayerMap.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Mappings/PlayerStatCsvMap.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Mappings/TeamDataCsvMap.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Mappings/TeamSeasonStatCsvMap.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Csv/GameThisWeekCsv.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Csv/PlayerInformationCsv.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Csv/PlayerStatCsv.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Csv/TeamDataCsv.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Csv/TeamSeasonStatCsv.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/AppState.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/GameThisWeek.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/Player.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/PlayerStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/RosterSetting.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/ScoringSetting.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/Team.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/TeamDefensiveStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/TeamMember.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/TeamOffensiveStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/User.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Models/Supabase/WeeklyPlayerStat.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Program.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Properties/PublishProfiles/fforacle - Web Deploy.pubxml (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Properties/ServiceDependencies/fforacle - Web Deploy/profile.arm.json (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Properties/launchSettings.json (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Services/ChatGPTService.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Services/NflVerseService.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Services/UpdateSupabaseService.cs (100%) rename {Fantasy-Football-Assistant-Manager => FFOracle}/Utils/ControllerHelpers.cs (100%) delete mode 100644 Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.http diff --git a/Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs b/FFOracle/Controllers/AutoUpdateController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/AutoUpdateController.cs rename to FFOracle/Controllers/AutoUpdateController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/ChatGPTController.cs b/FFOracle/Controllers/ChatGPTController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/ChatGPTController.cs rename to FFOracle/Controllers/ChatGPTController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs b/FFOracle/Controllers/GamesThisWeekController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/GamesThisWeekController.cs rename to FFOracle/Controllers/GamesThisWeekController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs b/FFOracle/Controllers/PlayerSeasonStatController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/PlayerSeasonStatController.cs rename to FFOracle/Controllers/PlayerSeasonStatController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs b/FFOracle/Controllers/PlayerWeeklyStatController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/PlayerWeeklyStatController.cs rename to FFOracle/Controllers/PlayerWeeklyStatController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs b/FFOracle/Controllers/PlayersController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/PlayersController.cs rename to FFOracle/Controllers/PlayersController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/StripeController.cs b/FFOracle/Controllers/StripeController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/StripeController.cs rename to FFOracle/Controllers/StripeController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/StripeWebhookController.cs b/FFOracle/Controllers/StripeWebhookController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/StripeWebhookController.cs rename to FFOracle/Controllers/StripeWebhookController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/SupaBaseController.cs b/FFOracle/Controllers/SupaBaseController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/SupaBaseController.cs rename to FFOracle/Controllers/SupaBaseController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/TeamController.cs b/FFOracle/Controllers/TeamController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/TeamController.cs rename to FFOracle/Controllers/TeamController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs b/FFOracle/Controllers/TeamSeasonStatController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/TeamSeasonStatController.cs rename to FFOracle/Controllers/TeamSeasonStatController.cs diff --git a/Fantasy-Football-Assistant-Manager/Controllers/UsersController.cs b/FFOracle/Controllers/UsersController.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Controllers/UsersController.cs rename to FFOracle/Controllers/UsersController.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/CreateUserRequest.cs b/FFOracle/DTOs/CreateUserRequest.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/CreateUserRequest.cs rename to FFOracle/DTOs/CreateUserRequest.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/Player.cs b/FFOracle/DTOs/Player.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/Player.cs rename to FFOracle/DTOs/Player.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/PlayerStat.cs b/FFOracle/DTOs/PlayerStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/PlayerStat.cs rename to FFOracle/DTOs/PlayerStat.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/RosterSetting.cs b/FFOracle/DTOs/RosterSetting.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/RosterSetting.cs rename to FFOracle/DTOs/RosterSetting.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/ScoringSetting.cs b/FFOracle/DTOs/ScoringSetting.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/ScoringSetting.cs rename to FFOracle/DTOs/ScoringSetting.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/Team.cs b/FFOracle/DTOs/Team.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/Team.cs rename to FFOracle/DTOs/Team.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/TeamDefensiveStat.cs b/FFOracle/DTOs/TeamDefensiveStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/TeamDefensiveStat.cs rename to FFOracle/DTOs/TeamDefensiveStat.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/TeamMember.cs b/FFOracle/DTOs/TeamMember.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/TeamMember.cs rename to FFOracle/DTOs/TeamMember.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/TeamOffensiveStat.cs b/FFOracle/DTOs/TeamOffensiveStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/TeamOffensiveStat.cs rename to FFOracle/DTOs/TeamOffensiveStat.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/User.cs b/FFOracle/DTOs/User.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/User.cs rename to FFOracle/DTOs/User.cs diff --git a/Fantasy-Football-Assistant-Manager/DTOs/WeeklyPlayerStat.cs b/FFOracle/DTOs/WeeklyPlayerStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/DTOs/WeeklyPlayerStat.cs rename to FFOracle/DTOs/WeeklyPlayerStat.cs diff --git a/Fantasy-Football-Assistant-Manager/FFOracle.csproj b/FFOracle/FFOracle.csproj similarity index 100% rename from Fantasy-Football-Assistant-Manager/FFOracle.csproj rename to FFOracle/FFOracle.csproj diff --git a/Fantasy-Football-Assistant-Manager/FFOracle.sln b/FFOracle/FFOracle.sln similarity index 100% rename from Fantasy-Football-Assistant-Manager/FFOracle.sln rename to FFOracle/FFOracle.sln diff --git a/Fantasy-Football-Assistant-Manager/Mappings/GameThisWeekCsvMap.cs b/FFOracle/Mappings/GameThisWeekCsvMap.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Mappings/GameThisWeekCsvMap.cs rename to FFOracle/Mappings/GameThisWeekCsvMap.cs diff --git a/Fantasy-Football-Assistant-Manager/Mappings/PlayerInformationCsvMap.cs b/FFOracle/Mappings/PlayerInformationCsvMap.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Mappings/PlayerInformationCsvMap.cs rename to FFOracle/Mappings/PlayerInformationCsvMap.cs diff --git a/Fantasy-Football-Assistant-Manager/Mappings/PlayerMap.cs b/FFOracle/Mappings/PlayerMap.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Mappings/PlayerMap.cs rename to FFOracle/Mappings/PlayerMap.cs diff --git a/Fantasy-Football-Assistant-Manager/Mappings/PlayerStatCsvMap.cs b/FFOracle/Mappings/PlayerStatCsvMap.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Mappings/PlayerStatCsvMap.cs rename to FFOracle/Mappings/PlayerStatCsvMap.cs diff --git a/Fantasy-Football-Assistant-Manager/Mappings/TeamDataCsvMap.cs b/FFOracle/Mappings/TeamDataCsvMap.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Mappings/TeamDataCsvMap.cs rename to FFOracle/Mappings/TeamDataCsvMap.cs diff --git a/Fantasy-Football-Assistant-Manager/Mappings/TeamSeasonStatCsvMap.cs b/FFOracle/Mappings/TeamSeasonStatCsvMap.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Mappings/TeamSeasonStatCsvMap.cs rename to FFOracle/Mappings/TeamSeasonStatCsvMap.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/GameThisWeekCsv.cs b/FFOracle/Models/Csv/GameThisWeekCsv.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Csv/GameThisWeekCsv.cs rename to FFOracle/Models/Csv/GameThisWeekCsv.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerInformationCsv.cs b/FFOracle/Models/Csv/PlayerInformationCsv.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Csv/PlayerInformationCsv.cs rename to FFOracle/Models/Csv/PlayerInformationCsv.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/PlayerStatCsv.cs b/FFOracle/Models/Csv/PlayerStatCsv.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Csv/PlayerStatCsv.cs rename to FFOracle/Models/Csv/PlayerStatCsv.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/TeamDataCsv.cs b/FFOracle/Models/Csv/TeamDataCsv.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Csv/TeamDataCsv.cs rename to FFOracle/Models/Csv/TeamDataCsv.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Csv/TeamSeasonStatCsv.cs b/FFOracle/Models/Csv/TeamSeasonStatCsv.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Csv/TeamSeasonStatCsv.cs rename to FFOracle/Models/Csv/TeamSeasonStatCsv.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/AppState.cs b/FFOracle/Models/Supabase/AppState.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/AppState.cs rename to FFOracle/Models/Supabase/AppState.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/GameThisWeek.cs b/FFOracle/Models/Supabase/GameThisWeek.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/GameThisWeek.cs rename to FFOracle/Models/Supabase/GameThisWeek.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/Player.cs b/FFOracle/Models/Supabase/Player.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/Player.cs rename to FFOracle/Models/Supabase/Player.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/PlayerStat.cs b/FFOracle/Models/Supabase/PlayerStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/PlayerStat.cs rename to FFOracle/Models/Supabase/PlayerStat.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/RosterSetting.cs b/FFOracle/Models/Supabase/RosterSetting.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/RosterSetting.cs rename to FFOracle/Models/Supabase/RosterSetting.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/ScoringSetting.cs b/FFOracle/Models/Supabase/ScoringSetting.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/ScoringSetting.cs rename to FFOracle/Models/Supabase/ScoringSetting.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/Team.cs b/FFOracle/Models/Supabase/Team.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/Team.cs rename to FFOracle/Models/Supabase/Team.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamDefensiveStat.cs b/FFOracle/Models/Supabase/TeamDefensiveStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/TeamDefensiveStat.cs rename to FFOracle/Models/Supabase/TeamDefensiveStat.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamMember.cs b/FFOracle/Models/Supabase/TeamMember.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/TeamMember.cs rename to FFOracle/Models/Supabase/TeamMember.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/TeamOffensiveStat.cs b/FFOracle/Models/Supabase/TeamOffensiveStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/TeamOffensiveStat.cs rename to FFOracle/Models/Supabase/TeamOffensiveStat.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/User.cs b/FFOracle/Models/Supabase/User.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/User.cs rename to FFOracle/Models/Supabase/User.cs diff --git a/Fantasy-Football-Assistant-Manager/Models/Supabase/WeeklyPlayerStat.cs b/FFOracle/Models/Supabase/WeeklyPlayerStat.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Models/Supabase/WeeklyPlayerStat.cs rename to FFOracle/Models/Supabase/WeeklyPlayerStat.cs diff --git a/Fantasy-Football-Assistant-Manager/Program.cs b/FFOracle/Program.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Program.cs rename to FFOracle/Program.cs diff --git a/Fantasy-Football-Assistant-Manager/Properties/PublishProfiles/fforacle - Web Deploy.pubxml b/FFOracle/Properties/PublishProfiles/fforacle - Web Deploy.pubxml similarity index 100% rename from Fantasy-Football-Assistant-Manager/Properties/PublishProfiles/fforacle - Web Deploy.pubxml rename to FFOracle/Properties/PublishProfiles/fforacle - Web Deploy.pubxml diff --git a/Fantasy-Football-Assistant-Manager/Properties/ServiceDependencies/fforacle - Web Deploy/profile.arm.json b/FFOracle/Properties/ServiceDependencies/fforacle - Web Deploy/profile.arm.json similarity index 100% rename from Fantasy-Football-Assistant-Manager/Properties/ServiceDependencies/fforacle - Web Deploy/profile.arm.json rename to FFOracle/Properties/ServiceDependencies/fforacle - Web Deploy/profile.arm.json diff --git a/Fantasy-Football-Assistant-Manager/Properties/launchSettings.json b/FFOracle/Properties/launchSettings.json similarity index 100% rename from Fantasy-Football-Assistant-Manager/Properties/launchSettings.json rename to FFOracle/Properties/launchSettings.json diff --git a/Fantasy-Football-Assistant-Manager/Services/ChatGPTService.cs b/FFOracle/Services/ChatGPTService.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Services/ChatGPTService.cs rename to FFOracle/Services/ChatGPTService.cs diff --git a/Fantasy-Football-Assistant-Manager/Services/NflVerseService.cs b/FFOracle/Services/NflVerseService.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Services/NflVerseService.cs rename to FFOracle/Services/NflVerseService.cs diff --git a/Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs b/FFOracle/Services/UpdateSupabaseService.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Services/UpdateSupabaseService.cs rename to FFOracle/Services/UpdateSupabaseService.cs diff --git a/Fantasy-Football-Assistant-Manager/Utils/ControllerHelpers.cs b/FFOracle/Utils/ControllerHelpers.cs similarity index 100% rename from Fantasy-Football-Assistant-Manager/Utils/ControllerHelpers.cs rename to FFOracle/Utils/ControllerHelpers.cs diff --git a/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.http b/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.http deleted file mode 100644 index e093922..0000000 --- a/Fantasy-Football-Assistant-Manager/Fantasy-Football-Assistant-Manager.http +++ /dev/null @@ -1,6 +0,0 @@ -@Fantasy_Football_Assistant_Manager_HostAddress = http://localhost:5090 - -GET {{Fantasy_Football_Assistant_Manager_HostAddress}}/weatherforecast/ -Accept: application/json - -### From 240cf2dd6e419fd48ad5746bbe2ef6178281b8ea Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 17:43:17 -0500 Subject: [PATCH 5/9] update CICD workflow --- .github/workflows/main_fforacle.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main_fforacle.yml b/.github/workflows/main_fforacle.yml index 153218a..574e531 100644 --- a/.github/workflows/main_fforacle.yml +++ b/.github/workflows/main_fforacle.yml @@ -52,9 +52,8 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3C280D050E0F4243A338A118756AF2E5 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_E6C08C7D922B4E519DEFD6ACD7A93981 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_58AD54B4E954416F8314B16D46FE3B02 }} + auth-type: OIDC + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App id: deploy-to-webapp From df97b3eb40b080bb1dff9cf6fc46db37e8aa36f1 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 17:46:50 -0500 Subject: [PATCH 6/9] update workflow --- .github/workflows/main_fforacle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_fforacle.yml b/.github/workflows/main_fforacle.yml index 574e531..8a628aa 100644 --- a/.github/workflows/main_fforacle.yml +++ b/.github/workflows/main_fforacle.yml @@ -50,7 +50,7 @@ jobs: path: ./publish - name: Login to Azure - uses: azure/login@v2 + uses: azure/login@v2.3.0 with: auth-type: OIDC subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} From adfa8309359ab621c7358661154a41c79c523c01 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 22:26:29 -0500 Subject: [PATCH 7/9] Add change to workflow --- .github/workflows/main_fforacle.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main_fforacle.yml b/.github/workflows/main_fforacle.yml index 8a628aa..5bd0d23 100644 --- a/.github/workflows/main_fforacle.yml +++ b/.github/workflows/main_fforacle.yml @@ -50,10 +50,12 @@ jobs: path: ./publish - name: Login to Azure - uses: azure/login@v2.3.0 + uses: azure/login@v2 with: - auth-type: OIDC - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + auth-type: SERVICE_PRINCIPAL + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Deploy to Azure Web App id: deploy-to-webapp From ff5f5226aa1e060f5107e2da94667c54e0577071 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 22:33:02 -0500 Subject: [PATCH 8/9] update workflow --- .github/workflows/main_fforacle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main_fforacle.yml b/.github/workflows/main_fforacle.yml index 5bd0d23..4313b1d 100644 --- a/.github/workflows/main_fforacle.yml +++ b/.github/workflows/main_fforacle.yml @@ -52,7 +52,6 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - auth-type: SERVICE_PRINCIPAL client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} From 9184c5f6430d362f6fa1883581e70567d1392d76 Mon Sep 17 00:00:00 2001 From: EricNohara Date: Thu, 6 Nov 2025 22:37:37 -0500 Subject: [PATCH 9/9] Update workflow --- .github/workflows/main_fforacle.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main_fforacle.yml b/.github/workflows/main_fforacle.yml index 4313b1d..9fd2eb4 100644 --- a/.github/workflows/main_fforacle.yml +++ b/.github/workflows/main_fforacle.yml @@ -52,9 +52,7 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + creds: ${{ secrets.AZURE_CREDENTIALS }} - name: Deploy to Azure Web App id: deploy-to-webapp