From ca8de91742d3fe609d5616b5d9e7a83ba618ed39 Mon Sep 17 00:00:00 2001 From: "gorbenko.pavel" Date: Tue, 25 Aug 2026 10:15:11 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B7=D0=BE=D0=BB=D0=B2=20=D0=BC?= =?UTF-8?q?=D0=B0=D1=80=D1=88=D1=80=D1=83=D1=82=D0=B0:=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=B5=20PositionCode=20(HeadType)=20=D0=B2=20=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D0=B5=20=D1=88=D0=B0=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Раньше по ответу резолва нельзя было отличить «руководителя направления» от «директора Tansu» иначе как парсингом Position (реальной должности из справочника api.tnsu.kz, свободный текст). PositionCode — это HeadType самого шага (Chief/DirectionHead/DirectorTansu/ManagingDirectorTansu/ DepartmentHead), null для шагов с исполнителем по email/должности/роли. Co-Authored-By: Claude Sonnet 5 --- .../TemplateRoutes/ResolveTemplateRouteDto.cs | 10 +++++++++- .../TemplateRoutes/TemplateRouteService.cs | 3 ++- .../ApplicationServices/TemplateRouteServiceTests.cs | 3 +++ frontend/src/webparts/approvalAdmin/models/resolve.ts | 8 +++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/ResolveTemplateRouteDto.cs b/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/ResolveTemplateRouteDto.cs index 1aba714..7632e7d 100644 --- a/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/ResolveTemplateRouteDto.cs +++ b/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/ResolveTemplateRouteDto.cs @@ -13,6 +13,13 @@ namespace Tnsu.ApprovalRoute.Application.TemplateRoutes; /// /// Спрашивать ли причину просрочки — так же с уже применённым наследованием. /// +/// +/// HeadType шага (Chief/DirectionHead/DirectorTansu/ManagingDirectorTansu/DepartmentHead), +/// если исполнитель задан типом руководителя, иначе null. В отличие от +/// (реальная должность резолвнутого сотрудника из справочника api.tnsu.kz — свободный +/// текст), это код роли из самого шага маршрута — чтобы вызывающая сторона могла отличить, +/// например, «директора Tansu» от «руководителя направления», не разбирая Position текстом. +/// public sealed record ResolvedRouteStepDto( int Id, int OrderNo, @@ -21,7 +28,8 @@ public sealed record ResolvedRouteStepDto( bool AllowReassignToOtherApprovers, string? Warning = null, int? SlaHours = null, - bool? AskOverdueReason = null); + bool? AskOverdueReason = null, + HeadType? PositionCode = null); public sealed record ResolveTemplateRouteResultDto( int RouteId, diff --git a/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs b/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs index c087d9f..c845f37 100644 --- a/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs +++ b/backend/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs @@ -340,7 +340,8 @@ public sealed class TemplateRouteService( step.AllowReassignToOtherApprovers, combinedWarning.Length == 0 ? null : combinedWarning, step.SlaHours ?? requestType.SlaHours, - step.AskOverdueReason ?? requestType.AskOverdueReason); + step.AskOverdueReason ?? requestType.AskOverdueReason, + step.HeadType is null or HeadType.None ? null : step.HeadType); } /// diff --git a/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs b/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs index b7f7201..031c277 100644 --- a/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs +++ b/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs @@ -182,6 +182,8 @@ public sealed class TemplateRouteServiceTests : IClassFixture