апи для работы с маршрутами согласования (#2)
Tests / test (push) Successful in 5m45s

Co-authored-by: gorbenko.pavel <gorbenko.pavel@tansu.kz>
Reviewed-on: http://git.tnsu.kz/gorbenko.pavel/tnsu-approval-route/pulls/2
Co-authored-by: gorbenko.pavel <gorbenko.pavel@tnsu.kz>
Co-committed-by: gorbenko.pavel <gorbenko.pavel@tnsu.kz>
This commit was merged in pull request #2.
This commit is contained in:
2026-07-27 13:14:32 +00:00
committed by admin
parent bc05df3f73
commit 602554ac64
59 changed files with 2515 additions and 152 deletions
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
namespace Tnsu.ApprovalRoute.Domain.Entities;
public class RequestType
{
public Guid Id { get; set; } = Guid.NewGuid();
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string PageUrl { get; set; } = string.Empty;
public ICollection<Route> Routes { get; set; } = new List<Route>();
public ICollection<TemplateRoute> Routes { get; set; } = new List<TemplateRoute>();
}
@@ -1,20 +0,0 @@
using Tnsu.ApprovalRoute.Domain.Enums;
namespace Tnsu.ApprovalRoute.Domain.Entities;
public class Route
{
public Guid Id { get; set; } = Guid.NewGuid();
public RouteType RouteType { get; set; } = RouteType.Sequential;
public Guid RequestTypeId { get; set; }
// Внешние справочники (1С/ZUP) — хранятся как ссылки без FK в этой БД.
public Guid DepartmentId { get; set; }
public Guid CompanyId { get; set; }
public bool ByProject { get; set; }
public bool RequiresControl { get; set; }
public RequestType? RequestType { get; set; }
public ICollection<RouteStep> Steps { get; set; } = new List<RouteStep>();
}
@@ -1,20 +0,0 @@
using Tnsu.ApprovalRoute.Domain.Enums;
namespace Tnsu.ApprovalRoute.Domain.Entities;
public class RouteStep
{
public Guid Id { get; set; } = Guid.NewGuid();
public int OrderNo { get; set; }
// Внешняя ссылка на пользователя (1С/ZUP) — без локальной таблицы Users.
public string ExecutorEmail { get; set; } = string.Empty;
public string Position { get; set; } = string.Empty;
public ProjectRole ProjectRole { get; set; } = ProjectRole.None;
public RouteStepStatus Status { get; set; } = RouteStepStatus.Draft;
public Guid RouteId { get; set; }
public bool AllowReassignToOtherApprovers { get; set; }
public Route? Route { get; set; }
}
@@ -0,0 +1,19 @@
using Tnsu.ApprovalRoute.Domain.Enums;
namespace Tnsu.ApprovalRoute.Domain.Entities;
public class TemplateRoute
{
public int Id { get; set; }
public RouteType RouteType { get; set; } = RouteType.Sequential;
public int RequestTypeId { get; set; }
public Guid? DepartmentId { get; set; }
public Guid CompanyId { get; set; }
public bool ByProject { get; set; }
public bool RequiresControl { get; set; }
public RequestType? RequestType { get; set; }
public ICollection<TemplateRouteStep> Steps { get; set; } = new List<TemplateRouteStep>();
}
@@ -0,0 +1,20 @@
using Tnsu.ApprovalRoute.Domain.Enums;
namespace Tnsu.ApprovalRoute.Domain.Entities;
public class TemplateRouteStep
{
public int Id { get; set; }
public int OrderNo { get; set; }
public string? ExecutorEmail { get; set; }
public string? Position { get; set; }
public ProjectRole? ProjectRole { get; set; }
public HeadType? HeadType { get; set; }
public RouteStepStatus Status { get; set; } = RouteStepStatus.Approval;
public int RouteId { get; set; }
public bool AllowReassignToOtherApprovers { get; set; }
public TemplateRoute? Route { get; set; }
}
@@ -0,0 +1,9 @@
namespace Tnsu.ApprovalRoute.Domain.Enums;
public enum HeadType
{
None,
Chief,
DirectionHead,
DirectorTansu
}
@@ -3,7 +3,8 @@ namespace Tnsu.ApprovalRoute.Domain.Enums;
public enum ProjectRole
{
None,
Manager,
Engineer,
Observer
ProjectManager,
Planner,
ManagerHSE,
Security
}
@@ -3,11 +3,6 @@ namespace Tnsu.ApprovalRoute.Domain.Enums;
public enum RouteStepStatus
{
None,
Draft,
OnApproval,
Approved,
InExecution,
Completed,
Returned,
Closed
Approval,
Execution
}