From 1b309f8540a477c2f53d0882e2c34711d6686637 Mon Sep 17 00:00:00 2001 From: Nilo Roberto C Paim Date: Wed, 25 Oct 2023 13:53:51 -0300 Subject: [PATCH] feature: operation and obs on transaction --- controllers/webhookController.go | 2 ++ models/transactions.go | 2 ++ routes/routes.go | 1 + 3 files changed, 5 insertions(+) diff --git a/controllers/webhookController.go b/controllers/webhookController.go index d7d6bb9..dff811c 100644 --- a/controllers/webhookController.go +++ b/controllers/webhookController.go @@ -134,6 +134,8 @@ func WixIntegration(c *fiber.Ctx) error { PlanStartDate: data.Data.PlanStartDate, PlanValidUntil: data.Data.PlanValidUntil, PlanTitle: data.Data.PlanTitle, + Operation: "Compra", + Obs: "", } database.DB.Debug().Create(&transaction) diff --git a/models/transactions.go b/models/transactions.go index d4287c6..f73e045 100644 --- a/models/transactions.go +++ b/models/transactions.go @@ -12,4 +12,6 @@ type Transaction struct { PlanStartDate string `gorm:"size:10" json:"planstartdate"` PlanValidUntil string `gorm:"size:10" json:"planvaliduntil"` PlanTitle string `gorm:"size:40" json:"plantitle"` + Operation string `gorm:"size:40" json:"operation"` + Obs string `gorm:"size:40" json:"obs"` } diff --git a/routes/routes.go b/routes/routes.go index c1908c1..11d4413 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -30,6 +30,7 @@ func Setup(app *fiber.App) { // Protected routes. Needs login before. protected := app.Group("/") + protected.Use(jwtware.New(jwtware.Config{ SigningKey: []byte(os.Getenv("API_SECRET")), }))