29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { IsISO8601, Matches } from 'class-validator';
|
|
import { StringDecorator } from '../../../../common/decorators/validators.js';
|
|
import { IssueStatusListDecorator } from './issue-alias-list.decorator.js';
|
|
|
|
/** Без смещения дата трактовалась бы в часовом поясе сервера */
|
|
const WITH_OFFSET = /(Z|[+-]\d{2}:\d{2})$/;
|
|
const MOMENT_MESSAGE = '$property: ожидается ISO 8601 со смещением, например 2026-10-01T00:00:00+03:00';
|
|
|
|
export class CalendarIssuesQueryDto {
|
|
/** Начало видимой сетки календаря, включительно */
|
|
@IsISO8601({ strict: true }, { message: MOMENT_MESSAGE })
|
|
@Matches(WITH_OFFSET, { message: MOMENT_MESSAGE })
|
|
from: string;
|
|
|
|
/** Конец видимой сетки календаря, не включительно */
|
|
@IsISO8601({ strict: true }, { message: MOMENT_MESSAGE })
|
|
@Matches(WITH_OFFSET, { message: MOMENT_MESSAGE })
|
|
to: string;
|
|
|
|
@StringDecorator({ isOptional: true })
|
|
projectId?: string;
|
|
|
|
@StringDecorator({ isOptional: true })
|
|
assigneeId?: string;
|
|
|
|
@IssueStatusListDecorator()
|
|
status?: string[];
|
|
}
|