mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
fixed types
This commit is contained in:
@@ -25,7 +25,7 @@ type NewSubscriptionBody struct {
|
|||||||
WalletID string `json:"walletId" form:"walletId"`
|
WalletID string `json:"walletId" form:"walletId"`
|
||||||
TransactionTypeID string `json:"transactionTypeId" form:"transactionTypeId"`
|
TransactionTypeID string `json:"transactionTypeId" form:"transactionTypeId"`
|
||||||
SubscriptionTypeID string `json:"subscriptionTypeId" pg:"subscription_type_id"`
|
SubscriptionTypeID string `json:"subscriptionTypeId" pg:"subscription_type_id"`
|
||||||
CustomRange int `json:"customRange", pg:"custom_range"`
|
CustomRange json.Number `json:"customRange", pg:"custom_range"`
|
||||||
StartDate time.Time `json:"startDate" pg:"start_date"`
|
StartDate time.Time `json:"startDate" pg:"start_date"`
|
||||||
Description string `json:"description" form:"description"`
|
Description string `json:"description" form:"description"`
|
||||||
Amount json.Number `json:"amount" form:"amount"`
|
Amount json.Number `json:"amount" form:"amount"`
|
||||||
|
|||||||
@@ -15,12 +15,13 @@ func (as *SubscriptionService) New(body *models.NewSubscriptionBody) *models.Sub
|
|||||||
tm := new(models.Subscription)
|
tm := new(models.Subscription)
|
||||||
|
|
||||||
amount, _ := body.Amount.Int64()
|
amount, _ := body.Amount.Int64()
|
||||||
|
customRange, _ := body.CustomRange.Int64()
|
||||||
|
|
||||||
tm.Init()
|
tm.Init()
|
||||||
tm.WalletID = body.WalletID
|
tm.WalletID = body.WalletID
|
||||||
tm.TransactionTypeID = body.TransactionTypeID
|
tm.TransactionTypeID = body.TransactionTypeID
|
||||||
tm.SubscriptionTypeID = body.SubscriptionTypeID
|
tm.SubscriptionTypeID = body.SubscriptionTypeID
|
||||||
tm.CustomRange = body.CustomRange
|
tm.CustomRange = int(customRange)
|
||||||
tm.Description = body.Description
|
tm.Description = body.Description
|
||||||
tm.StartDate = body.StartDate
|
tm.StartDate = body.StartDate
|
||||||
tm.Amount = int(amount)
|
tm.Amount = int(amount)
|
||||||
|
|||||||
Reference in New Issue
Block a user