From 3ae1965c293aca5f21ff9e1dd430770ad3816b73 Mon Sep 17 00:00:00 2001 From: "gorbenko.pavel" Date: Fri, 24 Jul 2026 16:53:35 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=88=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B3=D1=83=D0=B8=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/Tnsu.ApprovalRoute.Api/Program.cs | 1 - .../TemplateRoutes/TemplateRouteDto.cs | 12 +++---- .../TemplateRoutes/TemplateRouteService.cs | 35 ++++++++----------- .../TemplateRoutes/TemplateRouteValidators.cs | 4 +-- .../Entities/TemplateRoute.cs | 8 ++--- ...frastructureServiceCollectionExtensions.cs | 2 ++ .../Persistence/ApprovalRouteDbContext.cs | 4 +-- ... 20260724114550_InitialCreate.Designer.cs} | 22 ++++++------ ...ate.cs => 20260724114550_InitialCreate.cs} | 11 +++--- .../ApprovalRouteDbContextModelSnapshot.cs | 20 +++++------ .../TnsuPortal/HttpTnsuPortalClient.cs | 6 ++-- .../TnsuPortal/TnsuPortalDtos.cs | 2 +- .../TemplateRouteServiceTests.cs | 26 +++++++------- .../TemplateRouteStepServiceTests.cs | 4 +-- 14 files changed, 74 insertions(+), 83 deletions(-) rename backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/{20260724085143_InitialCreate.Designer.cs => 20260724114550_InitialCreate.Designer.cs} (91%) rename backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/{20260724085143_InitialCreate.cs => 20260724114550_InitialCreate.cs} (92%) diff --git a/backend/src/Tnsu.ApprovalRoute.Api/Program.cs b/backend/src/Tnsu.ApprovalRoute.Api/Program.cs index d3200eb..dccf8c5 100644 --- a/backend/src/Tnsu.ApprovalRoute.Api/Program.cs +++ b/backend/src/Tnsu.ApprovalRoute.Api/Program.cs @@ -16,7 +16,6 @@ var builder = WebApplication.CreateBuilder(args); builder.Services.AddApprovalRouteInfrastructure(builder.Configuration); builder.Services.AddApprovalRouteApplication(); builder.Services.AddApprovalRouteAuth(builder.Configuration); -builder.Services.AddHttpContextAccessor(); builder.Services.AddScoped(); builder.Services.AddOpenApi(options => { diff --git a/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteDto.cs b/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteDto.cs index ff964c4..1b1bd1b 100644 --- a/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteDto.cs +++ b/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteDto.cs @@ -6,22 +6,22 @@ public sealed record TemplateRouteDto( int Id, RouteType RouteType, int RequestTypeId, - string? Department, - string Company, + Guid? DepartmentId, + Guid CompanyId, bool ByProject, bool RequiresControl); public sealed record CreateTemplateRouteRequest( RouteType RouteType, int RequestTypeId, - string? Department, - string Company, + Guid? DepartmentId, + Guid CompanyId, bool ByProject, bool RequiresControl); public sealed record UpdateTemplateRouteRequest( RouteType RouteType, - string? Department, - string Company, + Guid? DepartmentId, + Guid CompanyId, bool ByProject, bool RequiresControl); diff --git a/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs b/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs index 24272d7..94167ca 100644 --- a/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs +++ b/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteService.cs @@ -22,7 +22,7 @@ public sealed class TemplateRouteService( var items = await query .Select(x => new TemplateRouteDto( - x.Id, x.RouteType, x.RequestTypeId, x.Department, x.Company, x.ByProject, x.RequiresControl)) + x.Id, x.RouteType, x.RequestTypeId, x.DepartmentId, x.CompanyId, x.ByProject, x.RequiresControl)) .ToListAsync(cancellationToken); return Result.Ok>(items); @@ -43,8 +43,7 @@ public sealed class TemplateRouteService( if (!requestTypeExists) return Result.Fail(new NotFoundError("Тип заявки", r.RequestTypeId)); - var department = Normalize(r.Department); - var duplicate = await HasDuplicateAsync(r.RequestTypeId, department, r.Company, r.ByProject, excludeId: null, cancellationToken); + var duplicate = await HasDuplicateAsync(r.RequestTypeId, r.DepartmentId, r.CompanyId, r.ByProject, excludeId: null, cancellationToken); if (duplicate) return Result.Fail(new ConflictError( "Маршрут с таким типом заявки, отделом, компанией и признаком «по проекту» уже существует.")); @@ -53,8 +52,8 @@ public sealed class TemplateRouteService( { RouteType = r.RouteType, RequestTypeId = r.RequestTypeId, - Department = department, - Company = r.Company, + DepartmentId = r.DepartmentId, + CompanyId = r.CompanyId, ByProject = r.ByProject, RequiresControl = r.RequiresControl }; @@ -70,15 +69,14 @@ public sealed class TemplateRouteService( if (entity is null) return Result.Fail(new NotFoundError("Маршрут", id)); - var department = Normalize(r.Department); - var duplicate = await HasDuplicateAsync(entity.RequestTypeId, department, r.Company, r.ByProject, excludeId: entity.Id, cancellationToken); + var duplicate = await HasDuplicateAsync(entity.RequestTypeId, r.DepartmentId, r.CompanyId, r.ByProject, excludeId: entity.Id, cancellationToken); if (duplicate) return Result.Fail(new ConflictError( "Маршрут с таким типом заявки, отделом, компанией и признаком «по проекту» уже существует.")); entity.RouteType = r.RouteType; - entity.Department = department; - entity.Company = r.Company; + entity.DepartmentId = r.DepartmentId; + entity.CompanyId = r.CompanyId; entity.ByProject = r.ByProject; entity.RequiresControl = r.RequiresControl; await db.SaveChangesAsync(cancellationToken); @@ -116,23 +114,22 @@ public sealed class TemplateRouteService( new NotFoundError("Сотрудник в справочнике api.tnsu.kz по email", email)); var byProject = request.ProjectId is not null; - var department = Normalize(employee.Department); var route = await db.TemplateRoutes.AsNoTracking() .Include(x => x.Steps) .Where(x => x.RequestTypeId == request.RequestTypeId && - x.Company == employee.Company && + x.CompanyId == employee.CompanyId && x.ByProject == byProject && - x.Department == department) + x.DepartmentId == employee.DepartmentId) .FirstOrDefaultAsync(cancellationToken) ?? await db.TemplateRoutes.AsNoTracking() .Include(x => x.Steps) .Where(x => x.RequestTypeId == request.RequestTypeId && - x.Company == employee.Company && + x.CompanyId == employee.CompanyId && x.ByProject == byProject && - x.Department == null) + x.DepartmentId == null) .FirstOrDefaultAsync(cancellationToken); if (route is null) @@ -154,12 +151,12 @@ public sealed class TemplateRouteService( } private Task HasDuplicateAsync( - int requestTypeId, string? department, string company, bool byProject, int? excludeId, CancellationToken cancellationToken) => + int requestTypeId, Guid? departmentId, Guid companyId, bool byProject, int? excludeId, CancellationToken cancellationToken) => db.TemplateRoutes.AnyAsync(x => x.Id != excludeId && x.RequestTypeId == requestTypeId && - x.Department == department && - x.Company == company && + x.DepartmentId == departmentId && + x.CompanyId == companyId && x.ByProject == byProject, cancellationToken); @@ -181,8 +178,6 @@ public sealed class TemplateRouteService( step.ProjectRole, step.HeadType, step.Status, step.AllowReassignToOtherApprovers); } - private static string? Normalize(string? value) => string.IsNullOrWhiteSpace(value) ? null : value; - private static TemplateRouteDto ToDto(TemplateRoute e) => new( - e.Id, e.RouteType, e.RequestTypeId, e.Department, e.Company, e.ByProject, e.RequiresControl); + e.Id, e.RouteType, e.RequestTypeId, e.DepartmentId, e.CompanyId, e.ByProject, e.RequiresControl); } diff --git a/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteValidators.cs b/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteValidators.cs index 01a22a9..0088486 100644 --- a/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteValidators.cs +++ b/backend/src/Tnsu.ApprovalRoute.Application/TemplateRoutes/TemplateRouteValidators.cs @@ -7,7 +7,7 @@ public sealed class CreateTemplateRouteRequestValidator : AbstractValidator x.Company).NotEmpty().WithMessage("Компания обязательна."); + RuleFor(x => x.CompanyId).NotEqual(Guid.Empty).WithMessage("Компания обязательна."); } } @@ -15,7 +15,7 @@ public sealed class UpdateTemplateRouteRequestValidator : AbstractValidator x.Company).NotEmpty().WithMessage("Компания обязательна."); + RuleFor(x => x.CompanyId).NotEqual(Guid.Empty).WithMessage("Компания обязательна."); } } diff --git a/backend/src/Tnsu.ApprovalRoute.Domain/Entities/TemplateRoute.cs b/backend/src/Tnsu.ApprovalRoute.Domain/Entities/TemplateRoute.cs index a691c75..bf50e4d 100644 --- a/backend/src/Tnsu.ApprovalRoute.Domain/Entities/TemplateRoute.cs +++ b/backend/src/Tnsu.ApprovalRoute.Domain/Entities/TemplateRoute.cs @@ -8,10 +8,10 @@ public class TemplateRoute public RouteType RouteType { get; set; } = RouteType.Sequential; public int RequestTypeId { get; set; } - // Компания и отдел инициатора — названия из справочника AD (api-tnsu-portal /Employee/ByEmail), - // хранятся строками без FK в этой БД. Отдел опционален, компания обязательна. - public string? Department { get; set; } - public string Company { get; set; } = string.Empty; + // Id компании/отдела инициатора из 1С/AD (api-tnsu-portal /Employee/ByEmail) — без FK в этой БД. + // Отдел опционален, компания обязательна. + public Guid? DepartmentId { get; set; } + public Guid CompanyId { get; set; } public bool ByProject { get; set; } public bool RequiresControl { get; set; } diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/InfrastructureServiceCollectionExtensions.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/InfrastructureServiceCollectionExtensions.cs index cdef65a..fccf5ce 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/InfrastructureServiceCollectionExtensions.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/InfrastructureServiceCollectionExtensions.cs @@ -13,6 +13,8 @@ public static class InfrastructureServiceCollectionExtensions public static IServiceCollection AddApprovalRouteInfrastructure( this IServiceCollection services, IConfiguration configuration) { + services.AddHttpContextAccessor(); + services.AddDbContext(opt => opt.UseNpgsql(configuration.GetConnectionString("Postgres")) .UseSnakeCaseNamingConvention()); diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/ApprovalRouteDbContext.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/ApprovalRouteDbContext.cs index 2721d86..a746779 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/ApprovalRouteDbContext.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/ApprovalRouteDbContext.cs @@ -22,10 +22,8 @@ public class ApprovalRouteDbContext(DbContextOptions opt { e.HasKey(x => x.Id); e.Property(x => x.RouteType).HasConversion().HasMaxLength(32).IsRequired(); - e.Property(x => x.Company).HasMaxLength(256).IsRequired(); - e.Property(x => x.Department).HasMaxLength(256); e.HasOne(x => x.RequestType).WithMany(x => x.Routes).HasForeignKey(x => x.RequestTypeId); - e.HasIndex(x => new { x.RequestTypeId, x.Department, x.Company, x.ByProject }).IsUnique(); + e.HasIndex(x => new { x.RequestTypeId, x.DepartmentId, x.CompanyId, x.ByProject }).IsUnique(); }); modelBuilder.Entity(e => diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724085143_InitialCreate.Designer.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724114550_InitialCreate.Designer.cs similarity index 91% rename from backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724085143_InitialCreate.Designer.cs rename to backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724114550_InitialCreate.Designer.cs index ff4bd31..3c494dd 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724085143_InitialCreate.Designer.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724114550_InitialCreate.Designer.cs @@ -1,4 +1,5 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; @@ -11,7 +12,7 @@ using Tnsu.ApprovalRoute.Infrastructure.Persistence; namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations { [DbContext(typeof(ApprovalRouteDbContext))] - [Migration("20260724085143_InitialCreate")] + [Migration("20260724114550_InitialCreate")] partial class InitialCreate { /// @@ -64,16 +65,13 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations .HasColumnType("boolean") .HasColumnName("by_project"); - b.Property("Company") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("company"); + b.Property("CompanyId") + .HasColumnType("uuid") + .HasColumnName("company_id"); - b.Property("Department") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("department"); + b.Property("DepartmentId") + .HasColumnType("uuid") + .HasColumnName("department_id"); b.Property("RequestTypeId") .HasColumnType("integer") @@ -92,9 +90,9 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations b.HasKey("Id") .HasName("pk_template_routes"); - b.HasIndex("RequestTypeId", "Department", "Company", "ByProject") + b.HasIndex("RequestTypeId", "DepartmentId", "CompanyId", "ByProject") .IsUnique() - .HasDatabaseName("ix_template_routes_request_type_id_department_company_by_proje"); + .HasDatabaseName("ix_template_routes_request_type_id_department_id_company_id_by"); b.ToTable("template_routes", (string)null); }); diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724085143_InitialCreate.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724114550_InitialCreate.cs similarity index 92% rename from backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724085143_InitialCreate.cs rename to backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724114550_InitialCreate.cs index 413382c..b442f61 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724085143_InitialCreate.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/20260724114550_InitialCreate.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable @@ -33,8 +34,8 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), route_type = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), request_type_id = table.Column(type: "integer", nullable: false), - department = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - company = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + department_id = table.Column(type: "uuid", nullable: true), + company_id = table.Column(type: "uuid", nullable: false), by_project = table.Column(type: "boolean", nullable: false), requires_control = table.Column(type: "boolean", nullable: false) }, @@ -81,9 +82,9 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations columns: new[] { "route_id", "order_no" }); migrationBuilder.CreateIndex( - name: "ix_template_routes_request_type_id_department_company_by_proje", + name: "ix_template_routes_request_type_id_department_id_company_id_by", table: "template_routes", - columns: new[] { "request_type_id", "department", "company", "by_project" }, + columns: new[] { "request_type_id", "department_id", "company_id", "by_project" }, unique: true); } diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/ApprovalRouteDbContextModelSnapshot.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/ApprovalRouteDbContextModelSnapshot.cs index 1043050..5eaa7cb 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/ApprovalRouteDbContextModelSnapshot.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/Persistence/Migrations/ApprovalRouteDbContextModelSnapshot.cs @@ -1,4 +1,5 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; @@ -61,16 +62,13 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations .HasColumnType("boolean") .HasColumnName("by_project"); - b.Property("Company") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("company"); + b.Property("CompanyId") + .HasColumnType("uuid") + .HasColumnName("company_id"); - b.Property("Department") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("department"); + b.Property("DepartmentId") + .HasColumnType("uuid") + .HasColumnName("department_id"); b.Property("RequestTypeId") .HasColumnType("integer") @@ -89,9 +87,9 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations b.HasKey("Id") .HasName("pk_template_routes"); - b.HasIndex("RequestTypeId", "Department", "Company", "ByProject") + b.HasIndex("RequestTypeId", "DepartmentId", "CompanyId", "ByProject") .IsUnique() - .HasDatabaseName("ix_template_routes_request_type_id_department_company_by_proje"); + .HasDatabaseName("ix_template_routes_request_type_id_department_id_company_id_by"); b.ToTable("template_routes", (string)null); }); diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/HttpTnsuPortalClient.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/HttpTnsuPortalClient.cs index d1b387e..81b0848 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/HttpTnsuPortalClient.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/HttpTnsuPortalClient.cs @@ -32,7 +32,7 @@ public sealed class HttpTnsuPortalClient( if (employee is null) return null; - return new EmployeeDirectoryInfo(employee.Company ?? string.Empty, employee.Section ?? string.Empty); + return new EmployeeDirectoryInfo(employee.CompanyId ?? Guid.Empty, employee.DepartmentId); } public async Task> GetProjectExecutorsAsync(Guid projectId, CancellationToken cancellationToken) @@ -82,8 +82,8 @@ public sealed class HttpTnsuPortalClient( } private sealed record EmployeeResponse( - [property: JsonPropertyName("company")] string? Company, - [property: JsonPropertyName("section")] string? Section); + [property: JsonPropertyName("companyId")] Guid? CompanyId, + [property: JsonPropertyName("departmentId")] Guid? DepartmentId); private sealed record ProjectResponse( [property: JsonPropertyName("projectManager")] string? ProjectManager, diff --git a/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/TnsuPortalDtos.cs b/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/TnsuPortalDtos.cs index 909cf2a..0abb76b 100644 --- a/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/TnsuPortalDtos.cs +++ b/backend/src/Tnsu.ApprovalRoute.Infrastructure/TnsuPortal/TnsuPortalDtos.cs @@ -2,6 +2,6 @@ using Tnsu.ApprovalRoute.Domain.Enums; namespace Tnsu.ApprovalRoute.Infrastructure.TnsuPortal; -public sealed record EmployeeDirectoryInfo(string Company, string Department); +public sealed record EmployeeDirectoryInfo(Guid CompanyId, Guid? DepartmentId); public sealed record ProjectExecutorInfo(ProjectRole ProjectRole, string Email); diff --git a/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs b/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs index ce63527..1c49452 100644 --- a/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs +++ b/backend/tests/Tnsu.ApprovalRoute.IntegrationTests/ApplicationServices/TemplateRouteServiceTests.cs @@ -12,8 +12,8 @@ namespace Tnsu.ApprovalRoute.IntegrationTests.ApplicationServices; public sealed class TemplateRouteServiceTests : IClassFixture { - private const string Company = "ТОО TANSU Construction"; - private const string Department = "IT"; + private static readonly Guid CompanyId = Guid.Parse("00000000-0000-0000-0000-000000000002"); + private static readonly Guid DepartmentId = Guid.Parse("00000000-0000-0000-0000-000000000001"); private readonly ServiceProvider _services; private readonly TemplateRouteService _service; @@ -24,7 +24,7 @@ public sealed class TemplateRouteServiceTests : IClassFixture(); portalClient .Setup(x => x.GetEmployeeByEmailAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new EmployeeDirectoryInfo(Company, Department)); + .ReturnsAsync(new EmployeeDirectoryInfo(CompanyId, DepartmentId)); portalClient .Setup(x => x.GetProjectExecutorsAsync(It.IsAny(), It.IsAny())) .ReturnsAsync([new ProjectExecutorInfo(ProjectRole.ProjectManager, "pm@tnsu.kz")]); @@ -45,7 +45,7 @@ public sealed class TemplateRouteServiceTests : IClassFixture(); @@ -158,7 +158,7 @@ public sealed class TemplateRouteServiceTests : IClassFixture(); @@ -184,7 +184,7 @@ public sealed class TemplateRouteServiceTests : IClassFixture { - private const string Company = "ТОО TANSU Construction"; + private static readonly Guid CompanyId = Guid.Parse("00000000-0000-0000-0000-000000000002"); private readonly TemplateRouteStepService _service; private readonly TemplateRouteService _routeService; @@ -30,7 +30,7 @@ public sealed class TemplateRouteStepServiceTests : IClassFixture