Feat Varios 3
This commit is contained in:
@@ -35,7 +35,7 @@ public class CashSessionsController : ControllerBase
|
||||
}
|
||||
|
||||
[HttpPost("open")]
|
||||
public async Task<IActionResult> Open([FromBody] decimal openingBalance)
|
||||
public async Task<IActionResult> Open([FromBody] CashOpeningDto dto)
|
||||
{
|
||||
var userIdClaim = User.FindFirst("Id")?.Value;
|
||||
if (!int.TryParse(userIdClaim, out int userId)) return Unauthorized();
|
||||
@@ -43,7 +43,7 @@ public class CashSessionsController : ControllerBase
|
||||
var existing = await _repo.GetActiveSessionAsync(userId);
|
||||
if (existing != null) return BadRequest("Ya tienes una caja abierta");
|
||||
|
||||
var id = await _repo.OpenSessionAsync(userId, openingBalance);
|
||||
var id = await _repo.OpenSessionAsync(userId, dto.OpeningBalance);
|
||||
|
||||
// Opcional: Auditar la apertura
|
||||
await _auditRepo.AddLogAsync(new AuditLog
|
||||
@@ -52,7 +52,7 @@ public class CashSessionsController : ControllerBase
|
||||
Action = "CASH_SESSION_OPENED",
|
||||
EntityId = id,
|
||||
EntityType = "CashSession",
|
||||
Details = $"Caja abierta con fondo: ${openingBalance}",
|
||||
Details = $"Caja abierta con fondo: ${dto.OpeningBalance}",
|
||||
CreatedAt = DateTime.UtcNow
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user