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,54 @@
using Application.Utils.Constants.Validation;
using Domain.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Divisions.Request;
/// <summary>
/// Represents a request to create a division.
/// </summary>
public class CreateDivisionRequest
{
[Required(ErrorMessage = "The Name field is required.")]
[MaxLength(DivisionFieldLengths.NameMaxLength)]
public required string Name { get; set; }
[Required(ErrorMessage = "The TournamentId field is required.")]
public required Guid TournamentId { get; set; }
/// <summary>
/// Marks this division as a cross-division cup that intentionally draws teams from every division.
/// </summary>
public bool IsCrossDivisionCup { get; set; } = false;
/// <summary>
/// Points awarded for a win in this division's standings; defaults to 2.
/// </summary>
[Range(0, int.MaxValue, ErrorMessage = "PointsForWin cannot be negative.")]
public int PointsForWin { get; set; } = 2;
/// <summary>
/// Points awarded for a loss in this division's standings; defaults to 1.
/// </summary>
[Range(0, int.MaxValue, ErrorMessage = "PointsForLoss cannot be negative.")]
public int PointsForLoss { get; set; } = 1;
/// <summary>
/// How many teams qualify from each internal group of a multi-group cross-division cup; defaults to 1.
/// </summary>
[Range(1, int.MaxValue, ErrorMessage = "QualifiersPerGroup must be at least 1.")]
public int QualifiersPerGroup { get; set; } = 1;
/// <summary>
/// Competitive category of the division, which must match the parent tournament's category.
/// </summary>
public TournamentCategory Category { get; set; } = TournamentCategory.Masculine;
/// <summary>
/// Optional position-range to playoff-destination mapping the wizard sends to seed multiple cups.
/// </summary>
public List<PlayoffMappingRequest>? PlayoffMappings { get; set; }
}
@@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
namespace Application.DTOs.Divisions.Request;
public class EnrollTeamsRequest
{
public List<Guid> TeamIds { get; set; } = [];
}
@@ -0,0 +1,16 @@
using Application.DTOs.Abstract.Request;
using System;
namespace Application.DTOs.Divisions.Request;
/// <summary>
/// Represents a request to get filtered divisions.
/// </summary>
public class GetDivisionsFilteredRequest : PaginatedFilterRequest
{
public string? Name { get; set; }
public bool? IsFinished { get; set; }
public Guid? TournamentId { get; set; }
}
@@ -0,0 +1,27 @@
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Divisions.Request;
/// <summary>
/// One position-range to playoff-destination entry the wizard sends for a division; ranges must not overlap.
/// </summary>
public class PlayoffMappingRequest
{
/// <summary>
/// First standings position in the range, 1-based and inclusive.
/// </summary>
[Range(1, int.MaxValue, ErrorMessage = "FromPosition must be 1 or greater.")]
public required int FromPosition { get; set; }
/// <summary>
/// Last standings position in the range, 1-based and inclusive.
/// </summary>
[Range(1, int.MaxValue, ErrorMessage = "ToPosition must be 1 or greater.")]
public required int ToPosition { get; set; }
/// <summary>
/// The playoff cup the teams in this range qualify for, matching an elimination stage's BracketName.
/// </summary>
[Required(ErrorMessage = "The Destination field is required.")]
public required string Destination { get; set; }
}
@@ -0,0 +1,12 @@
using System;
namespace Application.DTOs.Divisions.Request;
public class ReassignTeamToSubGroupRequest
{
public required Guid TeamId { get; set; }
public required Guid FromStageId { get; set; }
public required Guid ToStageId { get; set; }
}
@@ -0,0 +1,9 @@
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Divisions.Request;
public class RebuildSubGroupsRequest
{
[Range(1, int.MaxValue, ErrorMessage = "SubGroupCount must be at least 1.")]
public required int SubGroupCount { get; set; }
}
@@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
namespace Application.DTOs.Divisions.Request;
public class UnenrollTeamsRequest
{
public List<Guid> TeamIds { get; set; } = [];
}
@@ -0,0 +1,22 @@
using Application.Utils.Constants.Validation;
using System;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Divisions.Request;
/// <summary>
/// Represents a request to create a division.
/// </summary>
public class UpdateDivisionRequest
{
[Required(ErrorMessage = "The Name field is required.")]
[MaxLength(DivisionFieldLengths.NameMaxLength)]
public required string Name { get; set; }
public required bool IsFinished { get; set; }
/// <summary>
/// When provided, moves the division and everything under it to this tournament; null keeps it in place.
/// </summary>
public Guid? TournamentId { get; set; }
}