Add Events, Registrations, and Payments controllers with DTOs

This commit is contained in:
Denis Urs Rudolph
2026-04-03 21:06:38 +02:00
parent b6962e1024
commit 30d573d1f8
6 changed files with 995 additions and 0 deletions
+85
View File
@@ -0,0 +1,85 @@
using System.ComponentModel.DataAnnotations;
using RacePlannerApi.Models;
namespace RacePlannerApi.DTOs;
public class CreateEventRequest
{
[Required]
[MaxLength(200)]
public string Name { get; set; } = string.Empty;
[MaxLength(2000)]
public string Description { get; set; } = string.Empty;
[Required]
public DateTime EventDate { get; set; }
[Required]
[MaxLength(500)]
public string Location { get; set; } = string.Empty;
[MaxLength(100)]
public string? Category { get; set; }
public List<string> Tags { get; set; } = new();
public int? MaxParticipants { get; set; }
}
public class UpdateEventRequest
{
[MaxLength(200)]
public string? Name { get; set; }
[MaxLength(2000)]
public string? Description { get; set; }
public DateTime? EventDate { get; set; }
[MaxLength(500)]
public string? Location { get; set; }
public EventStatus? Status { get; set; }
[MaxLength(100)]
public string? Category { get; set; }
public List<string>? Tags { get; set; }
public int? MaxParticipants { get; set; }
}
public class EventDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public DateTime EventDate { get; set; }
public string Location { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public string? Category { get; set; }
public List<string> Tags { get; set; } = new();
public int? MaxParticipants { get; set; }
public int CurrentRegistrations { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public UserSummaryDto Organizer { get; set; } = null!;
}
public class EventFilterRequest
{
public string? Category { get; set; }
public List<string>? Tags { get; set; }
public DateTime? FromDate { get; set; }
public DateTime? ToDate { get; set; }
public string? Status { get; set; }
public Guid? OrganizerId { get; set; }
}
public class UserSummaryDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}