first version of inventory adapters
This commit is contained in:
		| @@ -1,29 +0,0 @@ | ||||
| using Core.Blueprint.Mongo; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Adapters.Lib.Inventory.Base | ||||
| { | ||||
|     [CollectionAttributeName("Inventory")] | ||||
|     public class InventoryItem : Document | ||||
|     { | ||||
|         [BsonElement("name")] | ||||
|         [JsonPropertyName("name")] | ||||
|         public string Name { get; set; } | ||||
|  | ||||
|         [BsonElement("description")] | ||||
|         [JsonPropertyName("description")] | ||||
|         public string Description { get; set; } | ||||
|  | ||||
|         [BsonElement("stock")] | ||||
|         [JsonPropertyName("stock")] | ||||
|         public int Stock { get; set; } | ||||
|  | ||||
|         [BsonElement("representation")] | ||||
|         [JsonPropertyName("representation")] | ||||
|         public string Representation { get; set; } | ||||
|  | ||||
|  | ||||
|         public string Company { get; set; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										53
									
								
								Inventory/Common/FurnitureModel.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								Inventory/Common/FurnitureModel.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | ||||
| using Core.Blueprint.Mongo; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Adapters.Lib.Inventory.Common | ||||
| { | ||||
|     [CollectionAttributeName("Furniture")] | ||||
|     public class FurnitureModel : Document | ||||
|     { | ||||
|         [BsonElement("modelName")] | ||||
|         [JsonPropertyName("modelName")] | ||||
|         public string ModelName { get; set; } | ||||
|  | ||||
|         [BsonElement("material")] | ||||
|         [JsonPropertyName("material")] | ||||
|         public string Material { get; set; } | ||||
|  | ||||
|         [BsonElement("condition")] | ||||
|         [JsonPropertyName("condition")] | ||||
|         public string Condition { get; set; } | ||||
|  | ||||
|         [BsonElement("dimensions")] | ||||
|         [JsonPropertyName("dimensions")] | ||||
|         public Dimensions Dimensions { get; set; } | ||||
|  | ||||
|         [BsonElement("baseDescription")] | ||||
|         [JsonPropertyName("baseDescription")] | ||||
|         public string BaseDescription { get; set; } | ||||
|  | ||||
|         [BsonElement("representation")] | ||||
|         [JsonPropertyName("representation")] | ||||
|         public string Representation { get; set; } | ||||
|  | ||||
|         [BsonElement("maintenanceNotes")] | ||||
|         [JsonPropertyName("maintenanceNotes")] | ||||
|         public string MaintenanceNotes { get; set; } | ||||
|     } | ||||
|  | ||||
|     public class Dimensions | ||||
|     { | ||||
|         [BsonElement("width")] | ||||
|         [JsonPropertyName("width")] | ||||
|         public float Width { get; set; } | ||||
|  | ||||
|         [BsonElement("height")] | ||||
|         [JsonPropertyName("height")] | ||||
|         public float Height { get; set; } | ||||
|  | ||||
|         [BsonElement("depth")] | ||||
|         [JsonPropertyName("depth")] | ||||
|         public float Depth { get; set; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										51
									
								
								Inventory/InventoryItem.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								Inventory/InventoryItem.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | ||||
| using Core.Adapters.Lib.Inventory.Common; | ||||
| using Core.Blueprint.Mongo; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Adapters.Lib.Inventory | ||||
| { | ||||
|     [CollectionAttributeName("Inventory")] | ||||
|     public class InventoryItem : FurnitureModel | ||||
|     { | ||||
|         [BsonElement("modelId")] | ||||
|         [JsonPropertyName("modelId")] | ||||
|         public string ModelId { get; set; }  // FK a FurnitureModel._id | ||||
|  | ||||
|         [BsonElement("name")] | ||||
|         [JsonPropertyName("name")] | ||||
|         public string Name { get; set; } | ||||
|  | ||||
|         [BsonElement("color")] | ||||
|         [JsonPropertyName("color")] | ||||
|         public string Color { get; set; } | ||||
|  | ||||
|         [BsonElement("line")] | ||||
|         [JsonPropertyName("line")] | ||||
|         public string Line { get; set; } | ||||
|  | ||||
|         [BsonElement("price")] | ||||
|         [JsonPropertyName("price")] | ||||
|         public decimal Price { get; set; } | ||||
|  | ||||
|         [BsonElement("currency")] | ||||
|         [JsonPropertyName("currency")] | ||||
|         public string Currency { get; set; } | ||||
|  | ||||
|         [BsonElement("stock")] | ||||
|         [JsonPropertyName("stock")] | ||||
|         public int Stock { get; set; } | ||||
|  | ||||
|         [BsonElement("categoryId")] | ||||
|         [JsonPropertyName("categoryId")] | ||||
|         public Guid CategoryId { get; set; } | ||||
|  | ||||
|         [BsonElement("providerId")] | ||||
|         [JsonPropertyName("providerId")] | ||||
|         public Guid ProviderId { get; set; } | ||||
|  | ||||
|         [BsonElement("attributes")] | ||||
|         [JsonPropertyName("attributes")] | ||||
|         public Dictionary<string, object> Attributes { get; set; } = new(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user