feat(api,dal): в модель JobGroupType добавлено поле description. В job контроллерах убрано поле isUmbrella, добавлено JobType.

This commit is contained in:
Mikhail Trubnikov
2025-11-17 12:06:33 +10:00
parent 48c8741395
commit e24ce20d02
15 changed files with 4143 additions and 22 deletions

View File

@@ -132,9 +132,9 @@ namespace PARR.DAL.Context
modelBuilder.Entity<JobGroupType>(f =>
{
f.HasData(
new() { Id = new Guid("4FA62E79-86BB-47C2-BE1A-72A716A170FA"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Simple.ToString(), Code = JobGroupTypesEnum.Simple },
new() { Id = new Guid("6EC58B1A-5C40-47B9-B036-4FA490E8D503"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Umbrella.ToString(), Code = JobGroupTypesEnum.Umbrella },
new() { Id = new Guid("318625E5-F833-436A-99DF-2A382A1E71C7"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Group.ToString(), Code = JobGroupTypesEnum.Group }
new() { Id = new Guid("4FA62E79-86BB-47C2-BE1A-72A716A170FA"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Simple.ToString(), Code = JobGroupTypesEnum.Simple, Description = "Обычный" },
new() { Id = new Guid("6EC58B1A-5C40-47B9-B036-4FA490E8D503"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Umbrella.ToString(), Code = JobGroupTypesEnum.Umbrella, Description = "Зонтик" },
new() { Id = new Guid("318625E5-F833-436A-99DF-2A382A1E71C7"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Group.ToString(), Code = JobGroupTypesEnum.Group, Description = "Сгруппированный" }
);
});
#endregion

View File

@@ -160,7 +160,7 @@ namespace PARR.DAL.DomainServices.Implementations
//фильтруем по количеству связей
if (job.Group?.IsUmbrella == true)
{
if (job.isParentRelationships == true)
if (job.IsParentRelationships == true)
query = query.Where(t => t.ParentUnits.Count >= job.MinValueRelationships && t.ParentUnits.Count <= job.MaxValueRelationships);
else
query = query.Where(t => t.ChildUnits.Count >= job.MinValueRelationships && t.ChildUnits.Count <= job.MaxValueRelationships);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class tblJobGroupTypeAddDescription : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Description",
schema: "job",
table: "GroupTypes",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
schema: "job",
table: "GroupTypes",
keyColumn: "Id",
keyValue: new Guid("318625e5-f833-436a-99df-2a382a1e71c7"),
column: "Description",
value: "Сгруппированный");
migrationBuilder.UpdateData(
schema: "job",
table: "GroupTypes",
keyColumn: "Id",
keyValue: new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"),
column: "Description",
value: "Обычный");
migrationBuilder.UpdateData(
schema: "job",
table: "GroupTypes",
keyColumn: "Id",
keyValue: new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"),
column: "Description",
value: "Зонтик");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Description",
schema: "job",
table: "GroupTypes");
}
}
}

View File

@@ -1709,6 +1709,10 @@ namespace PARR.DAL.Migrations
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
@@ -1726,6 +1730,7 @@ namespace PARR.DAL.Migrations
Id = new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"),
Code = 0,
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Обычный",
Name = "Simple"
},
new
@@ -1733,6 +1738,7 @@ namespace PARR.DAL.Migrations
Id = new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"),
Code = 1,
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Зонтик",
Name = "Umbrella"
},
new
@@ -1740,6 +1746,7 @@ namespace PARR.DAL.Migrations
Id = new Guid("318625e5-f833-436a-99df-2a382a1e71c7"),
Code = 2,
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Description = "Сгруппированный",
Name = "Group"
});
});

View File

@@ -23,6 +23,8 @@ namespace PARR.DAL.Models.Job
public required string Name { get; set; }
public required string Description { get; set; }
public ICollection<JobGroup> JobGroups { get; set; } = new HashSet<JobGroup>();
}
}