переход на реальное api

This commit is contained in:
gorbenko.pavel
2026-07-24 12:27:42 +05:00
parent 2759c1ef7d
commit fa13e93190
24 changed files with 271 additions and 99 deletions
@@ -22,8 +22,10 @@ public class ApprovalRouteDbContext(DbContextOptions<ApprovalRouteDbContext> opt
{
e.HasKey(x => x.Id);
e.Property(x => x.RouteType).HasConversion<string>().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.DepartmentId, x.CompanyId, x.ByProject }).IsUnique();
e.HasIndex(x => new { x.RequestTypeId, x.Department, x.Company, x.ByProject }).IsUnique();
});
modelBuilder.Entity<TemplateRouteStep>(e =>
@@ -12,7 +12,7 @@ using Tnsu.ApprovalRoute.Infrastructure.Persistence;
namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
{
[DbContext(typeof(ApprovalRouteDbContext))]
[Migration("20260723074943_InitialCreate")]
[Migration("20260724071302_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
@@ -61,13 +61,16 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
.HasColumnType("boolean")
.HasColumnName("by_project");
b.Property<Guid>("CompanyId")
.HasColumnType("uuid")
.HasColumnName("company_id");
b.Property<string>("Company")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("company");
b.Property<Guid?>("DepartmentId")
.HasColumnType("uuid")
.HasColumnName("department_id");
b.Property<string>("Department")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("department");
b.Property<Guid>("RequestTypeId")
.HasColumnType("uuid")
@@ -86,9 +89,9 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
b.HasKey("Id")
.HasName("pk_template_routes");
b.HasIndex("RequestTypeId", "DepartmentId", "CompanyId", "ByProject")
b.HasIndex("RequestTypeId", "Department", "Company", "ByProject")
.IsUnique()
.HasDatabaseName("ix_template_routes_request_type_id_department_id_company_id_by");
.HasDatabaseName("ix_template_routes_request_type_id_department_company_by_proje");
b.ToTable("template_routes", (string)null);
});
@@ -31,8 +31,8 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
id = table.Column<Guid>(type: "uuid", nullable: false),
route_type = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
request_type_id = table.Column<Guid>(type: "uuid", nullable: false),
department_id = table.Column<Guid>(type: "uuid", nullable: true),
company_id = table.Column<Guid>(type: "uuid", nullable: false),
department = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
company = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
by_project = table.Column<bool>(type: "boolean", nullable: false),
requires_control = table.Column<bool>(type: "boolean", nullable: false)
},
@@ -78,9 +78,9 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
columns: new[] { "route_id", "order_no" });
migrationBuilder.CreateIndex(
name: "ix_template_routes_request_type_id_department_id_company_id_by",
name: "ix_template_routes_request_type_id_department_company_by_proje",
table: "template_routes",
columns: new[] { "request_type_id", "department_id", "company_id", "by_project" },
columns: new[] { "request_type_id", "department", "company", "by_project" },
unique: true);
}
@@ -58,13 +58,16 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
.HasColumnType("boolean")
.HasColumnName("by_project");
b.Property<Guid>("CompanyId")
.HasColumnType("uuid")
.HasColumnName("company_id");
b.Property<string>("Company")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("company");
b.Property<Guid?>("DepartmentId")
.HasColumnType("uuid")
.HasColumnName("department_id");
b.Property<string>("Department")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("department");
b.Property<Guid>("RequestTypeId")
.HasColumnType("uuid")
@@ -83,9 +86,9 @@ namespace Tnsu.ApprovalRoute.Infrastructure.Persistence.Migrations
b.HasKey("Id")
.HasName("pk_template_routes");
b.HasIndex("RequestTypeId", "DepartmentId", "CompanyId", "ByProject")
b.HasIndex("RequestTypeId", "Department", "Company", "ByProject")
.IsUnique()
.HasDatabaseName("ix_template_routes_request_type_id_department_id_company_id_by");
.HasDatabaseName("ix_template_routes_request_type_id_department_company_by_proje");
b.ToTable("template_routes", (string)null);
});