summaryrefslogtreecommitdiffstats
path: root/server/src/Endpoints/V1/Entries/EntryQueryPayload.cs
blob: 763ac8b9fd050dac8020d4025163cd32a477be47 (plain) (blame)
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
namespace IOL.GreatOffice.Api.Endpoints.V1.Entries;

/// <summary>
/// Query model for querying time entries.
/// </summary>
public class EntryQueryPayload
{
	/// <summary>
	/// Duration to filter with.
	/// </summary>
	public TimeEntryQueryDuration Duration { get; set; }

	/// <summary>
	/// List of categories to filter with.
	/// </summary>
	public List<TimeCategory.TimeCategoryDto> Categories { get; set; }

	/// <summary>
	/// List of labels to filter with.
	/// </summary>
	public List<TimeLabel.TimeLabelDto> Labels { get; set; }

	/// <summary>
	/// Date range to filter with, only respected if Duration is set to TimeEntryQueryDuration.DATE_RANGE.
	/// </summary>
	/// <see cref="TimeEntryQueryDuration"/>
	public QueryDateRange DateRange { get; set; }

	/// <summary>
	/// Spesific date to filter with,  only respected if Duration is set to TimeEntryQueryDuration.SPECIFIC_DATE.
	/// </summary>
	/// <see cref="TimeEntryQueryDuration"/>
	public DateTime SpecificDate { get; set; }

	/// <summary>
	/// Optional page number to show, goes well with PageSize.
	/// </summary>
	public int Page { get; set; }

	/// <summary>
	/// Optional page size to show, goes well with Page.
	/// </summary>
	public int PageSize { get; set; }

	/// <summary>
	/// Represents a date range.
	/// </summary>
	public class QueryDateRange
	{
		/// <summary>
		/// Range start
		/// </summary>
		public DateTime From { get; set; }

		/// <summary>
		/// Range end
		/// </summary>
		public DateTime To { get; set; }
	}
}