Removed strongly typed inventory objects

Added EAV inventory types

Added EAV object handling philosophy

Added controllers

Added EF Core migration integration
This commit is contained in:
2026-05-02 19:20:34 -05:00
parent a76785e602
commit 75c381e645
44 changed files with 755 additions and 219 deletions
-6
View File
@@ -1,6 +0,0 @@
namespace WyvernInventory.Core.Models;
public record Computer() : GenericInventoryItem
{
}
-6
View File
@@ -1,6 +0,0 @@
namespace WyvernInventory.Core.Models;
public record Cpu() : GenericInventoryItem
{
}
+13
View File
@@ -0,0 +1,13 @@
namespace WyvernInventory.Core.Models;
public class Enums
{
public enum DataType
{
String,
Int,
Decimal,
Bool,
DateTime
}
}
-6
View File
@@ -1,6 +0,0 @@
namespace WyvernInventory.Core.Models;
public record Gpu() : GenericInventoryItem
{
}
@@ -0,0 +1,10 @@
namespace WyvernInventory.Core.Models;
public record InventoryAttributeDefinition
{
public int? Id { get; set; }
public int? TypeId { get; set; }
public InventoryType? Type { get; set; } = null!;
public string? Name { get; set; } = "";
public Enums.DataType? DataType { get; set; }
}
@@ -1,8 +1,8 @@
namespace WyvernInventory.Core.Models;
public record GenericInventoryItem()
public record InventoryAttributeDefinitionDto
{
public int? Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public Enums.DataType? DataType { get; set; }
}
@@ -0,0 +1,16 @@
namespace WyvernInventory.Core.Models;
public record InventoryAttributeValue
{
public int? Id { get; set; }
public int? ItemId { get; set; }
public InventoryItem? Item { get; set; } = null!;
public int? AttributeDefinitionId { get; set; }
public InventoryAttributeDefinition? AttributeDefinition { get; set; } = null!;
public string? StringValue { get; set; }
public int? IntValue { get; set; }
public decimal? DecimalValue { get; set; }
public bool? BoolValue { get; set; }
public DateTime? DateTimeValue { get; set; }
}
@@ -0,0 +1,16 @@
namespace WyvernInventory.Core.Models;
public record InventoryAttributeValueDto
{
public int? Id { get; set; }
public int? ItemId { get; set; }
public InventoryItemDto? Item { get; set; } = null!;
public int? AttributeDefinitionId { get; set; }
public InventoryAttributeDefinitionDto? AttributeDefinition { get; set; } = null!;
public string? StringValue { get; set; }
public int? IntValue { get; set; }
public decimal? DecimalValue { get; set; }
public bool? BoolValue { get; set; }
public DateTime? DateTimeValue { get; set; }
}
@@ -0,0 +1,15 @@
namespace WyvernInventory.Core.Models;
public record InventoryAttributeValueRequest
{
public int? Id { get; set; }
public int? ItemId { get; set; }
public int? AttributeDefinitionId { get; set; }
public string? StringValue { get; set; }
public int? IntValue { get; set; }
public decimal? DecimalValue { get; set; }
public bool? BoolValue { get; set; }
public DateTime? DateTimeValue { get; set; }
}
@@ -0,0 +1,10 @@
namespace WyvernInventory.Core.Models;
public record InventoryItem
{
public int? Id { get; set; }
public string? Name { get; set; } = "";
public int? TypeId { get; set; }
public InventoryType? Type { get; set; } = null!;
public List<InventoryAttributeValue>? AttributeValues { get; set; } = [];
}
@@ -0,0 +1,9 @@
namespace WyvernInventory.Core.Models;
public record InventoryItemDto
{
public int Id { get; set; }
public string Name { get; set; } = "";
public InventoryTypeDto Type { get; set; }
public List<InventoryAttributeValueDto> AttributeValues { get; set; } = [];
}
@@ -0,0 +1,9 @@
namespace WyvernInventory.Core.Models;
public record InventoryItemRequest
{
public int? Id { get; set; }
public string? Name { get; set; } = "";
public int? TypeId { get; set; }
public List<InventoryAttributeValueRequest>? AttributeValues { get; set; } = [];
}
@@ -0,0 +1,8 @@
namespace WyvernInventory.Core.Models;
public record InventoryType
{
public int? Id { get; set; }
public string Name { get; set; } = "";
public List<InventoryAttributeDefinition> AttributeDefinitions { get; set; } = [];
}
@@ -0,0 +1,8 @@
namespace WyvernInventory.Core.Models;
public record InventoryTypeDto
{
public int? Id { get; set; }
public string? Name { get; set; }
public List<InventoryAttributeDefinitionDto>? AttributeDefinitions { get; set; }
}
-6
View File
@@ -1,6 +0,0 @@
namespace WyvernInventory.Core.Models;
public record Router() : GenericInventoryItem
{
}
@@ -1,6 +0,0 @@
namespace WyvernInventory.Core.Models;
public record StorageDrive() : GenericInventoryItem
{
}
-6
View File
@@ -1,6 +0,0 @@
namespace WyvernInventory.Core.Models;
public record Switch() : GenericInventoryItem
{
}