First version of DAL
This commit is contained in:
		| @@ -0,0 +1,101 @@ | ||||
| // *********************************************************************** | ||||
| // <copyright file="FurnitureBaseRequest.cs"> | ||||
| //     Core.Inventory | ||||
| // </copyright> | ||||
| // *********************************************************************** | ||||
| using MongoDB.Bson; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Inventory.Domain.Contexts.Inventory.Request | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Data transfer object (DTO) for creating or updating a furniture base model. | ||||
|     /// </summary> | ||||
|     public class FurnitureBaseRequest | ||||
|     { | ||||
|         /// <summary> | ||||
|         /// Gets or sets the name of the model. | ||||
|         /// </summary> | ||||
|         [BsonElement("modelName")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("modelName")] | ||||
|         public string ModelName { get; set; } = null!; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the material of the furniture. | ||||
|         /// </summary> | ||||
|         [BsonElement("material")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("material")] | ||||
|         public string Material { get; set; } = null!; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the condition (e.g., new, refurbished). | ||||
|         /// </summary> | ||||
|         [BsonElement("condition")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("condition")] | ||||
|         public string Condition { get; set; } = null!; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the base description. | ||||
|         /// </summary> | ||||
|         [BsonElement("baseDescription")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("baseDescription")] | ||||
|         public string? BaseDescription { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the 3D or graphical representation. | ||||
|         /// </summary> | ||||
|         [BsonElement("representation")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("representation")] | ||||
|         public string? Representation { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the maintenance notes. | ||||
|         /// </summary> | ||||
|         [BsonElement("maintenanceNotes")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("maintenanceNotes")] | ||||
|         public string? MaintenanceNotes { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the dimensions of the furniture. | ||||
|         /// </summary> | ||||
|         [BsonElement("dimensions")] | ||||
|         [JsonPropertyName("dimensions")] | ||||
|         public DimensionsRequest Dimensions { get; set; } = new(); | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the list of variant IDs related to this model. | ||||
|         /// </summary> | ||||
|         [BsonElement("variantIds")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("variantIds")] | ||||
|         public List<string>? VariantIds { get; set; } | ||||
|     } | ||||
|  | ||||
|     /// <summary> | ||||
|     /// Dimensions DTO for width, height and depth. | ||||
|     /// </summary> | ||||
|     public class DimensionsRequest | ||||
|     { | ||||
|         [BsonElement("width")] | ||||
|         [BsonRepresentation(BsonType.Double)] | ||||
|         [JsonPropertyName("width")] | ||||
|         public float Width { get; set; } | ||||
|  | ||||
|         [BsonElement("height")] | ||||
|         [BsonRepresentation(BsonType.Double)] | ||||
|         [JsonPropertyName("height")] | ||||
|         public float Height { get; set; } | ||||
|  | ||||
|         [BsonElement("depth")] | ||||
|         [BsonRepresentation(BsonType.Double)] | ||||
|         [JsonPropertyName("depth")] | ||||
|         public float Depth { get; set; } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,53 @@ | ||||
| // *********************************************************************** | ||||
| // <copyright file="FurnitureVariantRequest.cs"> | ||||
| //     Core.Inventory | ||||
| // </copyright> | ||||
| // *********************************************************************** | ||||
| using MongoDB.Bson; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Inventory.Domain.Contexts.Inventory.Request | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Data transfer object (DTO) for creating or updating a furniture variant. | ||||
|     /// </summary> | ||||
|     public class FurnitureVariantRequest : InventoryItemRequestBase | ||||
|     { | ||||
|         /// <summary> | ||||
|         /// Gets or sets the model ID this variant belongs to (FK). | ||||
|         /// </summary> | ||||
|         [Required] | ||||
|         [BsonElement("modelId")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("modelId")] | ||||
|         public string ModelId { get; set; } = null!; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the name of the variant. | ||||
|         /// </summary> | ||||
|         [Required] | ||||
|         [BsonElement("name")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("name")] | ||||
|         public string Name { get; set; } = null!; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the color of the furniture variant. | ||||
|         /// </summary> | ||||
|         [Required] | ||||
|         [BsonElement("color")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("color")] | ||||
|         public string Color { get; set; } = null!; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the product line (e.g., Premium, Eco). | ||||
|         /// </summary> | ||||
|         [BsonElement("line")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("line")] | ||||
|         public string? Line { get; set; } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,66 @@ | ||||
| // *********************************************************************** | ||||
| // <copyright file="InventoryItemRequestBase.cs"> | ||||
| //     Core.Inventory | ||||
| // </copyright> | ||||
| // *********************************************************************** | ||||
| using MongoDB.Bson; | ||||
| using MongoDB.Bson.Serialization.Attributes; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace Core.Inventory.Domain.Contexts.Inventory.Request | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Base data transfer object (DTO) for inventory-related items. | ||||
|     /// Serves as a foundation for specific item types such as furniture variants, tools, or electronics. | ||||
|     /// </summary> | ||||
|     public abstract class InventoryItemRequestBase | ||||
|     { | ||||
|         /// <summary> | ||||
|         /// Gets or sets the quantity in stock. | ||||
|         /// </summary> | ||||
|         [BsonElement("stock")] | ||||
|         [BsonRepresentation(BsonType.Int32)] | ||||
|         [JsonPropertyName("stock")] | ||||
|         public int Stock { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the unit price of the item. | ||||
|         /// </summary> | ||||
|         [BsonElement("price")] | ||||
|         [BsonRepresentation(BsonType.Decimal128)] | ||||
|         [JsonPropertyName("price")] | ||||
|         public decimal Price { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the currency in which the price is expressed. | ||||
|         /// </summary> | ||||
|         [BsonElement("currency")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("currency")] | ||||
|         public string Currency { get; set; } = "MXN"; | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the category identifier the item belongs to. | ||||
|         /// </summary> | ||||
|         [BsonElement("categoryId")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("categoryId")] | ||||
|         public Guid CategoryId { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets the provider or vendor identifier of the item. | ||||
|         /// </summary> | ||||
|         [BsonElement("providerId")] | ||||
|         [BsonRepresentation(BsonType.String)] | ||||
|         [JsonPropertyName("providerId")] | ||||
|         public Guid ProviderId { get; set; } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets or sets additional customizable attributes. | ||||
|         /// Useful for storing arbitrary metadata specific to the item type. | ||||
|         /// </summary> | ||||
|         [BsonElement("attributes")] | ||||
|         [JsonPropertyName("attributes")] | ||||
|         public Dictionary<string, object> Attributes { get; set; } = []; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								Core.Inventory.Domain/Core.Inventory.Domain.csproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Core.Inventory.Domain/Core.Inventory.Domain.csproj
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||
|  | ||||
|   <PropertyGroup> | ||||
|     <TargetFramework>net8.0</TargetFramework> | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|     <Nullable>enable</Nullable> | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="BuildingBlocks.Library" Version="1.0.0" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
		Reference in New Issue
	
	Block a user