Use view everywhere

This commit is contained in:
2022-02-27 20:45:02 +00:00
parent 81aacf339e
commit 2cf6b815bf
6 changed files with 29 additions and 12 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"git.javil.eu/jacob1123/budgeteer/postgres"
"git.javil.eu/jacob1123/budgeteer/postgres/numeric"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
@ -15,6 +16,11 @@ type ReconcileTransactionsRequest struct {
ReconcilationTransactionAmount numeric.Numeric `json:"reconcilationTransactionAmount"`
}
type ReconcileTransactionsResponse struct {
Message string
ReconcilationTransaction []postgres.GetTransactionsForAccountRow
}
func (h *Handler) reconcileTransactions(c *gin.Context) {
var request ReconcileTransactionsRequest
err := c.BindJSON(&request)
@ -42,5 +48,8 @@ func (h *Handler) reconcileTransactions(c *gin.Context) {
return
}
c.JSON(http.StatusOK, SuccessResponse{fmt.Sprintf("Set status for %d transactions", len(request.TransactionIDs))})
c.JSON(http.StatusOK, ReconcileTransactionsResponse{
Message: fmt.Sprintf("Set status for %d transactions", len(request.TransactionIDs)),
ReconcilationTransaction: nil,
})
}