diff --git a/CLAUDE.md b/CLAUDE.md index ad8bb5f..7978d27 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -28,6 +28,8 @@ The name for the App is KOOGLE. Koogle is an app for club management. ## Implementation Plan +- alle Implementierung sollen mit xmldoc in englischer Spreche kommentiert werden + **Phase 1 MVP:** See [docs/IMPLEMENTATION_PLAN.md](./docs/IMPLEMENTATION_PLAN.md) - 23 granular phases (A1-F3) - Foundation → Clubs → Users → Persons → Days → Dashboard diff --git a/docs/IMPLEMENTATION_PLAN.md b/docs/IMPLEMENTATION_PLAN.md index f5fffa2..520c0c3 100644 --- a/docs/IMPLEMENTATION_PLAN.md +++ b/docs/IMPLEMENTATION_PLAN.md @@ -325,7 +325,7 @@ NavMenu.razor: |---|-------|---------|--------------|---------| | ✓ | A1 | Foundation | Repository Interfaces | 5 Interface-Dateien | | ✓ | A2 | Foundation | Repository Implementations | 5 Repository-Dateien | -| ☐ | A3 | Foundation | DTOs | 5 DTO-Dateien | +| ✓ | A3 | Foundation | DTOs | 5 DTO-Dateien | | ☐ | A4 | Foundation | Service Interfaces | 5 Service-Interface-Dateien | | ☐ | A5 | Foundation | Service Implementations | 5 Service-Dateien | | ☐ | A6 | Foundation | AutoMapper Profiles | 5 Mapping-Dateien | diff --git a/src/Koogle.Application/DTOs/ClubDto.cs b/src/Koogle.Application/DTOs/ClubDto.cs new file mode 100644 index 0000000..2051f96 --- /dev/null +++ b/src/Koogle.Application/DTOs/ClubDto.cs @@ -0,0 +1,25 @@ +using Koogle.Domain.Enums; + +namespace Koogle.Application.DTOs; + +public record ClubDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public ExpenseCalculation ExpenseCalculation { get; init; } + public DateTime CreatedAt { get; init; } + public DateTime? ModifiedAt { get; init; } +} + +public record CreateClubDto +{ + public string Name { get; init; } = string.Empty; + public ExpenseCalculation ExpenseCalculation { get; init; } = ExpenseCalculation.None; +} + +public record UpdateClubDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public ExpenseCalculation ExpenseCalculation { get; init; } +} diff --git a/src/Koogle.Application/DTOs/DayDto.cs b/src/Koogle.Application/DTOs/DayDto.cs index aa24f58..04ce4e0 100644 --- a/src/Koogle.Application/DTOs/DayDto.cs +++ b/src/Koogle.Application/DTOs/DayDto.cs @@ -1,59 +1,62 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Koogle.Domain.Enums; -namespace Koogle.Application.DTOs +namespace Koogle.Application.DTOs; + +public record DayDto { - public record DayDto - { - public int Id { get; set; } - - public DateTime PostDate { get; set; } - - public DayStatus Status { get; set; } - } - - public record DaySummaryDto - { - public int Id { get; set; } - - public DateTime PostDate { get; set; } - - public DayStatus Status { get; set; } - } - - public record DayFilterDto - { - public int Year { get; set; } - - // ///// - // ///// Sortierfeld. - // ///// - // //public GoalSortField SortBy { get; init; } = GoalSortField.Name; - - // ///// - // ///// Sortierrichtung. - // ///// - // //public SortDirection SortDirection { get; init; } = SortDirection.Ascending; - - // // Paginierung - - // /// - // /// Seitennummer (1-basiert). - // /// - // public int Page { get; init; } = 1; - - // /// - // /// Anzahl der Einträge pro Seite. - // /// - // public int PageSize { get; init; } = 20; - - // /// - // /// Berechnet den Skip-Wert für die Paginierung. - // /// - // public int Skip => (Page - 1) * PageSize; - } + public Guid Id { get; init; } + public DateTime PostDate { get; init; } + public DayStatus Status { get; init; } + public Guid ClubId { get; init; } + public string? ClubName { get; init; } + public int ParticipantCount { get; init; } + public List Participants { get; init; } = []; + public DateTime CreatedAt { get; init; } + public DateTime? ModifiedAt { get; init; } +} + +public record DaySummaryDto +{ + public Guid Id { get; init; } + public DateTime PostDate { get; init; } + public DayStatus Status { get; init; } + public int ParticipantCount { get; init; } +} + +public record CreateDayDto +{ + public DateTime PostDate { get; init; } = DateTime.Today; + public List ParticipantIds { get; init; } = []; +} + +public record UpdateDayDto +{ + public Guid Id { get; init; } + public DateTime PostDate { get; init; } + public DayStatus Status { get; init; } +} + +public record DayParticipantDto +{ + public Guid PersonId { get; init; } + public string PersonName { get; init; } = string.Empty; + public PersonStatus PersonStatus { get; init; } +} + +public record AddDayParticipantDto +{ + public Guid DayId { get; init; } + public Guid PersonId { get; init; } +} + +public record RemoveDayParticipantDto +{ + public Guid DayId { get; init; } + public Guid PersonId { get; init; } +} + +public record DayFilterDto +{ + public int? Year { get; init; } + public DayStatus? Status { get; init; } } diff --git a/src/Koogle.Application/DTOs/ExpenseDto.cs b/src/Koogle.Application/DTOs/ExpenseDto.cs new file mode 100644 index 0000000..bc51b1c --- /dev/null +++ b/src/Koogle.Application/DTOs/ExpenseDto.cs @@ -0,0 +1,49 @@ +using Koogle.Domain.Enums; + +namespace Koogle.Application.DTOs; + +public record ExpenseDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public string Description { get; init; } = string.Empty; + public decimal Price { get; init; } + public bool IsOneClick { get; init; } + public bool IsInverse { get; init; } + public bool IsVariable { get; init; } + public ExpenseType ExpenseType { get; init; } + public Guid ClubId { get; init; } + public DateTime CreatedAt { get; init; } + public DateTime? ModifiedAt { get; init; } +} + +public record CreateExpenseDto +{ + public string Name { get; init; } = string.Empty; + public string Description { get; init; } = string.Empty; + public decimal Price { get; init; } + public bool IsOneClick { get; init; } + public bool IsInverse { get; init; } + public bool IsVariable { get; init; } + public ExpenseType ExpenseType { get; init; } = ExpenseType.Monetary; +} + +public record UpdateExpenseDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public string Description { get; init; } = string.Empty; + public decimal Price { get; init; } + public bool IsOneClick { get; init; } + public bool IsInverse { get; init; } + public bool IsVariable { get; init; } + public ExpenseType ExpenseType { get; init; } +} + +public record ExpenseSummaryDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public decimal Price { get; init; } + public bool IsOneClick { get; init; } +} diff --git a/src/Koogle.Application/DTOs/PersonDto.cs b/src/Koogle.Application/DTOs/PersonDto.cs new file mode 100644 index 0000000..0819c9a --- /dev/null +++ b/src/Koogle.Application/DTOs/PersonDto.cs @@ -0,0 +1,34 @@ +using Koogle.Domain.Enums; + +namespace Koogle.Application.DTOs; + +public record PersonDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public PersonStatus PersonStatus { get; init; } + public Guid ClubId { get; init; } + public string? ClubName { get; init; } + public DateTime CreatedAt { get; init; } + public DateTime? ModifiedAt { get; init; } +} + +public record CreatePersonDto +{ + public string Name { get; init; } = string.Empty; + public PersonStatus PersonStatus { get; init; } = PersonStatus.Member; +} + +public record UpdatePersonDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public PersonStatus PersonStatus { get; init; } +} + +public record PersonSummaryDto +{ + public Guid Id { get; init; } + public string Name { get; init; } = string.Empty; + public PersonStatus PersonStatus { get; init; } +} diff --git a/src/Koogle.Application/DTOs/PersonExpenseDto.cs b/src/Koogle.Application/DTOs/PersonExpenseDto.cs new file mode 100644 index 0000000..c735116 --- /dev/null +++ b/src/Koogle.Application/DTOs/PersonExpenseDto.cs @@ -0,0 +1,75 @@ +using Koogle.Domain.Enums; + +namespace Koogle.Application.DTOs; + +public record PersonExpenseDto +{ + public Guid Id { get; init; } + public Guid PersonId { get; init; } + public string PersonName { get; init; } = string.Empty; + public Guid ExpenseId { get; init; } + public Guid DayId { get; init; } + public DateTime DayPostDate { get; init; } + public Guid? GameId { get; init; } + public Guid ClubId { get; init; } + public string Name { get; init; } = string.Empty; + public decimal Price { get; init; } + public ExpenseType ExpenseType { get; init; } + public PersonExpenseStatus PersonExpenseStatus { get; init; } + public Guid AssignedById { get; init; } + public DateTime CreatedAt { get; init; } +} + +public record CreatePersonExpenseDto +{ + public Guid PersonId { get; init; } + public Guid ExpenseId { get; init; } + public Guid DayId { get; init; } + public Guid? GameId { get; init; } + public decimal? Price { get; init; } // Override if IsVariable +} + +public record CreateInversePersonExpenseDto +{ + public Guid ExcludedPersonId { get; init; } // Person who does NOT get the expense + public Guid ExpenseId { get; init; } + public Guid DayId { get; init; } + public Guid? GameId { get; init; } +} + +public record UpdatePersonExpenseStatusDto +{ + public Guid Id { get; init; } + public PersonExpenseStatus Status { get; init; } +} + +public record DayEvaluationDto +{ + public Guid DayId { get; init; } + public DateTime PostDate { get; init; } + public DayStatus Status { get; init; } + public decimal TotalAmount { get; init; } + public int ExpenseCount { get; init; } + public List PersonEvaluations { get; init; } = []; +} + +public record PersonDayEvaluationDto +{ + public Guid PersonId { get; init; } + public string PersonName { get; init; } = string.Empty; + public decimal TotalAmount { get; init; } + public decimal OpenAmount { get; init; } + public decimal PaidAmount { get; init; } + public int ExpenseCount { get; init; } + public List Expenses { get; init; } = []; +} + +public record PersonEvaluationSummaryDto +{ + public Guid PersonId { get; init; } + public string PersonName { get; init; } = string.Empty; + public decimal TotalOpenAmount { get; init; } + public decimal TotalPaidAmount { get; init; } + public int TotalExpenseCount { get; init; } + public int DaysParticipated { get; init; } +}