feat(dal): Добавлена таблица WorkGroups и AppInWorkGroups

This commit is contained in:
Mikhail Kuznetsov
2024-06-03 15:17:14 +10:00
parent faab4a6664
commit 90948108c1
11 changed files with 2985 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("AppInWorkInWorkGroups")]
[PrimaryKey(nameof(ApplicationsInWorkId), nameof(WorkGroupId))]
public class AppInWorkInWorkGroup
{
public Guid ApplicationsInWorkId { get; set; }
public Guid WorkGroupId { get; set; }
public ApplicationsInWork? ApplicationsInWork { get; set; }
public WorkGroup? WorkGroup { get; set; }
}
}

View File

@@ -108,5 +108,7 @@ namespace PARR.DAL.Models
public ICollection<Template> Templates { get; set; } = new HashSet<Template>();
public ICollection<EsppSchValue> EsppSchValues { get; set; } = new HashSet<EsppSchValue>();
public ICollection<AppInWorkInWorkGroup> WorkGroups { get; set; } = new HashSet<AppInWorkInWorkGroup>();
}
}

View File

@@ -30,6 +30,8 @@ namespace PARR.DAL.Models
public string? WorkGroup { get; set; }
public Guid? WorkGroupId { get; set; }
//TODO: удалить поле ResponseAreaStr
//public string? ResponseAreaStr { get; set; }
@@ -48,5 +50,8 @@ namespace PARR.DAL.Models
[ForeignKey(nameof(ResponseAreaCode))]
public ResponseArea? ResponseArea { get; set; }
[ForeignKey(nameof(WorkGroupId))]
public WorkGroup? WorkGroupItem { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("WorkGroups")]
public class WorkGroup : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
[NotMapped]
public DateTimeOffset? DateModified { get; set; }
public required string Name { get; set; }
public ICollection<Host> Hosts { get; set; } = new HashSet<Host>();
public ICollection<AppInWorkInWorkGroup> AppInWorks { get; set; } = new HashSet<AppInWorkInWorkGroup>();
}
}