blob: bccc589ffbd538e56ea6ccc154710d39b93dee16 (
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
|
import type { HourEntry } from "./WorkEntry";
import type { IValidationResult } from "../internal/IValidationResult";
import ValidationResult from "../internal/IValidationResult";
export interface IWorkQuery {
results: Array<HourEntry>,
page: number,
pageSize: number,
totalRecords: number,
totalPageCount: number,
is_valid: Function
}
export class WorkQuery implements IWorkQuery {
results: HourEntry[];
page: number;
pageSize: number;
totalRecords: number;
totalPageCount: number;
is_valid(): IValidationResult {
const result = new ValidationResult();
if (this.page < 0) {
result.add_error("page", {
title: "Page cannot be less than zero",
})
}
return result;
}
}
|