2 Commits

Author SHA1 Message Date
Oscar Morales
8f64fd51c0 Add Icon property to FurnitureBase and FurnitureVariant 2025-09-03 14:52:15 -06:00
a858e5e5de devops: added dockerfile and other configs 2025-09-01 10:18:52 -06:00
14 changed files with 85 additions and 17 deletions

12
.dockerignore Normal file
View File

@@ -0,0 +1,12 @@
**/bin
**/obj
**/out
**/.vs
**/.idea
**/.git
**/.gitignore
**/node_modules
*.user
*.swp
*.swo
.DS_Store

View File

@@ -19,10 +19,10 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Base
public string? BaseDescription { get; set; }
public string? Representation { get; set; }
public string? MaintenanceNotes { get; set; }
public Dimensions Dimensions { get; set; } = new();
public List<string>? VariantIds { get; set; }
public string Icon { get; set; } = null!;
public bool Validate()
{
return !string.IsNullOrWhiteSpace(ModelName) &&

View File

@@ -21,10 +21,10 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Base
public string? BaseDescription { get; set; }
public string? Representation { get; set; }
public string? MaintenanceNotes { get; set; }
public Dimensions Dimensions { get; set; } = new();
public List<string>? VariantIds { get; set; }
public string Icon { get; set; } = null!;
public bool Validate()
{
return !string.IsNullOrWhiteSpace(_Id)

View File

@@ -13,15 +13,13 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Variant
public string Name { get; set; } = null!;
public string Color { get; set; } = null!;
public string? Line { get; set; }
public decimal Price { get; set; }
public string Currency { get; set; } = "USD";
public int Stock { get; set; }
public string CategoryId { get; set; } = string.Empty;
public string ProviderId { get; set; } = string.Empty;
public Dictionary<string, string> Attributes { get; set; } = [];
public string Icon { get; set; } = null!;
public bool Validate()
{

View File

@@ -23,11 +23,10 @@ namespace Core.Inventory.Application.UseCases.Inventory.Input.Variant
public int Stock { get; set; }
public decimal Price { get; set; }
public string Currency { get; set; } = "USD";
public string CategoryId { get; set; } = string.Empty!;
public string ProviderId { get; set; } = string.Empty!;
public Dictionary<string, string> Attributes { get; set; } = [];
public string Icon { get; set; } = null!;
public bool Validate()
{

View File

@@ -94,7 +94,8 @@ namespace Core.Inventory.Application.UseCases.Inventory
Depth = command.Dimensions.Depth,
Height = command.Dimensions.Height,
Width = command.Dimensions.Width
}
},
Icon = command.Icon
};
var result = await _inventoryDALService.CreateFurnitureBaseAsync(request, cancellationToken);
@@ -133,7 +134,8 @@ namespace Core.Inventory.Application.UseCases.Inventory
Depth = command.Dimensions.Depth,
Height = command.Dimensions.Height,
Width = command.Dimensions.Width
}
},
Icon = command.Icon
};
var result = await _inventoryDALService.UpdateFurnitureBaseAsync(command.Id, request, cancellationToken);
@@ -226,7 +228,8 @@ namespace Core.Inventory.Application.UseCases.Inventory
ModelId = command.ModelId,
Name = command.Name,
Price = command.Price,
ProviderId = command.ProviderId
ProviderId = command.ProviderId,
Icon = command.Icon
};
var result = await _inventoryDALService.CreateFurnitureVariantAsync(request, cancellationToken);
_variantPort.Success(result);
@@ -260,7 +263,8 @@ namespace Core.Inventory.Application.UseCases.Inventory
ModelId = command.ModelId,
Name = command.Name,
Price = command.Price,
ProviderId = command.ProviderId
ProviderId = command.ProviderId,
Icon = command.Icon
};
var result = await _inventoryDALService.UpdateFurnitureVariantAsync(command.Id, request, cancellationToken);
_variantPort.Success(result);

View File

@@ -15,5 +15,6 @@ namespace Core.Inventory.External.Clients.Adapters
public Dimensions Dimensions { get; set; } = new();
public List<string>? VariantIds { get; set; }
public string Icon { get; set; } = null!;
}
}

View File

@@ -17,5 +17,6 @@
public string ProviderId { get; set; } = string.Empty!;
public Dictionary<string, string> Attributes { get; set; } = [];
public string Icon { get; set; } = null!;
}
}

View File

@@ -10,8 +10,8 @@ namespace Core.Inventory.External.Clients.Requests
public string? BaseDescription { get; set; }
public string? Representation { get; set; }
public string? MaintenanceNotes { get; set; }
public Dimensions Dimensions { get; set; } = new();
public List<string>? VariantIds { get; set; }
public string Icon { get; set; } = null!;
}
}

View File

@@ -15,5 +15,7 @@
public string ProviderId { get; set; } = string.Empty!;
public Dictionary<string, string> Attributes { get; set; } = [];
public string Icon { get; set; } = null!;
}
}

View File

@@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Adapters.Lib" Version="1.0.13" />
<PackageReference Include="BuildingBlocks.Library" Version="1.0.0" />
<PackageReference Include="Core.Adapters.Lib" Version="1.0.1" />
<PackageReference Include="Lib.Architecture.BuildingBlocks" Version="1.0.0" />
<PackageReference Include="Refit" Version="8.0.0" />
</ItemGroup>

View File

@@ -8,7 +8,7 @@
<ItemGroup>
<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" />
</ItemGroup>

42
Dockerfile Normal file
View 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
View 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>