Wonky.Client/Wonky.Entity/Requests/CustomerPaging.cs
2023-03-07 12:40:02 +01:00

75 lines
No EOL
2.1 KiB
C#

// Copyright (C) 2022 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
//
namespace Wonky.Entity.Requests;
public class CustomerPaging
{
/// <summary>
/// internal default page size
/// </summary>
private int _pageSize = 5;
/// <summary>
/// internal max page size
/// </summary>
private const int MaxPageSize = 50;
/// <summary>
/// Set the page number to return
/// </summary>
public int PageNumber { get; set; } = 1;
/// <summary>
/// Set the page size to return
/// </summary>
public int PageSize
{
get => _pageSize;
set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
}
/// <summary>
/// Set the search term to use
/// </summary>
public string SearchTerm { get; set; } = "";
/// <summary>
/// Set the column to use for searching
/// </summary>
public string SearchColumn { get; set; } = "name";
/// <summary>
/// Set the column for ordering the result
/// </summary>
public string OrderBy { get; set; } = "name";
/// <summary>
/// Optional limit the result
/// </summary>
public string FromDate { get; set; } = "";
/// <summary>
/// Set a flag to include hidden entities
/// </summary>
public int IsHidden { get; set; }
/// <summary>
/// Set a flag to include entities which has gone out of business
/// </summary>
public int HasFolded { get; set; }
}