Good structure so far

This commit is contained in:
lumijiez
2025-05-04 23:42:28 +03:00
parent e001ea67a3
commit b466a39e89
22 changed files with 466 additions and 335 deletions

View File

@@ -1,9 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Printbase.Infrastructure.DbEntities.Products;
[Table("ProductGroups")]
[Index(nameof(Name), IsUnique = true)]
public class ProductGroupDbEntity
{
[Key, Required]
@@ -16,5 +18,13 @@ public class ProductGroupDbEntity
public string? Description { get; set; }
[InverseProperty(nameof(ProductTypeDbEntity.Group)), Required]
public required ICollection<ProductTypeDbEntity> Types { get; set; }
public required ICollection<ProductTypeDbEntity> Types { get; set; } = [];
[Required]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime? UpdatedAt { get; set; }
[Required]
public bool IsActive { get; set; } = true;
}