2022-03-11 14:21:04 +01:00
|
|
|
// Copyright (C) 2022 FCS Frede's Computer Services.
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
2022-05-31 19:07:39 +02:00
|
|
|
// it under the terms of the GNU Affero General Public License as
|
2022-03-11 14:21:04 +01:00
|
|
|
// 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
|
2022-05-31 19:07:39 +02:00
|
|
|
// GNU Affero General Public License for more details.
|
2022-03-11 14:21:04 +01:00
|
|
|
//
|
2022-05-31 19:07:39 +02:00
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
2022-03-11 14:21:04 +01:00
|
|
|
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
|
|
|
//
|
2022-07-04 11:14:24 +02:00
|
|
|
|
2023-03-07 12:40:02 +01:00
|
|
|
|
2022-03-14 17:59:22 +01:00
|
|
|
namespace Wonky.Entity.Requests;
|
2022-03-11 14:21:04 +01:00
|
|
|
|
2022-12-31 03:18:16 +01:00
|
|
|
public class CustomerPaging
|
2022-03-11 14:21:04 +01:00
|
|
|
{
|
2022-07-01 10:02:29 +02:00
|
|
|
/// <summary>
|
|
|
|
/// internal default page size
|
|
|
|
/// </summary>
|
2022-04-03 11:50:33 +02:00
|
|
|
private int _pageSize = 5;
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// internal max page size
|
|
|
|
/// </summary>
|
2022-03-14 17:59:22 +01:00
|
|
|
private const int MaxPageSize = 50;
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set the page number to return
|
|
|
|
/// </summary>
|
2022-03-14 17:59:22 +01:00
|
|
|
public int PageNumber { get; set; } = 1;
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set the page size to return
|
|
|
|
/// </summary>
|
2022-03-14 17:59:22 +01:00
|
|
|
public int PageSize
|
2022-03-11 14:21:04 +01:00
|
|
|
{
|
2022-03-14 17:59:22 +01:00
|
|
|
get => _pageSize;
|
|
|
|
set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
|
2022-03-11 14:21:04 +01:00
|
|
|
}
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set the search term to use
|
|
|
|
/// </summary>
|
2022-03-14 17:59:22 +01:00
|
|
|
public string SearchTerm { get; set; } = "";
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set the column to use for searching
|
|
|
|
/// </summary>
|
2022-03-14 17:59:22 +01:00
|
|
|
public string SearchColumn { get; set; } = "name";
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set the column for ordering the result
|
|
|
|
/// </summary>
|
2022-04-03 11:50:33 +02:00
|
|
|
public string OrderBy { get; set; } = "name";
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Optional limit the result
|
|
|
|
/// </summary>
|
2022-04-03 11:50:33 +02:00
|
|
|
public string FromDate { get; set; } = "";
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set a flag to include hidden entities
|
|
|
|
/// </summary>
|
2022-04-03 11:50:33 +02:00
|
|
|
public int IsHidden { get; set; }
|
2022-07-01 10:02:29 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Set a flag to include entities which has gone out of business
|
|
|
|
/// </summary>
|
2022-04-03 11:50:33 +02:00
|
|
|
public int HasFolded { get; set; }
|
2022-09-25 10:33:41 +02:00
|
|
|
|
2022-03-11 14:21:04 +01:00
|
|
|
}
|