feat(dal): DistributionPeriods

This commit is contained in:
Mikhail Kuznetsov
2024-07-01 12:09:01 +10:00
parent ff37e6c10f
commit 6e378f2b06
13 changed files with 6557 additions and 41 deletions

View File

@@ -0,0 +1,29 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
/// <summary>
/// Период автоматического распеделения РР
/// </summary>
[Table("DistributionPeriods")]
public class DistributionPeriod : IBase
{
[Key]
public Guid Id { get; set; }
[NotMapped]
public DateTimeOffset DateCreated { get; set; }
[NotMapped]
public DateTimeOffset? DateModified { get; set; }
public required string Name { get; set; }
public TimeSpan Duration { get; set; }
public ICollection<EsppSchTypeValue> EsppSchTypeValues { get; set; } = new HashSet<EsppSchTypeValue>();
}
}

View File

@@ -36,6 +36,16 @@ namespace PARR.DAL.Models
public int Order { get; set; }
/// <summary>
/// Если есть связь с периодом, то есть функция автораспределения
/// </summary>
public Guid? DistributionPeriodId { get; set; }
[ForeignKey(nameof(DistributionPeriodId))]
public DistributionPeriod? DistributionPeriod { get; set; }
[ForeignKey(nameof(TypeId))]
public EsppSchType? EsppSchType { get; set; }