diff --git a/handlers/card.go b/handlers/card.go index ee33400..1415070 100644 --- a/handlers/card.go +++ b/handlers/card.go @@ -13,6 +13,8 @@ var cardTransform func(inp *db.Card) types.DbCard = func(inp *db.Card) types.DbC Balance: inp.Balance, HaveCreditLine: inp.HaveCreditLine, CreditLine: inp.CreditLine, + LastDigits: inp.LastDigits, + CurrencyID: inp.CurrencyID, } } @@ -82,6 +84,8 @@ func CardAdd(c *gin.Context) { dst.Balance = src.Balance dst.HaveCreditLine = src.HaveCreditLine dst.CreditLine = src.CreditLine + dst.LastDigits = src.LastDigits + dst.CurrencyID = src.CurrencyID })(c) } @@ -107,6 +111,8 @@ func CardPutId(c *gin.Context) { dst.Balance = src.Balance dst.CreditLine = src.CreditLine dst.HaveCreditLine = src.HaveCreditLine + dst.LastDigits = src.LastDigits + dst.CurrencyID = src.CurrencyID }, cardTransform)(c) } diff --git a/types/types.go b/types/types.go index ac0002b..80fec34 100644 --- a/types/types.go +++ b/types/types.go @@ -29,6 +29,8 @@ type DbCard struct { Balance uint64 `json:"balance" example:"1000"` HaveCreditLine bool `json:"have_credit_line" example:"true"` CreditLine uint64 `json:"credit_line" example:"500000"` + LastDigits string `json:"last_digits" example:"1111"` + CurrencyID uint `json:"currency_id" example:"1"` } type DbCategory struct {