Add GetNextSerialSequence functionality to Stock services and repository

This commit is contained in:
2026-10-08 12:42:50 +05:30
parent 55aa35308a
commit 702efba62e
4 changed files with 34 additions and 0 deletions
@@ -37,6 +37,14 @@ public class StockController(StockService service, ICurrentUserService currentUs
return Ok(result);
}
/// <summary>Next free number for auto-generated serials (e.g. after ...-0005 the answer is 6).</summary>
[HttpGet("serials/next-sequence")]
public async Task<IActionResult> GetNextSerialSequence([FromQuery] Guid itemId, [FromQuery] string prefix = "")
{
var next = await service.GetNextSerialSequenceAsync(itemId, prefix);
return Ok(new { next });
}
[HttpGet("movements")]
public async Task<IActionResult> GetMovements(
[FromQuery] Guid? locationId,