re-factor in adapters

This commit is contained in:
2025-06-22 01:58:31 -06:00
parent f6a80ba2ec
commit ad7b1bd983
3 changed files with 37 additions and 25 deletions

View File

@@ -1,27 +1,13 @@
using Core.Blueprint.Mongo;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Attributes;
using System.Text.Json.Serialization;
namespace Core.Adapters.Lib
namespace Core.Adapters.Lib.Inventory
{
[CollectionAttributeName("Inventory")]
public class InventoryItem : FurnitureModel
public abstract class InventoryItem : Document
{
[BsonElement("modelId")]
[JsonPropertyName("modelId")]
public string ModelId { get; set; } = null!; // FK to FurnitureModel._id
[BsonElement("name")]
[JsonPropertyName("name")]
public string Name { get; set; } = null!;
[BsonElement("color")]
[JsonPropertyName("color")]
public string Color { get; set; } = null!;
[BsonElement("line")]
[JsonPropertyName("line")]
public string Line { get; set; } = null!;
[BsonElement("stock")]
[JsonPropertyName("stock")]
public int Stock { get; set; }
[BsonElement("price")]
[JsonPropertyName("price")]
@@ -31,10 +17,6 @@ namespace Core.Adapters.Lib
[JsonPropertyName("currency")]
public string Currency { get; set; } = null!;
[BsonElement("stock")]
[JsonPropertyName("stock")]
public int Stock { get; set; }
[BsonElement("categoryId")]
[JsonPropertyName("categoryId")]
public Guid CategoryId { get; set; }