Documentation
¶
Index ¶
- Variables
- type Account
- type Client
- func (c *Client) Accounts(ctx context.Context) ([]Account, error)
- func (c *Client) Confirm(ctx context.Context, initialOperationTicket, initialOperation, code string) error
- func (c *Client) LevelUp(ctx context.Context) error
- func (c *Client) Operations(ctx context.Context, now time.Time, accountID string, since time.Time) ([]Operation, error)
- func (c *Client) PurchasedSecurities(ctx context.Context, now time.Time) ([]PurchasedSecurity, error)
- func (c *Client) ShoppingReceipt(ctx context.Context, operationID uint64) (*ShoppingReceipt, error)
- func (c *Client) SignUp(ctx context.Context, password string) (string, error)
- func (c *Client) TradingOperations(ctx context.Context, now time.Time, since time.Time) ([]TradingOperation, error)
- func (c *Client) Username() string
- type Confirm
- type Errors
- type Operation
- type OperationAmount
- type OperationLocation
- type OperationLoyaltyBonus
- type OperationMerchant
- type OperationTime
- type Operations
- type PurchasedSecurity
- type Response
- type ResultCodeError
- type ShoppingReceipt
- type ShoppingReceiptItem
- type TradingOperation
- type TradingOperationTime
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Host = "https://www.tinkoff.ru" LoginPage = Host + "/login/" PingEndpoint = Host + "/api/common/v1/ping" SessionEndpoint = Host + "/api/common/v1/session" SignUpEndpoint = Host + "/api/common/v1/sign_up" ConfirmEndpoint = Host + "/api/common/v1/confirm" LevelUpEndpoint = Host + "/api/common/v1/level_up" GroupedRequestsEndpount = Host + "/api/common/v1/grouped_requests" OperationsEndpoint = Host + "/api/common/v1/operations" ShoppingReceiptEndpount = Host + "/api/common/v1/shopping_receipt" TradingOperationsEndpoint = Host + "/api/trading/user/operations" PurchasedSecuritiesEndpoint = Host + "/api/trading/portfolio/purchased_securities" )
View Source
var MoscowLocation *time.Location
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Operations ¶
func (*Client) PurchasedSecurities ¶
func (*Client) ShoppingReceipt ¶
func (*Client) TradingOperations ¶
type Operation ¶
type Operation struct { ID uint64 `json:"id,string" gorm:"primaryKey;autoIncrement:false"` // nolint AuthorizationID null.Int `json:"authorizationId,string"` Time OperationTime `json:"operationTime" gorm:"type:timestamptz;not null;index;time"` DebitingTime *OperationTime `json:"debitingTime" gorm:"type:date"` Type string `json:"type" gorm:"not null"` Group string `json:"group" gorm:"not null"` Status string `json:"status" gorm:"not null"` Description string `json:"description" gorm:"not null"` Amount OperationAmount `json:"amount" gorm:"embedded"` AccountAmount OperationAmount `json:"accountAmount" gorm:"embedded;embeddedPrefix:account_"` Cashback OperationAmount `json:"cashbackAmount" gorm:"embedded;embeddedPrefix:cashback_"` LoyaltyBonus []OperationLoyaltyBonus `json:"loyaltyBonus" gorm:"constraint:OnDelete:CASCADE"` SpendingCategory struct { Name string `json:"name" gorm:"column:category"` } `json:"spendingCategory" gorm:"embedded"` CardNumber null.String `json:"cardNumber"` MCC string `json:"mccString" gorm:"type:char(4);not null"` CardPresent bool `json:"cardPresent" gorm:"not null"` //Locations []OperationLocation `json:"locations" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationID"` Merchant OperationMerchant `json:"merchant" gorm:"embedded;embeddedPrefix:merchant_"` AccountID string `json:"account" gorm:"tenant;constraint:OnDelete:CASCADE"` Account Account HasShoppingReceipt bool `json:"hasShoppingReceipt" gorm:"-"` ShoppingReceipt *ShoppingReceipt `json:"-" gorm:"constraint:OnDelete:CASCADE"` }
type OperationAmount ¶
type OperationLocation ¶
type OperationLoyaltyBonus ¶
type OperationMerchant ¶
type OperationMerchant struct { Name null.String `json:"name"` Region struct { Country null.String `json:"country" gorm:"type:char(3)"` City null.String `json:"city"` Address null.String `json:"address"` ZIP null.String `json:"zip" gorm:"column:zip"` } `json:"region" gorm:"embedded"` }
type OperationTime ¶
func (*OperationTime) UnmarshalJSON ¶
func (t *OperationTime) UnmarshalJSON(data []byte) error
type Operations ¶
type Operations []Operation
func (Operations) Len ¶
func (os Operations) Len() int
func (Operations) Less ¶
func (os Operations) Less(i, j int) bool
func (Operations) Swap ¶
func (os Operations) Swap(i, j int)
type PurchasedSecurity ¶
type PurchasedSecurity struct { Ticker string `json:"ticker" gorm:"primaryKey"` SecurityType string `json:"securityType" gorm:"primaryKey"` CurrentPrice struct { Currency string `json:"currency" gorm:"type:char(3);not null"` Value float64 `json:"value" gorm:"price;not null"` } `json:"currentPrice" gorm:"embedded"` Time time.Time `json:"-" gorm:"primaryKey;type:date"` }
type Response ¶
type Response struct { ResultCode string `json:"resultCode"` Status string `json:"status"` Payload json.RawMessage `json:"payload"` OperationTicket string `json:"operationTicket"` }
type ResultCodeError ¶
type ResultCodeError string
func (ResultCodeError) Error ¶
func (e ResultCodeError) Error() string
type ShoppingReceipt ¶
type ShoppingReceipt struct { OperationID uint64 `json:"-" gorm:"primaryKey"` Receipt struct { OperationType uint8 `json:"operationType" gorm:"not null"` TotalSum float64 `json:"totalSum" gorm:"not null"` Operator string `json:"operator" gorm:"not null"` User string `json:"user" gorm:"not null"` RetailPlaceAddress string `json:"retailPlaceAddress" gorm:"not null"` Items []ShoppingReceiptItem `json:"items"` } `json:"receipt" gorm:"embedded"` }
type ShoppingReceiptItem ¶
type ShoppingReceiptItem struct { ShoppingReceiptID uint64 `json:"-" gorm:"primaryKey"` Name string `json:"name" gorm:"primaryKey"` Price float64 `json:"price" gorm:"primaryKey;not null"` Sum float64 `json:"sum" gorm:"not null"` CategoryID uint `json:"cat_id" gorm:"not null"` Quantity float64 `json:"quantity" gorm:"not null"` GoodID uint `json:"good_id" gorm:"not null"` }
type TradingOperation ¶
type TradingOperation struct { Username string `json:"-" gorm:"not null;index;tenant"` ID uint64 `json:"id" gorm:"primaryKey;autoIncrement:false"` Time TradingOperationTime `json:"date" gorm:"type:timestamptz;not null;time"` Type string `json:"operationType"` IsMarginCall bool `json:"isMarginCall"` Issuer null.String `json:"issuer"` InstrumentType null.String `json:"instrumentType"` Ticker null.String `json:"ticker" gorm:"index"` Price null.Float `json:"price"` Payment float64 `json:"payment" gorm:"not null"` Commission null.Float `json:"commission"` Currency string `json:"currency" gorm:"type:char(3);not null"` Quantity null.Int `json:"quantity"` CommissionCurrency null.String `json:"commissionCurrency"` Description string `json:"description" gorm:"not null"` }
type TradingOperationTime ¶
func (*TradingOperationTime) UnmarshalJSON ¶
func (t *TradingOperationTime) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.