feat: Added Product controller and endpoints

- updated Core.Adapters.Lib package version
This commit is contained in:
2025-08-03 20:29:16 -06:00
parent 11d1d21f3a
commit f31ec86352
11 changed files with 362 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
using Core.Adapters.Lib;
using Core.Adapters.Lib.Inventory;
using Core.Inventory.External.Clients.Inventory.Requests.Base;
using Core.Inventory.External.Clients.Inventory.Requests.Product;
using Core.Inventory.External.Clients.Inventory.Requests.Tag;
using Core.Inventory.External.Clients.Inventory.Requests.TagType;
using Core.Inventory.External.Clients.Inventory.Requests.Variant;
@@ -102,5 +104,33 @@ namespace Core.Inventory.External.Clients.Inventory
Task<ApiResponse<TagAdapter>> RemoveParentTagAsync([Header("TrackingId")][Body] RemoveParentTagFromTag request, CancellationToken cancellationToken = default);
#endregion
#region Product
[Post("/api/v1/Product/Create")]
Task<ApiResponse<ProductAdapter>> CreateProductService([Header("TrackingId")][Body] CreateProductRequest request, CancellationToken cancellationToken = default);
[Post("/api/v1/Product/GetById")]
Task<ApiResponse<ProductAdapter>> GetProductByIdService([Header("TrackingId")][Body] GetProductRequest request, CancellationToken cancellationToken = default);
[Get("/api/v1/Product/GetAll")]
Task<ApiResponse<IEnumerable<ProductAdapter>>> GetAllProductsService([Header("TrackingId")][Body] GetAllProductsRequest request, CancellationToken cancellationToken = default);
[Post("/api/v1/Product/GetProductList")]
Task<ApiResponse<IEnumerable<ProductAdapter>>> GetAllProductsByListService([Header("TrackingId")][Body] GetAllProductsByListRequest request, CancellationToken cancellationToken = default);
[Put("/api/v1/Product/Update")]
Task<ApiResponse<ProductAdapter>> UpdateProductService([Header("TrackingId")][Body] UpdateProductRequest request, CancellationToken cancellationToken = default);
[Patch("/api/v1/Product/ChangeStatus")]
Task<ApiResponse<ProductAdapter>> ChangeProductStatusService([Header("TrackingId")][Body] ChangeProductStatusRequest request, CancellationToken cancellationToken = default);
[Post("/api/v1/Product/AddTag")]
Task<ApiResponse<ProductAdapter>> AddTagToProductAsync([Header("TrackingId")][Body] AddTagToProductRequest request, CancellationToken cancellationToken = default);
[Delete("/api/v1/Product/RemoveTag")]
Task<ApiResponse<ProductAdapter>> RemoveTagFromProductAsync([Header("TrackingId")][Body] RemoveTagFromProductRequest request, CancellationToken cancellationToken = default);
#endregion
}
}

View File

@@ -0,0 +1,8 @@
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class AddTagToProductRequest
{
public string ProductId { get; set; } = null!;
public string TagId { get; set; } = null!;
}
}

View File

@@ -0,0 +1,10 @@
using Core.Adapters.Lib.Inventory;
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class ChangeProductStatusRequest
{
public string Id { get; set; } = null!;
public ProductStatus NewStatus { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class CreateProductRequest
{
public string TenantId { get; set; } = null!;
public string ProductName { get; set; } = null!;
public string Description { get; set; } = null!;
public string Status { get; set; } = null!;
public List<string> TagIds { get; set; } = new List<string>();
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class GetAllProductsByListRequest
{
public string[] Products { get; set; } = null!;
}
}

View File

@@ -0,0 +1,6 @@
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class GetAllProductsRequest
{
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class GetProductRequest
{
public string Id { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class RemoveTagFromProductRequest
{
public string ProductId { get; set; } = null!;
public string TagId { get; set; } = null!;
}
}

View File

@@ -0,0 +1,14 @@
using Core.Adapters.Lib.Inventory;
namespace Core.Inventory.External.Clients.Inventory.Requests.Product
{
public class UpdateProductRequest
{
public string Id { get; set; } = null!;
public string TenantId { get; set; } = null!;
public string ProductName { get; set; } = null!;
public string Description { get; set; } = null!;
public string Status { get; set; } = null!;
public List<string> TagIds { get; set; } = new List<string>();
}
}

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Adapters.Lib" Version="1.0.10" />
<PackageReference Include="Adapters.Lib" Version="1.0.11" />
<PackageReference Include="BuildingBlocks.Library" Version="1.0.0" />
<PackageReference Include="Refit" Version="8.0.0" />
</ItemGroup>