Compare commits
	
		
			2 Commits
		
	
	
		
			c1df5e354b
			...
			developmen
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 8f64fd51c0 | ||
| a858e5e5de | 
							
								
								
									
										12
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | **/bin | ||||||
|  | **/obj | ||||||
|  | **/out | ||||||
|  | **/.vs | ||||||
|  | **/.idea | ||||||
|  | **/.git | ||||||
|  | **/.gitignore | ||||||
|  | **/node_modules | ||||||
|  | *.user | ||||||
|  | *.swp | ||||||
|  | *.swo | ||||||
|  | .DS_Store | ||||||
| @@ -19,10 +19,10 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Base | |||||||
|         public string? BaseDescription { get; set; } |         public string? BaseDescription { get; set; } | ||||||
|         public string? Representation { get; set; } |         public string? Representation { get; set; } | ||||||
|         public string? MaintenanceNotes { get; set; } |         public string? MaintenanceNotes { get; set; } | ||||||
|  |  | ||||||
|         public Dimensions Dimensions { get; set; } = new(); |         public Dimensions Dimensions { get; set; } = new(); | ||||||
|  |  | ||||||
|         public List<string>? VariantIds { get; set; } |         public List<string>? VariantIds { get; set; } | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|  |  | ||||||
|         public bool Validate() |         public bool Validate() | ||||||
|         { |         { | ||||||
|             return !string.IsNullOrWhiteSpace(ModelName) && |             return !string.IsNullOrWhiteSpace(ModelName) && | ||||||
|   | |||||||
| @@ -21,10 +21,10 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Base | |||||||
|         public string? BaseDescription { get; set; } |         public string? BaseDescription { get; set; } | ||||||
|         public string? Representation { get; set; } |         public string? Representation { get; set; } | ||||||
|         public string? MaintenanceNotes { get; set; } |         public string? MaintenanceNotes { get; set; } | ||||||
|  |  | ||||||
|         public Dimensions Dimensions { get; set; } = new(); |         public Dimensions Dimensions { get; set; } = new(); | ||||||
|  |  | ||||||
|         public List<string>? VariantIds { get; set; } |         public List<string>? VariantIds { get; set; } | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|  |  | ||||||
|         public bool Validate() |         public bool Validate() | ||||||
|         { |         { | ||||||
|             return !string.IsNullOrWhiteSpace(_Id) |             return !string.IsNullOrWhiteSpace(_Id) | ||||||
|   | |||||||
| @@ -13,15 +13,13 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Variant | |||||||
|         public string Name { get; set; } = null!; |         public string Name { get; set; } = null!; | ||||||
|         public string Color { get; set; } = null!; |         public string Color { get; set; } = null!; | ||||||
|         public string? Line { get; set; } |         public string? Line { get; set; } | ||||||
|  |  | ||||||
|         public decimal Price { get; set; } |         public decimal Price { get; set; } | ||||||
|         public string Currency { get; set; } = "USD"; |         public string Currency { get; set; } = "USD"; | ||||||
|         public int Stock { get; set; } |         public int Stock { get; set; } | ||||||
|  |  | ||||||
|         public string CategoryId { get; set; } = string.Empty; |         public string CategoryId { get; set; } = string.Empty; | ||||||
|         public string ProviderId { get; set; } = string.Empty; |         public string ProviderId { get; set; } = string.Empty; | ||||||
|  |  | ||||||
|         public Dictionary<string, string> Attributes { get; set; } = []; |         public Dictionary<string, string> Attributes { get; set; } = []; | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|  |  | ||||||
|         public bool Validate() |         public bool Validate() | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -23,11 +23,10 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Variant | |||||||
|         public int Stock { get; set; } |         public int Stock { get; set; } | ||||||
|         public decimal Price { get; set; } |         public decimal Price { get; set; } | ||||||
|         public string Currency { get; set; } = "USD"; |         public string Currency { get; set; } = "USD"; | ||||||
|  |  | ||||||
|         public string CategoryId { get; set; } = string.Empty!; |         public string CategoryId { get; set; } = string.Empty!; | ||||||
|         public string ProviderId { get; set; } = string.Empty!; |         public string ProviderId { get; set; } = string.Empty!; | ||||||
|  |  | ||||||
|         public Dictionary<string, string> Attributes { get; set; } = []; |         public Dictionary<string, string> Attributes { get; set; } = []; | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|  |  | ||||||
|         public bool Validate() |         public bool Validate() | ||||||
|         { |         { | ||||||
|   | |||||||
| @@ -94,7 +94,8 @@ namespace Core.Inventory.Application.UseCases.Inventory | |||||||
|                         Depth = command.Dimensions.Depth, |                         Depth = command.Dimensions.Depth, | ||||||
|                         Height = command.Dimensions.Height, |                         Height = command.Dimensions.Height, | ||||||
|                         Width = command.Dimensions.Width |                         Width = command.Dimensions.Width | ||||||
|                     } |                     }, | ||||||
|  |                     Icon = command.Icon | ||||||
|                 }; |                 }; | ||||||
|  |  | ||||||
|                 var result = await _inventoryDALService.CreateFurnitureBaseAsync(request, cancellationToken); |                 var result = await _inventoryDALService.CreateFurnitureBaseAsync(request, cancellationToken); | ||||||
| @@ -133,7 +134,8 @@ namespace Core.Inventory.Application.UseCases.Inventory | |||||||
|                         Depth = command.Dimensions.Depth, |                         Depth = command.Dimensions.Depth, | ||||||
|                         Height = command.Dimensions.Height, |                         Height = command.Dimensions.Height, | ||||||
|                         Width = command.Dimensions.Width |                         Width = command.Dimensions.Width | ||||||
|                     } |                     }, | ||||||
|  |                     Icon = command.Icon | ||||||
|                 }; |                 }; | ||||||
|  |  | ||||||
|                 var result = await _inventoryDALService.UpdateFurnitureBaseAsync(command.Id, request, cancellationToken); |                 var result = await _inventoryDALService.UpdateFurnitureBaseAsync(command.Id, request, cancellationToken); | ||||||
| @@ -226,7 +228,8 @@ namespace Core.Inventory.Application.UseCases.Inventory | |||||||
|                     ModelId = command.ModelId, |                     ModelId = command.ModelId, | ||||||
|                     Name = command.Name, |                     Name = command.Name, | ||||||
|                     Price = command.Price, |                     Price = command.Price, | ||||||
|                     ProviderId  = command.ProviderId |                     ProviderId  = command.ProviderId, | ||||||
|  |                     Icon = command.Icon | ||||||
|                 }; |                 }; | ||||||
|                 var result = await _inventoryDALService.CreateFurnitureVariantAsync(request, cancellationToken); |                 var result = await _inventoryDALService.CreateFurnitureVariantAsync(request, cancellationToken); | ||||||
|                 _variantPort.Success(result); |                 _variantPort.Success(result); | ||||||
| @@ -260,7 +263,8 @@ namespace Core.Inventory.Application.UseCases.Inventory | |||||||
|                     ModelId = command.ModelId, |                     ModelId = command.ModelId, | ||||||
|                     Name = command.Name, |                     Name = command.Name, | ||||||
|                     Price = command.Price, |                     Price = command.Price, | ||||||
|                     ProviderId = command.ProviderId |                     ProviderId = command.ProviderId, | ||||||
|  |                     Icon = command.Icon | ||||||
|                 }; |                 }; | ||||||
|                 var result = await _inventoryDALService.UpdateFurnitureVariantAsync(command.Id, request, cancellationToken); |                 var result = await _inventoryDALService.UpdateFurnitureVariantAsync(command.Id, request, cancellationToken); | ||||||
|                 _variantPort.Success(result); |                 _variantPort.Success(result); | ||||||
|   | |||||||
| @@ -15,5 +15,6 @@ namespace Core.Inventory.External.Clients.Adapters | |||||||
|  |  | ||||||
|         public Dimensions Dimensions { get; set; } = new(); |         public Dimensions Dimensions { get; set; } = new(); | ||||||
|         public List<string>? VariantIds { get; set; } |         public List<string>? VariantIds { get; set; } | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -17,5 +17,6 @@ | |||||||
|         public string ProviderId { get; set; } = string.Empty!; |         public string ProviderId { get; set; } = string.Empty!; | ||||||
|  |  | ||||||
|         public Dictionary<string, string> Attributes { get; set; } = []; |         public Dictionary<string, string> Attributes { get; set; } = []; | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -10,8 +10,8 @@ namespace Core.Inventory.External.Clients.Requests | |||||||
|         public string? BaseDescription { get; set; } |         public string? BaseDescription { get; set; } | ||||||
|         public string? Representation { get; set; } |         public string? Representation { get; set; } | ||||||
|         public string? MaintenanceNotes { get; set; } |         public string? MaintenanceNotes { get; set; } | ||||||
|  |  | ||||||
|         public Dimensions Dimensions { get; set; } = new(); |         public Dimensions Dimensions { get; set; } = new(); | ||||||
|         public List<string>? VariantIds { get; set; } |         public List<string>? VariantIds { get; set; } | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -15,5 +15,7 @@ | |||||||
|         public string ProviderId { get; set; } = string.Empty!; |         public string ProviderId { get; set; } = string.Empty!; | ||||||
|  |  | ||||||
|         public Dictionary<string, string> Attributes { get; set; } = []; |         public Dictionary<string, string> Attributes { get; set; } = []; | ||||||
|  |  | ||||||
|  |         public string Icon { get; set; } = null!; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -7,8 +7,8 @@ | |||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Adapters.Lib" Version="1.0.13" /> |     <PackageReference Include="Core.Adapters.Lib" Version="1.0.1" /> | ||||||
|     <PackageReference Include="BuildingBlocks.Library" Version="1.0.0" /> |     <PackageReference Include="Lib.Architecture.BuildingBlocks" Version="1.0.0" /> | ||||||
|     <PackageReference Include="Refit" Version="8.0.0" /> |     <PackageReference Include="Refit" Version="8.0.0" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" /> |     <PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" /> | ||||||
|     <PackageReference Include="Core.Blueprint.Logging" Version="1.0.1" /> |     <PackageReference Include="Core.Blueprint.Logging" Version="1.0.0" /> | ||||||
|     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> |     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										42
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | |||||||
|  | # ===== Build stage ===== | ||||||
|  | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  |  | ||||||
|  | # Usaremos la config de NuGet de la raíz (BaGet + nuget.org) | ||||||
|  | COPY nuget.config ./ | ||||||
|  |  | ||||||
|  | # Copiamos SOLO los .csproj primero (mejor caché en restore) | ||||||
|  | COPY Core.Inventory.Service.API/Core.Inventory.Service.API.csproj Core.Inventory.Service.API/ | ||||||
|  | COPY Core.Inventory.Application/Core.Inventory.Application.csproj Core.Inventory.Application/ | ||||||
|  | COPY Core.Inventory.External/Core.Inventory.External.csproj Core.Inventory.External/ | ||||||
|  |  | ||||||
|  | # Restaura con tu nuget.config | ||||||
|  | RUN dotnet restore Core.Inventory.Service.API/Core.Inventory.Service.API.csproj --configfile ./nuget.config | ||||||
|  |  | ||||||
|  | # Ahora sí, copia todo el código | ||||||
|  | COPY . . | ||||||
|  |  | ||||||
|  | # Publica artefactos (sin apphost para imagen más pequeña) | ||||||
|  | ARG BUILD_CONFIGURATION=Release | ||||||
|  | RUN dotnet publish Core.Inventory.Service.API/Core.Inventory.Service.API.csproj \ | ||||||
|  |     -c $BUILD_CONFIGURATION -o /app/out /p:UseAppHost=false | ||||||
|  |  | ||||||
|  | # ===== Runtime stage ===== | ||||||
|  | FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime | ||||||
|  | WORKDIR /app | ||||||
|  |  | ||||||
|  | # Copiamos el publish | ||||||
|  | COPY --from=build /app/out . | ||||||
|  |  | ||||||
|  | # Variables típicas (ajústalas luego en compose) | ||||||
|  | ENV ASPNETCORE_URLS=http://+:8080 \ | ||||||
|  |     ASPNETCORE_ENVIRONMENT=Production | ||||||
|  |  | ||||||
|  | # Exponemos el puerto HTTP | ||||||
|  | EXPOSE 8080 | ||||||
|  |  | ||||||
|  | # Opcional: healthcheck si tienes /health | ||||||
|  | # HEALTHCHECK --interval=30s --timeout=5s --retries=5 \ | ||||||
|  | #   CMD wget -qO- http://localhost:8080/health || exit 1 | ||||||
|  |  | ||||||
|  | ENTRYPOINT ["dotnet", "Core.Inventory.Service.API.dll"] | ||||||
							
								
								
									
										9
									
								
								nuget.config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								nuget.config
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <configuration> | ||||||
|  |   <packageSources> | ||||||
|  |     <!-- Tu BaGet primero --> | ||||||
|  |     <add key="BaGet" value="https://nuget.dream-views.com/v3/index.json" protocolVersion="3" /> | ||||||
|  |     <!-- NuGet oficial como fallback (si quieres) --> | ||||||
|  |     <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||||||
|  |   </packageSources> | ||||||
|  | </configuration> | ||||||
		Reference in New Issue
	
	Block a user