Sube carpetas API, API.Tests, Application y Domain del Backend
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using Application.Utils.Constants.Validation;
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace Application.DTOs.Player.Request;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to create a Player.
|
||||
/// </summary>
|
||||
public class CreatePlayerRequest
|
||||
{
|
||||
[Required(ErrorMessage = "The First Name field is required.")]
|
||||
[MaxLength(PlayerFieldLengths.NameMaxLength, ErrorMessage = "The Name field must not exceed 70 characters.")]
|
||||
public required string FirstName { get; set; }
|
||||
|
||||
[MaxLength(PlayerFieldLengths.NameMaxLength, ErrorMessage = "The Second Name field must not exceed 70 characters.")]
|
||||
public string? SecondName { get; set; } = null;
|
||||
|
||||
[Required(ErrorMessage = "The LastName field is required.")]
|
||||
[MaxLength(PlayerFieldLengths.NameMaxLength, ErrorMessage = "The LastName field must not exceed 70 characters.")]
|
||||
public required string LastName { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "The DocumentNumber field is required.")]
|
||||
[MaxLength(PlayerFieldLengths.DocumentNumberMaxLength, ErrorMessage = "The DocumentNumber field must not exceed 15 characters.")]
|
||||
[RegularExpression(ValidationPatterns.DocumentNumber, ErrorMessage = ValidationPatterns.DocumentNumberError)]
|
||||
public required string DocumentNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The birthdate of the player. Must be at least 15 years ago.
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "The BirthDate field is required.")]
|
||||
[MinimumAge(15)]
|
||||
public required DateTime BirthDate { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "The PhoneNumber field is required.")]
|
||||
[MaxLength(PlayerFieldLengths.PhoneNumberMaxLength, ErrorMessage = "The PhoneNumber field must not exceed 15 characters.")]
|
||||
[ArgentinePhoneNumber]
|
||||
public required string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The player's health insurance provider or social work plan.
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "The SocialSecurity field is required.")]
|
||||
[MaxLength(PlayerFieldLengths.SocialSecurityMaxLength, ErrorMessage = "The SocialSecurity field must not exceed 100 characters.")]
|
||||
public required string SocialSecurity { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "The TeamId field is required.")]
|
||||
public required Guid TeamId { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
namespace Application.DTOs.Player.Request;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get filtered players for admin access.
|
||||
/// </summary>
|
||||
public class GetPlayersFilteredRequest : PlayerFilterRequestBase
|
||||
{
|
||||
public string? DocumentNumber { get; set; }
|
||||
|
||||
public DateTime? BirthDate { get; set; }
|
||||
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
public string? SocialSecurity { get; set; }
|
||||
|
||||
public bool? IsFederated { get; set; }
|
||||
|
||||
public string? Club { get; set; }
|
||||
|
||||
public string? Category { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Application.DTOs.Abstract.Request;
|
||||
|
||||
using System;
|
||||
namespace Application.DTOs.Player.Request;
|
||||
|
||||
/// <summary>
|
||||
/// Base class for filtering players with common properties.
|
||||
/// </summary>
|
||||
public class PlayerFilterRequestBase : PaginatedFilterRequest
|
||||
{
|
||||
public string? Names { get; set; }
|
||||
|
||||
public string? LastName { get; set; }
|
||||
|
||||
public Guid? TeamId { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Application.DTOs.Player.Request;
|
||||
|
||||
/// <summary>
|
||||
/// Request to register a player onto a team's roster for a tournament season, optionally with a dorsal.
|
||||
/// </summary>
|
||||
public class RegisterPlayerToTeamRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// The team to register the player onto.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public required Guid TeamId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The tournament the registration belongs to.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public required Guid TournamentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The player's jersey number for this team and season, from 0 to 99 inclusive, or null.
|
||||
/// </summary>
|
||||
[Range(0, 99, ErrorMessage = "El dorsal debe ser un número entre 0 y 99.")]
|
||||
public int? JerseyNumber { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Application.Utils.Constants.Validation;
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace Application.DTOs.Player.Request;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to update a Player.
|
||||
/// </summary>
|
||||
public class UpdatePlayerRequest
|
||||
{
|
||||
[Required(ErrorMessage = "The First Name field is required.")]
|
||||
[MaxLength(PlayerFieldLengths.NameMaxLength, ErrorMessage = "The Name field must not exceed 70 characters.")]
|
||||
public required string FirstName { get; set; }
|
||||
|
||||
[MaxLength(PlayerFieldLengths.NameMaxLength, ErrorMessage = "The Second Name field must not exceed 70 characters.")]
|
||||
public string? SecondName { get; set; } = null;
|
||||
|
||||
[MaxLength(PlayerFieldLengths.NameMaxLength, ErrorMessage = "The LastName field must not exceed 70 characters.")]
|
||||
public string? LastName { get; set; }
|
||||
|
||||
[MaxLength(PlayerFieldLengths.DocumentNumberMaxLength, ErrorMessage = "The DocumentNumber field must not exceed 15 characters.")]
|
||||
[RegularExpression(ValidationPatterns.DocumentNumber, ErrorMessage = ValidationPatterns.DocumentNumberError)]
|
||||
public string? DocumentNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The birthdate of the player. Must be at least 15 years ago.
|
||||
/// </summary>
|
||||
[MinimumAge(15)]
|
||||
public DateTime? BirthDate { get; set; }
|
||||
|
||||
[MaxLength(PlayerFieldLengths.PhoneNumberMaxLength, ErrorMessage = "The PhoneNumber field must not exceed 15 characters.")]
|
||||
[ArgentinePhoneNumber]
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The player's health insurance provider or social work plan.
|
||||
/// </summary>
|
||||
[MaxLength(PlayerFieldLengths.SocialSecurityMaxLength, ErrorMessage = "The SocialSecurity field must not exceed 100 characters.")]
|
||||
public string? SocialSecurity { get; set; }
|
||||
|
||||
public Guid? TeamId { get; set; }
|
||||
|
||||
public bool? IsFederated { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public string? Club { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string? Category { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user