-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMessageListViewModel.cs
More file actions
64 lines (52 loc) · 1.97 KB
/
MessageListViewModel.cs
File metadata and controls
64 lines (52 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// <copyright file="MessageListViewModel.cs" company="Michael Silver">
// Copyright (c) Michael Silver. All rights reserved.
// </copyright>
using Procession.Common.Models;
using Procession.Server.Common.Models;
namespace Procession.AdminWeb.Models;
/// <summary>
/// View model for the message list page with paging and filtering.
/// </summary>
public class MessageListViewModel
{
/// <summary>
/// Gets or sets the list of messages for the current page.
/// </summary>
public List<Message> Messages { get; set; } = new List<Message>();
/// <summary>
/// Gets or sets the current page number (1-based).
/// </summary>
public int CurrentPage { get; set; } = 1;
/// <summary>
/// Gets or sets the page size.
/// </summary>
public int PageSize { get; set; } = 50;
/// <summary>
/// Gets or sets the total count of messages matching the filter.
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Gets or sets the selected queue ID for filtering (null for all queues).
/// </summary>
public long? SelectedQueueId { get; set; }
/// <summary>
/// Gets or sets the processed filter (null for all, true for processed only, false for unprocessed only).
/// </summary>
public bool? ProcessedOnly { get; set; }
/// <summary>
/// Gets or sets the list of available queues for the filter dropdown.
/// </summary>
public List<QueueInfo> AvailableQueues { get; set; } = new List<QueueInfo>();
/// <summary>
/// Gets the total number of pages.
/// </summary>
public int TotalPages => (int)Math.Ceiling((double)this.TotalCount / this.PageSize);
/// <summary>
/// Gets a value indicating whether there is a previous page.
/// </summary>
public bool HasPreviousPage => this.CurrentPage > 1;
/// <summary>
/// Gets a value indicating whether there is a next page.
/// </summary>
public bool HasNextPage => this.CurrentPage < this.TotalPages;
}