Add Announcements and Dashboard controllers with all DTOs

This commit is contained in:
Denis Urs Rudolph
2026-04-03 21:12:47 +02:00
parent 30d573d1f8
commit 4438bc5a93
5 changed files with 547 additions and 20 deletions
+42
View File
@@ -0,0 +1,42 @@
using System.ComponentModel.DataAnnotations;
namespace RacePlannerApi.DTOs;
public class CreateAnnouncementRequest
{
[Required]
public Guid EventId { get; set; }
[Required]
[MaxLength(200)]
public string Title { get; set; } = string.Empty;
[Required]
[MaxLength(5000)]
public string Content { get; set; } = string.Empty;
}
public class UpdateAnnouncementRequest
{
[MaxLength(200)]
public string? Title { get; set; }
[MaxLength(5000)]
public string? Content { get; set; }
public bool? IsPublished { get; set; }
}
public class AnnouncementDto
{
public Guid Id { get; set; }
public Guid EventId { get; set; }
public string EventName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Content { get; set; } = string.Empty;
public Guid AuthorId { get; set; }
public string AuthorName { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public bool IsPublished { get; set; }
}