Added new endpoint for variants GetAll
This commit is contained in:
		| @@ -22,16 +22,16 @@ namespace Core.Inventory.BFF.API.Controllers | ||||
|         /// </summary> | ||||
|         [HttpGet("GetAll")] | ||||
|         [ProducesResponseType(typeof(IEnumerable<FurnitureBase>), StatusCodes.Status200OK)] | ||||
|         public async Task<IActionResult> GetAllAsync(CancellationToken cancellationToken) | ||||
|         public async Task<IActionResult> GetAllBaseAsync(CancellationToken cancellationToken) | ||||
|         { | ||||
|             try | ||||
|             { | ||||
|                 logger.LogInformation($"{nameof(GetAllAsync)} - Request received."); | ||||
|                 return await Handle(() => inventoryClient.GetAllAsync(TrackingId.ToString(), cancellationToken)); | ||||
|                 logger.LogInformation($"{nameof(GetAllBaseAsync)} - Request received."); | ||||
|                 return await Handle(() => inventoryClient.GetAllBaseAsync(TrackingId.ToString(), cancellationToken)); | ||||
|             } | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|                 logger.LogError(ex, $"{nameof(GetAllAsync)} - An error occurred."); | ||||
|                 logger.LogError(ex, $"{nameof(GetAllBaseAsync)} - An error occurred."); | ||||
|                 throw; | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -17,6 +17,25 @@ namespace Core.Inventory.BFF.API.Controllers | ||||
|     [Produces("application/json")] | ||||
|     public class FurnitureVariantController(IInventoryServiceClient inventoryClient, ILogger<FurnitureVariantController> logger) : BaseController(logger) | ||||
|     { | ||||
|         /// <summary> | ||||
|         /// Gets all furniture base records. | ||||
|         /// </summary> | ||||
|         [HttpGet("GetAll")] | ||||
|         [ProducesResponseType(typeof(IEnumerable<FurnitureVariant>), StatusCodes.Status200OK)] | ||||
|         public async Task<IActionResult> GetAllVariantsAsync(CancellationToken cancellationToken) | ||||
|         { | ||||
|             try | ||||
|             { | ||||
|                 logger.LogInformation($"{nameof(GetAllVariantsAsync)} - Request received."); | ||||
|                 return await Handle(() => inventoryClient.GetAllVariantsAsync(TrackingId.ToString(), cancellationToken)); | ||||
|             } | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|                 logger.LogError(ex, $"{nameof(GetAllVariantsAsync)} - An error occurred."); | ||||
|                 throw; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Gets furniture variants by model ID. | ||||
|         /// </summary> | ||||
| @@ -30,7 +49,7 @@ namespace Core.Inventory.BFF.API.Controllers | ||||
|  | ||||
|                 if (string.IsNullOrWhiteSpace(request.ModelId)) return BadRequest("ModelId is required."); | ||||
|  | ||||
|                 return await Handle(() => inventoryClient.GetVariantsByModelIdAsync(TrackingId.ToString(), request, cancellationToken)); | ||||
|                 return await Handle(() => inventoryClient.GetAllVariantsByModelIdAsync(TrackingId.ToString(), request, cancellationToken)); | ||||
|             } | ||||
|             catch (Exception ex) | ||||
|             { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user