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,26 @@
using Domain.Enums;
using System;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.PlayerStatistic.Request;
/// <summary>
/// Request DTO for creating a player statistic.
/// </summary>
public class CreatePlayerStatisticRequest
{
[Required]
[Range(1, int.MaxValue, ErrorMessage = "Value must be a non-negative number.")]
public int Value { get; set; }
/// <summary>
/// The type of statistic, Points or Assists, defaulting to Points.
/// </summary>
public StatisticType Type { get; set; } = StatisticType.Points;
[Required]
public Guid MatchId { get; set; }
[Required]
public Guid PlayerId { get; set; }
}
@@ -0,0 +1,26 @@
using Application.DTOs.Abstract.Request;
using Domain.Enums;
using System;
namespace Application.DTOs.PlayerStatistic.Request;
/// <summary>
/// Represents a request to get filtered player statistics.
/// </summary>
public class GetPlayerStatisticsFilteredRequest : PaginatedFilterRequest
{
public Guid? MatchId { get; set; }
public Guid? PlayerId { get; set; }
/// <summary>
/// The team to filter statistics by, matching the statistic's player's team.
/// </summary>
public Guid? TeamId { get; set; }
/// <summary>
/// The type of statistic to filter by, Points or Assists.
/// </summary>
public StatisticType? Type { get; set; }
}
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.PlayerStatistic.Request;
/// <summary>
/// Request to finish a match by loading both teams' scoring sheets in one coherent operation.
/// </summary>
public class LoadMatchResultFromSheetsRequest
{
/// <summary>
/// The match being finished, assigned server-side from the route rather than sent by the client.
/// </summary>
public Guid MatchId { get; set; }
/// <summary>
/// The home team's per-player points; a player may score 0 and not every roster player must be listed.
/// </summary>
[Required]
public required List<PlayerScoreEntry> HomeScores { get; set; } = [];
/// <summary>
/// The visitor team's per-player points.
/// </summary>
[Required]
public required List<PlayerScoreEntry> VisitorScores { get; set; } = [];
/// <summary>
/// Whether the match was decided in overtime; purely informational and defaults to false.
/// </summary>
public bool WentToOvertime { get; set; }
}
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.PlayerStatistic.Request;
/// <summary>
/// Request to load a whole team's scoring sheet for a match in one coherent operation.
/// </summary>
public class LoadMatchSheetRequest
{
/// <summary>
/// The match whose sheet is being loaded.
/// </summary>
[Required]
public required Guid MatchId { get; set; }
/// <summary>
/// The home or visitor team whose players are being loaded.
/// </summary>
[Required]
public required Guid TeamId { get; set; }
/// <summary>
/// The per-player points, which must add up to the team's score; a player may score 0 and need not be listed.
/// </summary>
[Required]
public required List<PlayerScoreEntry> Scores { get; set; } = [];
}
@@ -0,0 +1,22 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.PlayerStatistic.Request;
/// <summary>
/// A single player's points within a team's match sheet.
/// </summary>
public class PlayerScoreEntry
{
/// <summary>
/// The player who scored.
/// </summary>
[Required]
public required Guid PlayerId { get; set; }
/// <summary>
/// The points the player scored in the match; may be zero.
/// </summary>
[Range(0, int.MaxValue, ErrorMessage = "Points must be a non-negative number.")]
public required int Points { get; set; }
}
@@ -0,0 +1,13 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Application.DTOs.PlayerStatistic.Request;
/// <summary>
/// Represents a request to update a player statistic.
/// </summary>
public class UpdatePlayerStatisticRequest
{
[Required]
[Range(0, int.MaxValue, ErrorMessage = "Value must be a non-negative integer.")]
public required int Value { get; set; }
}