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,30 @@
using Domain.Enums;
using System;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Match.Request;
/// <summary>
/// Represents a request to create a match.
/// </summary>
public class CreateMatchRequest
{
[Required(ErrorMessage = "The MatchDate field is required.")]
public required DateTime MatchDate { get; set; }
[AllowedValues(MatchType.Regular, MatchType.Playoff)]
public MatchType? Type { get; set; } = MatchType.Regular;
[Required(ErrorMessage = "The HomeTeamId field is required.")]
public required Guid HomeTeamId { get; set; }
[Required(ErrorMessage = "The VisitorTeamId field is required.")]
public required Guid VisitorTeamId { get; set; }
[Required(ErrorMessage = "The DivisionId field is required.")]
public required Guid StageId { get; set; }
public Guid? VenueId { get; set; }
}
@@ -0,0 +1,27 @@
using Application.DTOs.Abstract.Request;
using Domain.Enums;
using System;
namespace Application.DTOs.Match.Request;
/// <summary>
/// Represents a request to filter and paginate matches.
/// </summary>
public class GetMatchesFilteredRequest : PaginatedFilterRequest
{
public string? HomeTeamName { get; set; }
public string? VisitorTeamName { get; set; }
public Guid? StageId { get; set; }
public Guid? DivisionId { get; set; }
public Guid? TournamentId { get; set; }
public MatchType? Type { get; set; }
public bool? IsFinished { get; set; }
}
@@ -0,0 +1,22 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Match.Request;
/// <summary>
/// Request to mark a match as a walkover, awarding the present team the regulation default result.
/// </summary>
public class LoadWalkOverRequest
{
/// <summary>
/// The walkover winner; must be one of the match's two teams.
/// </summary>
[Required]
public required Guid PresentTeamId { get; set; }
/// <summary>
/// Optional override for the present team's awarded score; the regulation default is used when omitted.
/// </summary>
[Range(0, int.MaxValue, ErrorMessage = "The PresentTeamScore must be a non-negative number.")]
public int? PresentTeamScore { get; set; }
}
@@ -0,0 +1,14 @@
using System;
namespace Application.DTOs.Match.Request;
/// <summary>
/// Request to suspend a match and optionally reschedule it, never changing its round.
/// </summary>
public class SuspendMatchRequest
{
/// <summary>
/// Optional new date and time for the match; null suspends it in place without rescheduling.
/// </summary>
public DateTime? MatchDate { get; set; }
}
@@ -0,0 +1,13 @@
using System;
namespace Application.DTOs.Match.Request;
/// <summary>
/// Request to reschedule a match; edits only the calendar date and venue.
/// </summary>
public class UpdateMatchRequest
{
public DateTime? MatchDate { get; set; }
public Guid? VenueId { get; set; }
}
@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.Match.Request;
/// <summary>
/// Represents a request to update the score of a match.
/// </summary>
public class UpdateMatchScoreRequest
{
[Required]
[Range(0, int.MaxValue, ErrorMessage = "The HomeScore must be a non-negative number.")]
public required int HomeScore { get; set; }
[Required]
[Range(0, int.MaxValue, ErrorMessage = "The VisitorScore must be a non-negative number.")]
public required int VisitorScore { get; set; }
}