Use camelCase for json identifiers

This commit is contained in:
Jan Bader 2022-02-20 16:51:48 +00:00
parent 1a1971246d
commit 8035403416

View File

@ -22,8 +22,8 @@ type NewTransactionPayload struct {
} `json:"category"`
Memo string `json:"memo"`
Amount string `json:"amount"`
BudgetID uuid.UUID `json:"budget_id"`
AccountID uuid.UUID `json:"account_id"`
BudgetID uuid.UUID `json:"budgetId"`
AccountID uuid.UUID `json:"accountId"`
State string `json:"state"`
}
@ -49,14 +49,14 @@ func (h *Handler) newTransaction(c *gin.Context) {
return
}*/
//if !transactionUUID.Valid {
// if !transactionUUID.Valid {
new := postgres.CreateTransactionParams{
Memo: payload.Memo,
Date: time.Time(payload.Date),
Amount: amount,
AccountID: payload.AccountID,
PayeeID: payload.Payee.ID, //TODO handle new payee
CategoryID: payload.Category.ID, //TODO handle new category
PayeeID: payload.Payee.ID, // TODO handle new payee
CategoryID: payload.Category.ID, // TODO handle new category
Status: postgres.TransactionStatus(payload.State),
}
_, err = h.Service.CreateTransaction(c.Request.Context(), new)