feat: changed get time logic to approvers

This commit is contained in:
Тимур Городецкий
2026-08-13 10:01:08 +05:00
parent 2e6e138e8d
commit 8578653c16
55 changed files with 2249 additions and 46 deletions
@@ -41,12 +41,16 @@ export async function resolveRoute(
userEmail: string,
status: ApprovalStatus = 'Approval',
departmentId: string | null = null,
fieldValues: IResolveFieldValue[] = []
fieldValues: IResolveFieldValue[] = [],
projectId: string | null = null
): Promise<IResolvedRoute> {
const c = await client(context);
const url = `${APPROVAL_API_BASE_URL}/api/template-routes/resolve`;
// Эндпоинт сменился с GET (query) на POST (JSON-тело).
// projectId (uuid проекта) — для форм, где согласующий зависит от проекта
// (напр. «руководитель проекта-источника» в СЗ на перемещение ТМЦ): бэкенд по
// нему подставляет исполнителя роли. Формы без привязки к проекту шлют null.
const response: HttpClientResponse = await c.post(url, AadHttpClient.configurations.v1, {
headers: {
'Content-Type': 'application/json',
@@ -55,7 +59,7 @@ export async function resolveRoute(
body: JSON.stringify({
requestTypeId,
userEmail,
projectId: null,
projectId: projectId || null,
status,
fieldValues,
departmentId: departmentId || null