Feat Varios 3

This commit is contained in:
2026-01-06 10:34:06 -03:00
parent 0fa77e4a98
commit 9fa21ebec3
65 changed files with 2897 additions and 373 deletions

View File

@@ -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
});