Sube carpetas API, API.Tests, Application y Domain del Backend

This commit is contained in:
FrancoRu
2026-09-18 13:35:59 -03:00
parent bbb09554bb
commit 2eb4eeef03
572 changed files with 56405 additions and 0 deletions
@@ -0,0 +1,25 @@
using Application.DTOs.Abstract.Response;
using Application.DTOs.Match.Response;
using System;
using System.Collections.Generic;
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// Represents a response for a division, inheriting from the base response.
/// </summary>
public class DetailedDivisionResponse : BaseEntityResponse
{
public required string Name { get; set; }
public required bool IsFinished { get; set; }
public required IEnumerable<PositionResponse> Positions { get; set; }
public required Guid TournamentId { get; set; }
/// <summary>
/// The matches grouped by week in the division.
/// </summary>
public required IDictionary<int, IEnumerable<MinimalMatchResponse>> MatchesByWeek { get; set; }
}
@@ -0,0 +1,74 @@
using Domain.Enums;
using System;
using System.Collections.Generic;
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// The response structure for a division, including its matches and positions.
/// </summary>
public class DivisionResponse
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
/// <summary>
/// The unique, URL-friendly identifier used in public division links.
/// </summary>
public string Slug { get; set; } = string.Empty;
public bool IsFinished { get; set; }
/// <summary>
/// For a multi-group cup this is the pooled union across every group; use GroupStandings for per-group tables.
/// </summary>
public List<PositionResponse>? Positions { get; set; }
/// <summary>
/// One standings table per Group stage, null or empty when the division has no Group stage yet.
/// </summary>
public List<GroupStandingsResponse>? GroupStandings { get; set; }
public Guid TournamentId { get; set; }
/// <summary>
/// The parent tournament's slug, when loaded; null otherwise, for building a clean tournament link.
/// </summary>
public string? TournamentSlug { get; set; }
/// <summary>
/// Whether this division is a cross-division cup that intentionally draws teams from every division.
/// </summary>
public bool IsCrossDivisionCup { get; set; }
/// <summary>
/// Competitive category of the division, always matching the parent tournament's category.
/// </summary>
public TournamentCategory Category { get; set; }
/// <summary>
/// Points awarded for a win in this division's standings.
/// </summary>
public int PointsForWin { get; set; }
/// <summary>
/// Points awarded for a loss in this division's standings.
/// </summary>
public int PointsForLoss { get; set; }
/// <summary>
/// How many teams qualify from each internal group of a multi-group cup; defaults to 1.
/// </summary>
public int QualifiersPerGroup { get; set; }
/// <summary>
/// The division's position-range to playoff-destination mapping.
/// </summary>
public List<PlayoffMappingResponse>? PlayoffMappings { get; set; }
/// <summary>
/// The standings-position ranges that qualify to a playoff cup, ordered top-down; empty when none exist.
/// </summary>
public List<QualificationRangeResponse>? QualificationRanges { get; set; }
}
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// The standings of a single Group stage; a multi-group division sends one entry per internal group.
/// </summary>
public class GroupStandingsResponse
{
/// <summary>
/// The id of the Group stage these standings belong to.
/// </summary>
public Guid StageId { get; set; }
/// <summary>
/// The Group stage's name, used as the table label.
/// </summary>
public string StageName { get; set; } = string.Empty;
/// <summary>
/// The ordered standings for the teams in this group.
/// </summary>
public List<PositionResponse> Positions { get; set; } = [];
}
@@ -0,0 +1,12 @@
using Application.DTOs.Abstract.Response;
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// Represents a minimal response for a tournament.
/// </summary>
public class MinimalDivisionResponse : BaseEntityResponse
{
public required string Name { get; set; }
public required bool IsFinished { get; set; }
}
@@ -0,0 +1,14 @@
using System;
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// One position-range to playoff-destination entry of a division.
/// </summary>
public class PlayoffMappingResponse
{
public Guid Id { get; set; }
public int FromPosition { get; set; }
public int ToPosition { get; set; }
public string Destination { get; set; } = string.Empty;
}
@@ -0,0 +1,40 @@
using System;
using Application.DTOs.PointDeductions.Response;
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// Represents the position of a team in a division, including various match statistics.
/// </summary>
public class PositionResponse
{
public required Guid TeamId { get; set; }
public required string TeamName { get; set; }
public required string LogoUrl { get; set; }
public required int MatchesPlayed { get; set; }
public required int Wins { get; set; }
public required int Losses { get; set; }
public required int PointsFor { get; set; }
public required int PointsAgainst { get; set; }
public required int PointsDifference { get; set; }
/// <summary>
/// The total points accumulated by the team, with any disciplinary deduction already subtracted.
/// </summary>
public required int Points { get; set; }
/// <summary>
/// The disciplinary point deduction applied to this team, or null when there is none.
/// </summary>
public AppliedPointDeductionResponse? PointDeduction { get; set; }
}
@@ -0,0 +1,27 @@
namespace Application.DTOs.Divisions.Response;
/// <summary>
/// One standings-position range that qualifies to a playoff cup, derived from the division's mapping set.
/// </summary>
public class QualificationRangeResponse
{
/// <summary>
/// First standings position in the range, 1-based and inclusive.
/// </summary>
public int FromPosition { get; set; }
/// <summary>
/// Last standings position in the range, 1-based and inclusive.
/// </summary>
public int ToPosition { get; set; }
/// <summary>
/// The cup the teams in this range qualify for.
/// </summary>
public string CupName { get; set; } = string.Empty;
/// <summary>
/// The cup's rank, top-down, where 0 is the top cup; drives the color the frontend paints each range.
/// </summary>
public int Order { get; set; }
}