This commit is contained in:
parent
c139d7b713
commit
1ca36eaba9
@ -31,7 +31,7 @@ type BaseTransaction struct {
|
|||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used for single transaction requests / responses
|
// Used for single transaction responses
|
||||||
type Transaction struct {
|
type Transaction struct {
|
||||||
Data struct {
|
Data struct {
|
||||||
TransactionIDs []string `json:"transaction_ids,omitempty"`
|
TransactionIDs []string `json:"transaction_ids,omitempty"`
|
||||||
@ -40,6 +40,7 @@ type Transaction struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used for single transaction requests
|
||||||
type TransactionRequest struct {
|
type TransactionRequest struct {
|
||||||
Transaction BaseTransaction `json:"transaction,omitempty"`
|
Transaction BaseTransaction `json:"transaction,omitempty"`
|
||||||
}
|
}
|
||||||
@ -104,7 +105,7 @@ func (c *Client) CreateTodayYNABCapitalGainsTransaction(accountID string, amount
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accepts a YNAB account ID and transaction amount and creates a new YNAB transaction
|
// Accepts a YNAB account ID, transaction ID and transaction amount and updates the YNAB transaction with the matching ID
|
||||||
func (c *Client) UpdateTodayYNABCapitalGainsTransaction(accountID string, transactionID string, amount int) error {
|
func (c *Client) UpdateTodayYNABCapitalGainsTransaction(accountID string, transactionID string, amount int) error {
|
||||||
transaction := TransactionRequest{}
|
transaction := TransactionRequest{}
|
||||||
transaction.Transaction.AccountID = accountID
|
transaction.Transaction.AccountID = accountID
|
||||||
|
Loading…
Reference in New Issue
Block a user