using Apollinare.API.Modules.Production.Dtos; using Apollinare.API.Modules.Production.Services; using Apollinare.Domain.Entities.Production; using Microsoft.AspNetCore.Mvc; namespace Apollinare.API.Modules.Production.Controllers; [ApiController] [Route("api/production/mrp")] public class MrpController : ControllerBase { private readonly IMrpService _mrpService; public MrpController(IMrpService mrpService) { _mrpService = mrpService; } [HttpPost("run")] public async Task RunMrp([FromBody] MrpConfigurationDto config) { await _mrpService.RunMrpAsync(config); return Ok(new { message = "MRP Run completed successfully" }); } [HttpGet("suggestions")] public async Task>> GetSuggestions([FromQuery] bool includeProcessed = false) { return await _mrpService.GetSuggestionsAsync(includeProcessed); } [HttpPost("suggestions/{id}/process")] public async Task ProcessSuggestion(int id) { await _mrpService.ProcessSuggestionAsync(id); return Ok(); } }