add DTOs
This commit is contained in:
parent
9fa6958933
commit
7cab8642d5
|
|
@ -28,6 +28,8 @@ The name for the App is KOOGLE. Koogle is an app for club management.
|
||||||
|
|
||||||
## Implementation Plan
|
## Implementation Plan
|
||||||
|
|
||||||
|
- alle Implementierung sollen mit xmldoc in englischer Spreche kommentiert werden
|
||||||
|
|
||||||
**Phase 1 MVP:** See [docs/IMPLEMENTATION_PLAN.md](./docs/IMPLEMENTATION_PLAN.md)
|
**Phase 1 MVP:** See [docs/IMPLEMENTATION_PLAN.md](./docs/IMPLEMENTATION_PLAN.md)
|
||||||
- 23 granular phases (A1-F3)
|
- 23 granular phases (A1-F3)
|
||||||
- Foundation → Clubs → Users → Persons → Days → Dashboard
|
- Foundation → Clubs → Users → Persons → Days → Dashboard
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ NavMenu.razor:
|
||||||
|---|-------|---------|--------------|---------|
|
|---|-------|---------|--------------|---------|
|
||||||
| ✓ | A1 | Foundation | Repository Interfaces | 5 Interface-Dateien |
|
| ✓ | A1 | Foundation | Repository Interfaces | 5 Interface-Dateien |
|
||||||
| ✓ | A2 | Foundation | Repository Implementations | 5 Repository-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 |
|
| ☐ | A4 | Foundation | Service Interfaces | 5 Service-Interface-Dateien |
|
||||||
| ☐ | A5 | Foundation | Service Implementations | 5 Service-Dateien |
|
| ☐ | A5 | Foundation | Service Implementations | 5 Service-Dateien |
|
||||||
| ☐ | A6 | Foundation | AutoMapper Profiles | 5 Mapping-Dateien |
|
| ☐ | A6 | Foundation | AutoMapper Profiles | 5 Mapping-Dateien |
|
||||||
|
|
|
||||||
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
|
@ -1,59 +1,62 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Koogle.Domain.Enums;
|
using Koogle.Domain.Enums;
|
||||||
|
|
||||||
namespace Koogle.Application.DTOs
|
namespace Koogle.Application.DTOs;
|
||||||
|
|
||||||
|
public record DayDto
|
||||||
{
|
{
|
||||||
public record DayDto
|
public Guid Id { get; init; }
|
||||||
{
|
public DateTime PostDate { get; init; }
|
||||||
public int Id { get; set; }
|
public DayStatus Status { get; init; }
|
||||||
|
public Guid ClubId { get; init; }
|
||||||
public DateTime PostDate { get; set; }
|
public string? ClubName { get; init; }
|
||||||
|
public int ParticipantCount { get; init; }
|
||||||
public DayStatus Status { get; set; }
|
public List<DayParticipantDto> Participants { get; init; } = [];
|
||||||
}
|
public DateTime CreatedAt { get; init; }
|
||||||
|
public DateTime? ModifiedAt { get; init; }
|
||||||
public record DaySummaryDto
|
}
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
public record DaySummaryDto
|
||||||
|
{
|
||||||
public DateTime PostDate { get; set; }
|
public Guid Id { get; init; }
|
||||||
|
public DateTime PostDate { get; init; }
|
||||||
public DayStatus Status { get; set; }
|
public DayStatus Status { get; init; }
|
||||||
}
|
public int ParticipantCount { get; init; }
|
||||||
|
}
|
||||||
public record DayFilterDto
|
|
||||||
{
|
public record CreateDayDto
|
||||||
public int Year { get; set; }
|
{
|
||||||
|
public DateTime PostDate { get; init; } = DateTime.Today;
|
||||||
// ///// <summary>
|
public List<Guid> ParticipantIds { get; init; } = [];
|
||||||
// ///// Sortierfeld.
|
}
|
||||||
// ///// </summary>
|
|
||||||
// //public GoalSortField SortBy { get; init; } = GoalSortField.Name;
|
public record UpdateDayDto
|
||||||
|
{
|
||||||
// ///// <summary>
|
public Guid Id { get; init; }
|
||||||
// ///// Sortierrichtung.
|
public DateTime PostDate { get; init; }
|
||||||
// ///// </summary>
|
public DayStatus Status { get; init; }
|
||||||
// //public SortDirection SortDirection { get; init; } = SortDirection.Ascending;
|
}
|
||||||
|
|
||||||
// // Paginierung
|
public record DayParticipantDto
|
||||||
|
{
|
||||||
// /// <summary>
|
public Guid PersonId { get; init; }
|
||||||
// /// Seitennummer (1-basiert).
|
public string PersonName { get; init; } = string.Empty;
|
||||||
// /// </summary>
|
public PersonStatus PersonStatus { get; init; }
|
||||||
// public int Page { get; init; } = 1;
|
}
|
||||||
|
|
||||||
// /// <summary>
|
public record AddDayParticipantDto
|
||||||
// /// Anzahl der Einträge pro Seite.
|
{
|
||||||
// /// </summary>
|
public Guid DayId { get; init; }
|
||||||
// public int PageSize { get; init; } = 20;
|
public Guid PersonId { get; init; }
|
||||||
|
}
|
||||||
// /// <summary>
|
|
||||||
// /// Berechnet den Skip-Wert für die Paginierung.
|
public record RemoveDayParticipantDto
|
||||||
// /// </summary>
|
{
|
||||||
// public int Skip => (Page - 1) * PageSize;
|
public Guid DayId { get; init; }
|
||||||
}
|
public Guid PersonId { get; init; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public record DayFilterDto
|
||||||
|
{
|
||||||
|
public int? Year { get; init; }
|
||||||
|
public DayStatus? Status { get; init; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
|
@ -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<PersonDayEvaluationDto> 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<PersonExpenseDto> 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; }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue