Sube carpetas API, API.Tests, Application y Domain del Backend
This commit is contained in:
+26
@@ -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; }
|
||||
}
|
||||
+26
@@ -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; }
|
||||
}
|
||||
+33
@@ -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; }
|
||||
}
|
||||
+13
@@ -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; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Application.DTOs.Abstract.Response;
|
||||
|
||||
using Domain.Enums;
|
||||
|
||||
using System;
|
||||
namespace Application.DTOs.PlayerStatistic.Response;
|
||||
|
||||
/// <summary>
|
||||
/// Response DTO for player statistic.
|
||||
/// </summary>
|
||||
public class PlayerStatisticResponse : BaseEntityResponse
|
||||
{
|
||||
public Guid PlayerId { get; set; }
|
||||
|
||||
public int Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of statistic, Points or Assists.
|
||||
/// </summary>
|
||||
public StatisticType Type { get; set; }
|
||||
|
||||
public Guid MatchId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The date of the associated match, for display without a separate lookup.
|
||||
/// </summary>
|
||||
public DateTime? MatchDate { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user