This commit is contained in:
Lizandro Guarnizo
2026-05-15 23:22:35 -05:00
parent c91383882c
commit 49cc56123b
12 changed files with 1371 additions and 4 deletions
+5
View File
@@ -11,6 +11,7 @@ import (
"github.com/gofiber/fiber/v2"
"github.com/sujit-baniya/fiber-boilerplate/pkg/models"
"github.com/sujit-baniya/fiber-boilerplate/pkg/services"
)
func FacturasIndex(c *fiber.Ctx) error {
@@ -185,6 +186,10 @@ func UploadFacturaPDF(c *fiber.Ctx) error {
if err := models.UpdateFacturaArchivo(uint(id), savePath, file.Filename); err != nil {
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
}
// Notificar al cliente
if f, err := models.GetFacturaByID(uint(id)); err == nil {
go services.DispatchFacturaSubida(f)
}
return c.JSON(fiber.Map{"ok": true, "archivo": savePath})
}