feat: Added Product controller and endpoints

- updated Core.Adapters.Lib package version
This commit is contained in:
2025-08-03 17:50:20 -06:00
parent 1f9bae385c
commit a706f96bd8
6 changed files with 535 additions and 2 deletions

View File

@@ -0,0 +1,77 @@
using Core.Adapters.Lib.Inventory;
using Core.Blueprint.Mongo;
using Core.Inventory.Domain.Contexts.Inventory.Request;
namespace Core.Inventory.Provider.Contracts
{
public interface IProductProvider
{
/// <summary>
/// Creates a new Product.
/// </summary>
/// <param name="entity">The Product to be created.</param>
/// <returns>A <see cref="{Task{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<ProductAdapter> CreateProduct(ProductRequest newProduct, CancellationToken cancellationToken);
/// <summary>
/// Gets a Product by identifier.
/// </summary>
/// <param name="id">The Product identifier.</param>
/// <returns>A <see cref="{Task{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<ProductAdapter> GetProductById(string _id, CancellationToken cancellationToken);
/// <summary>
/// Gets all the products.
/// </summary>
/// <returns>A <see cref="{Task{IEnumerable{ProductAdapter}}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<IEnumerable<ProductAdapter>> GetAllProducts(CancellationToken cancellationToken);
/// <summary>
/// Gets all the products by products identifier list.
/// </summary>
/// <param name="products">The list of products identifiers.</param>
/// <returns>A <see cref="Task{IEnumerable{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<IEnumerable<ProductAdapter>> GetAllProductsByList(string[] products, CancellationToken cancellationToken);
/// <summary>
/// Changes the status of the product.
/// </summary>
/// <param name="id">The product identifier.</param>
/// <param name="newStatus">The new status of the product.</param>
/// <returns>The <see cref="ProductAdapter"/> updated entity.</returns>
/// <returns>A <see cref="{Task{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<ProductAdapter> ChangeProductStatus(string id, ProductStatus newStatus, CancellationToken cancellationToken);
/// <summary>
/// Updates a Product by id.
/// </summary>
/// <param name="entity">The Product to be updated.</param>
/// <param name="id">The Product identifier.</param>
/// <returns>A <see cref="{Task{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<ProductAdapter> UpdateProduct(ProductAdapter entity, CancellationToken cancellationToken);
/// <summary>
/// Adds a tag to the product.
/// </summary>
/// <param name="productId">The ID of the product.</param>
/// <param name="tagId">The ID of the tag to add.</param>
/// <returns>A <see cref="{Task{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<ProductAdapter> AddTagToProduct(string productId, string tagId, CancellationToken cancellationToken);
/// <summary>
/// Removes a tag from the product.
/// </summary>
/// <param name="productId">The ID of the product.</param>
/// <param name="tagId">The ID of the tag to remove.</param>
/// <returns>A <see cref="{Task{ProductAdapter}}"/> representing
/// the asynchronous execution of the service.</returns>
ValueTask<ProductAdapter> RemoveTagFromProduct(string productId, string tagId, CancellationToken cancellationToken);
}
}