36 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using MongoDB.Bson;
 | |
| using MongoDB.Bson.Serialization.Attributes;
 | |
| using System.Text.Json.Serialization;
 | |
| 
 | |
| namespace Core.Adapters.Lib
 | |
| {
 | |
|     public abstract class InventoryItem : Document
 | |
|     {
 | |
|         [BsonElement("stock")]
 | |
|         [JsonPropertyName("stock")]
 | |
|         public int Stock { get; set; }
 | |
| 
 | |
|         [BsonElement("price")]
 | |
|         [JsonPropertyName("price")]
 | |
|         public decimal Price { get; set; }
 | |
| 
 | |
|         [BsonElement("currency")]
 | |
|         [JsonPropertyName("currency")]
 | |
|         public string Currency { get; set; } = null!;
 | |
| 
 | |
|         [BsonElement("categoryId")]
 | |
|         [BsonRepresentation(BsonType.String)]
 | |
|         [JsonPropertyName("categoryId")]
 | |
|         public Guid CategoryId { get; set; }
 | |
| 
 | |
|         [BsonElement("providerId")]
 | |
|         [BsonRepresentation(BsonType.String)]
 | |
|         [JsonPropertyName("providerId")]
 | |
|         public Guid ProviderId { get; set; }
 | |
| 
 | |
|         [BsonElement("attributes")]
 | |
|         [JsonPropertyName("attributes")]
 | |
|         public Dictionary<string, object> Attributes { get; set; } = [];
 | |
|     }
 | |
| }
 |