initial commit

This commit is contained in:
cubecraft-agents[bot]
2026-04-25 18:51:05 +00:00
commit 230c3b295d
78 changed files with 8093 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
namespace Extrudex.API.DTOs;
/// <summary>
/// Generic paginated response wrapper for list endpoints.
/// Provides pagination metadata alongside the result items.
/// </summary>
/// <typeparam name="T">The type of items in the page.</typeparam>
public class PagedResponse<T>
{
/// <summary>The items in the current page.</summary>
public IReadOnlyList<T> Items { get; set; } = [];
/// <summary>Total number of items across all pages.</summary>
public int TotalCount { get; set; }
/// <summary>Current page number (1-based).</summary>
public int PageNumber { get; set; }
/// <summary>Number of items per page.</summary>
public int PageSize { get; set; }
/// <summary>Total number of pages.</summary>
public int TotalPages => PageSize > 0 ? (int)Math.Ceiling(TotalCount / (double)PageSize) : 0;
/// <summary>Whether there is a next page.</summary>
public bool HasNextPage => PageNumber < TotalPages;
/// <summary>Whether there is a previous page.</summary>
public bool HasPreviousPage => PageNumber > 1;
}