57 lines
2.1 KiB
TypeScript
57 lines
2.1 KiB
TypeScript
// DTO эндпоинта api/template-routes/{routeId}/steps
|
|
// (Application/TemplateRouteSteps/*.cs).
|
|
|
|
import { ComparisonOperator, HeadType, ProjectRole, RouteStepStatus } from './enums';
|
|
|
|
export interface TemplateRouteStep {
|
|
id: number;
|
|
orderNo: number;
|
|
executorEmail: string | null;
|
|
position: string | null;
|
|
projectRole: ProjectRole | null;
|
|
headType: HeadType | null;
|
|
status: RouteStepStatus;
|
|
routeId: number;
|
|
allowReassignToOtherApprovers: boolean;
|
|
/** Столбец списка SharePoint (internal name), по которому проверяется условие. */
|
|
fieldName: string | null;
|
|
operation: ComparisonOperator | null;
|
|
/** Значение для сравнения с fieldName. */
|
|
value: string | null;
|
|
/** Предупреждение бэкенда о сохранённом шаге (например, должность не найдена). */
|
|
warning?: string | null;
|
|
}
|
|
|
|
export interface CreateTemplateRouteStepInput {
|
|
orderNo: number;
|
|
executorEmail: string | null;
|
|
position: string | null;
|
|
projectRole: ProjectRole | null;
|
|
headType: HeadType | null;
|
|
status: RouteStepStatus;
|
|
allowReassignToOtherApprovers: boolean;
|
|
fieldName: string | null;
|
|
operation: ComparisonOperator | null;
|
|
value: string | null;
|
|
}
|
|
|
|
export type UpdateTemplateRouteStepInput = CreateTemplateRouteStepInput;
|
|
|
|
export interface PatchTemplateRouteStepInput {
|
|
orderNo?: number;
|
|
executorEmail?: string | null;
|
|
position?: string | null;
|
|
projectRole?: ProjectRole | null;
|
|
headType?: HeadType | null;
|
|
status?: RouteStepStatus;
|
|
allowReassignToOtherApprovers?: boolean;
|
|
fieldName?: string | null;
|
|
operation?: ComparisonOperator | null;
|
|
value?: string | null;
|
|
}
|
|
|
|
// Способ задать исполнителя шага: ровно одно из полей выше должно быть заполнено
|
|
// (см. TemplateRouteStepFields.CountFilled на бэкенде). Union-тип, а не строки
|
|
// по месту, — чтобы опечатку поймал компилятор.
|
|
export type StepExecutorKind = 'email' | 'position' | 'projectRole' | 'headType';
|