tinkoff

package
v0.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	UserPhone string `json:"-" gorm:"index"`
	User      User   `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	CurrencyCode *uint     `json:"-" gorm:"index"`
	Currency     *Currency `json:"currency,omitempty" gorm:"constraint:OnDelete:CASCADE"`

	Deleted bool `json:"-" gorm:"index"`

	Id                    string                        `json:"id" gorm:"primaryKey"`
	CreditLimit           *AccountCreditLimit           `json:"creditLimit,omitempty" gorm:"embedded"`
	MoneyAmount           *AccountMoneyAmount           `json:"moneyAmount,omitempty" gorm:"embedded"`
	DebtBalance           *AccountDebtBalance           `json:"debtBalance,omitempty" gorm:"embedded"`
	CurrentMinimalPayment *AccountCurrentMinimalPayment `json:"currentMinimalPayment,omitempty" gorm:"embedded"`
	ClientUnverifiedFlag  *string                       `json:"clientUnverifiedFlag,omitempty"`
	IdentificationState   *string                       `json:"identificationState,omitempty"`
	Status                *string                       `json:"status,omitempty"`
	EmoneyFlag            *bool                         `json:"emoneyFlag,omitempty"`
	NextStatementDate     *Milliseconds                 `json:"nextStatementDate,omitempty"`
	DueDate               *Milliseconds                 `json:"dueDate,omitempty"`
	Cards                 []Card                        `json:"cards,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:AccountId"`
	MultiCardCluster      *MultiCardCluster             `json:"multiCardCluster,omitempty" gorm:"embedded;embeddedPrefix:multi_card_cluster_"`
	LoyaltyId             *string                       `json:"loyaltyId,omitempty"`
	MoneyPotFlag          *bool                         `json:"moneyPotFlag,omitempty"`
	PartNumber            *string                       `json:"partNumber,omitempty"`
	PastDueDebt           *AccountPastDueDebt           `json:"pastDueDebt,omitempty" gorm:"embedded"`
	Name                  string                        `json:"name"`
	AccountType           string                        `json:"accountType"`
	Hidden                bool                          `json:"hidden"`
	SharedByMeFlag        *bool                         `json:"sharedByMeFlag,omitempty"`
	Loyalty               *Loyalty                      `json:"loyalty,omitempty" gorm:"embedded;embeddedPrefix:loyalty_"`
	CreationDate          *Milliseconds                 `json:"creationDate,omitempty"`
	DebtAmount            *AccountDebtAmount            `json:"debtAmount,omitempty" gorm:"embedded"`
	LastStatementDate     *Milliseconds                 `json:"lastStatementDate,omitempty"`
	DueColor              *int                          `json:"dueColor,omitempty"`
	LinkedAccountNumber   *string                       `json:"linkedAccountNumber,omitempty"`
	IsKidsSaving          *bool                         `json:"isKidsSaving,omitempty"`
	IsCrowdfunding        *bool                         `json:"isCrowdfunding,omitempty"`
}

type AccountCreditLimit added in v0.0.23

type AccountCreditLimit struct {
	CreditLimitCurrencyCode uint     `json:"-" gorm:"index"`
	CreditLimitCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	CreditLimitValue float64 `json:"value"`
}

type AccountCurrentMinimalPayment added in v0.0.23

type AccountCurrentMinimalPayment struct {
	CurrentMinimalPaymentCurrencyCode uint     `json:"-" gorm:"index"`
	CurrentMinimalPaymentCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	CurrentMinimalPaymentValue float64 `json:"value"`
}

type AccountDebtAmount added in v0.0.23

type AccountDebtAmount struct {
	DebtAmountCurrencyCode uint     `json:"-" gorm:"index"`
	DebtAmountCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	DebtAmountValue float64 `json:"value"`
}

type AccountDebtBalance added in v0.0.23

type AccountDebtBalance struct {
	DebtBalanceCurrencyCode uint     `json:"-" gorm:"index"`
	DebtBalanceCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	DebtBalanceValue float64 `json:"value"`
}

type AccountMoneyAmount added in v0.0.23

type AccountMoneyAmount struct {
	MoneyAmountCurrencyCode uint     `json:"-" gorm:"index"`
	MoneyAmountCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	MoneyAmountValue float64 `json:"value"`
}

type AccountPastDueDebt added in v0.0.23

type AccountPastDueDebt struct {
	PastDueDebtCurrencyCode uint     `json:"-" gorm:"index"`
	PastDueDebtCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	PastDueDebtValue float64 `json:"value"`
}

type AccountShared

type AccountShared struct {
	Scopes     []string     `json:"scopes"`
	StartDate  Milliseconds `json:"startDate"`
	OwnerName  string       `json:"ownerName"`
	SharStatus string       `json:"sharStatus"`
}

type AdditionalInfo

type AdditionalInfo struct {
	OperationId string `json:"-" gorm:"primaryKey"`
	DbIdx       int    `json:"dbIdx" gorm:"primaryKey"`

	FieldName  string `json:"fieldName"`
	FieldValue string `json:"fieldValue"`
}

type Brand

type Brand struct {
	Name          string  `json:"name" gorm:"index"`
	BaseTextColor *string `json:"baseTextColor,omitempty"`
	Id            string  `json:"id" gorm:"primaryKey"`
	BaseColor     *string `json:"baseColor,omitempty"`
	LogoFile      *string `json:"logoFile,omitempty"`
	Link          *string `json:"link,omitempty"`
	SvgLogoFile   *string `json:"svgLogoFile"`
}

type Builder

type Builder struct {
	Config Config      `validate:"required"`
	Clock  based.Clock `validate:"required"`
}

func (Builder) Build

func (b Builder) Build() (*pipeline, error)

type Card

type Card struct {
	AccountId string `json:"-" gorm:"index"`

	Id               string            `json:"id" gorm:"primaryKey"`
	StatusCode       string            `json:"statusCode"`
	Status           string            `json:"status"`
	PinSet           bool              `json:"pinSet"`
	Expiration       Milliseconds      `json:"expiration"`
	CardDesign       string            `json:"cardDesign"`
	Ucid             string            `json:"ucid"`
	PaymentSystem    string            `json:"paymentSystem"`
	FrozenCard       bool              `json:"frozenCard"`
	HasWrongPins     bool              `json:"hasWrongPins"`
	Value            string            `json:"value"`
	IsEmbossed       bool              `json:"isEmbossed"`
	IsVirtual        bool              `json:"isVirtual"`
	CreationDate     Milliseconds      `json:"creationDate"`
	MultiCardCluster *MultiCardCluster `json:"multiCardCluster,omitempty" gorm:"embedded;embeddedPrefix:multi_card_cluster_"`
	Name             string            `json:"name"`
	IsPaymentDevice  bool              `json:"isPaymentDevice"`
	Primary          bool              `json:"primary"`
	CardIssueType    *string           `json:"cardIssueType,omitempty"`
	SharedResourceId *string           `json:"sharedResourceId,omitempty"`
}

type Category

type Category struct {
	Id   string `json:"id" gorm:"primaryKey"`
	Name string `json:"name" gorm:"index"`
}

type Client

type Client interface {
	AccountsLightIb(ctx context.Context) (tinkoff.AccountsLightIbOut, error)
	Statements(ctx context.Context, in *tinkoff.StatementsIn) (tinkoff.StatementsOut, error)
	Operations(ctx context.Context, in *tinkoff.OperationsIn) (tinkoff.OperationsOut, error)
	ShoppingReceipt(ctx context.Context, in *tinkoff.ShoppingReceiptIn) (*tinkoff.ShoppingReceiptOut, error)
	ClientOfferEssences(ctx context.Context) (tinkoff.ClientOfferEssencesOut, error)
	InvestOperationTypes(ctx context.Context) (*tinkoff.InvestOperationTypesOut, error)
	InvestAccounts(ctx context.Context, in *tinkoff.InvestAccountsIn) (*tinkoff.InvestAccountsOut, error)
	InvestOperations(ctx context.Context, in *tinkoff.InvestOperationsIn) (*tinkoff.InvestOperationsOut, error)
	Close()
}

type ClientOffer added in v0.0.18

type ClientOffer struct {
	UserPhone string `json:"-" gorm:"index"`
	User      User   `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	Accounts []ClientOfferAccount `json:"-" gorm:"constraint:OnDelete:CASCADE;foreignKey:ClientOfferId"`

	TypeCode              string                `json:"typeCode"`
	AvailableEssenceCount uint                  `json:"availableEssenceCount"`
	ActiveTo              Milliseconds          `json:"activeTo"`
	Attributes            ClientOfferAttributes `json:"attributes" gorm:"embedded"`
	ActiveFrom            Milliseconds          `json:"activeFrom"`
	Essences              []ClientOfferEssence  `json:"essences" gorm:"constraint:OnDelete:CASCADE;foreignKey:ClientOfferId"`
	DisplayTo             Milliseconds          `json:"displayTo"`
	DisplayFrom           Milliseconds          `json:"displayFrom"`
	//AccountIds            []string              `json:"accountIds"`
	Id string `json:"id" gorm:"primaryKey"`
}

type ClientOfferAccount added in v0.0.18

type ClientOfferAccount struct {
	ClientOfferId string `json:"-" gorm:"primaryKey"`
	AccountId     string `json:"-" gorm:"primaryKey"`
}

type ClientOfferAttributes added in v0.0.18

type ClientOfferAttributes struct {
	NotificationFlag bool `json:"notificationFlag"`
}

type ClientOfferEssence added in v0.0.18

type ClientOfferEssence struct {
	ClientOfferId string `json:"-" gorm:"index"`

	SpendingCategoryId *string `json:"-" gorm:"index"`
	BrandId            *string `json:"-" gorm:"index"`

	MccCodes []ClientOfferEssenceMccCode `json:"-" gorm:"constraint:OnDelete:CASCADE;foreignKey:ClientOfferEssenceId"`

	Name         string `json:"name"`
	Description  string `json:"description"`
	BusinessType uint   `json:"businessType"`
	IsActive     bool   `json:"isActive"`
	BaseColor    string `json:"baseColor"`
	//MccCodes     []string `json:"mccCodes,omitempty"`
	ExternalCode string `json:"externalCode"`
	ExternalId   string `json:"externalId"`
	Id           string `json:"id" gorm:"primaryKey"`
	Percent      uint   `json:"percent"`
}

type ClientOfferEssenceMccCode added in v0.0.18

type ClientOfferEssenceMccCode struct {
	ClientOfferEssenceId string `json:"-" gorm:"primaryKey"`
	MccCode              string `json:"-" gorm:"primaryKey"`
}

type Config

type Config struct {
	DB              database.Config         `yaml:"db" doc:"Настройки подключения к БД."`
	BatchSize       int                     `yaml:"batchSize,omitempty" doc:"Максимальный размер батчей." default:"100"`
	Overlap         time.Duration           `` /* 147-byte string literal not displayed */
	DisableReceipts bool                    `yaml:"disableReceipts,omitempty" doc:"Отключить синхронизацию чеков."`
	Users           map[string][]Credential `yaml:"users" doc:"Пользователи и их авторизационные данные."`
}

type Credential

type Credential struct {
	Phone    string `` /* 150-byte string literal not displayed */
	Password string `yaml:"password" doc:"Пароль от аккаунта Тинькофф."`
}

type Currency

type Currency struct {
	Code    uint   `json:"code" gorm:"primaryKey;autoIncrement:false"`
	Name    string `json:"name" gorm:"index"`
	StrCode string `json:"strCode"`
}

type Date

type Date struct {
	tinkoff.Date
}

func (Date) GormDataType

func (d Date) GormDataType() string

func (*Date) Scan

func (d *Date) Scan(value any) error

func (Date) Value

func (d Date) Value() (driver.Value, error)

type DateTime

type DateTime struct {
	tinkoff.DateTime
}

func (DateTime) GormDataType

func (dt DateTime) GormDataType() string

func (*DateTime) Scan

func (dt *DateTime) Scan(value any) error

func (DateTime) Value

func (dt DateTime) Value() (driver.Value, error)

type DateTimeMilliOffset

type DateTimeMilliOffset struct {
	tinkoff.DateTimeMilliOffset
}

func (DateTimeMilliOffset) GormDataType

func (dt DateTimeMilliOffset) GormDataType() string

func (*DateTimeMilliOffset) Scan

func (dt *DateTimeMilliOffset) Scan(value any) error

func (DateTimeMilliOffset) Value

func (dt DateTimeMilliOffset) Value() (driver.Value, error)

type InvestAccount

type InvestAccount struct {
	UserPhone string `json:"-" gorm:"index"`
	User      User   `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	Deleted bool `json:"-" gorm:"index"`

	Id            string `json:"brokerAccountId" gorm:"primaryKey"`
	Type          string `json:"brokerAccountType"`
	Name          string `json:"name"`
	OpenedDate    Date   `json:"openedDate"`
	Order         int    `json:"order"`
	Status        string `json:"status"`
	IsVisible     bool   `json:"isVisible"`
	Organization  string `json:"organization"`
	BuyByDefault  bool   `json:"buyByDefault"`
	MarginEnabled bool   `json:"marginEnabled"`
	AutoApp       bool   `json:"autoApp"`

	InvestTotals `gorm:"embedded"`
}

type InvestAmount

type InvestAmount struct {
	Currency string  `json:"currency"`
	Value    float64 `json:"value"`
}

type InvestChildOperation

type InvestChildOperation struct {
	InvestOperationInternalId string `json:"-" gorm:"primaryKey"`
	DbIdx                     int    `json:"dbIdx" gorm:"primaryKey"`

	Currency       string       `json:"currency"`
	Id             string       `json:"id"`
	InstrumentType string       `json:"instrumentType"`
	InstrumentUid  string       `json:"instrumentUid"`
	LogoName       string       `json:"logoName"`
	Payment        InvestAmount `json:"payment" gorm:"embedded;embeddedPrefix:payment_"`
	ShowName       string       `json:"showName"`
	Ticker         string       `json:"ticker"`
	Type           string       `json:"type"`
	Value          float64      `json:"value"`
}

type InvestOperation

type InvestOperation struct {
	InvestAccountId string        `json:"brokerAccountId" gorm:"index"`
	InvestAccount   InvestAccount `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	AssetUid                      *string                `json:"assetUid,omitempty"`
	BestExecuted                  bool                   `json:"bestExecuted"`
	ClassCode                     *string                `json:"classCode,omitempty"`
	Cursor                        string                 `json:"cursor"`
	Date                          DateTimeMilliOffset    `json:"date"`
	Description                   string                 `json:"description"`
	Id                            *string                `json:"id,omitempty"`
	InstrumentType                *string                `json:"instrumentType,omitempty"`
	InstrumentUid                 *string                `json:"instrumentUid,omitempty"`
	InternalId                    string                 `json:"internalId" gorm:"primaryKey"`
	IsBlockedTradeClearingAccount *bool                  `json:"isBlockedTradeClearingAccount,omitempty"`
	Isin                          *string                `json:"isin,omitempty"`
	LogoName                      *string                `json:"logoName,omitempty"`
	Name                          *string                `json:"name,omitempty"`
	Payment                       InvestAmount           `json:"payment" gorm:"embedded;embeddedPrefix:payment_"`
	PaymentEur                    InvestAmount           `json:"paymentEur" gorm:"embedded;embeddedPrefix:payment_eur_"`
	PaymentRub                    InvestAmount           `json:"paymentRub" gorm:"embedded;embeddedPrefix:payment_rub_"`
	PaymentUsd                    InvestAmount           `json:"paymentUsd" gorm:"embedded;embeddedPrefix:payment_usd_"`
	PositionUid                   *string                `json:"positionUid,omitempty"`
	ShortDescription              *string                `json:"shortDescription,omitempty"`
	ShowName                      *string                `json:"showName,omitempty"`
	Status                        string                 `json:"status"`
	TextColor                     *string                `json:"textColor,omitempty"`
	Ticker                        *string                `json:"ticker,omitempty"`
	Type                          string                 `json:"type"`
	AccountId                     *string                `json:"accountId,omitempty"`
	DoneRest                      *int                   `json:"doneRest,omitempty"`
	Price                         *InvestAmount          `json:"price,omitempty" gorm:"embedded;embeddedPrefix:price_"`
	Quantity                      *int                   `json:"quantity,omitempty"`
	TradesInfo                    *TradesInfo            `json:"tradesInfo,omitempty" gorm:"embedded"`
	ParentOperationId             *string                `json:"parentOperationId,omitempty"`
	ChildOperations               []InvestChildOperation `json:"childOperations,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:InvestOperationInternalId"`
	Commission                    *InvestAmount          `json:"commission,omitempty" gorm:"embedded;embeddedPrefix:commission_"`
	Yield                         *InvestAmount          `json:"yield,omitempty" gorm:"embedded;embeddedPrefix:yield_"`
	YieldRelative                 *float64               `json:"yieldRelative,omitempty"`
	CancelReason                  *string                `json:"cancelReason,omitempty"`
	QuantityRest                  *int                   `json:"quantityRest,omitempty"`
	WithdrawDateTime              *DateTime              `json:"withdrawDateTime,omitempty"`
}

type InvestOperationType

type InvestOperationType struct {
	Deleted bool `json:"-" gorm:"index"`

	Category      string `json:"category"`
	OperationName string `json:"operationName"`
	OperationType string `json:"operationType" gorm:"primaryKey"`
}

type InvestTotals

type InvestTotals struct {
	ExpectedYield                InvestAmount `json:"expectedYield" gorm:"embedded;embeddedPrefix:expected_yield_"`
	ExpectedYieldRelative        float64      `json:"expectedYieldRelative"`
	ExpectedYieldPerDay          InvestAmount `json:"expectedYieldPerDay" gorm:"embedded;embeddedPrefix:expected_yield_per_day_"`
	ExpectedYieldPerDayRelative  float64      `json:"expectedYieldPerDayRelative"`
	ExpectedAverageYield         InvestAmount `json:"expectedAverageYield" gorm:"embedded;embeddedPrefix:expected_average_yield_"`
	ExpectedAverageYieldRelative float64      `json:"expectedAverageYieldRelative"`
	TotalAmount                  InvestAmount `json:"totalAmount" gorm:"embedded;embeddedPrefix:total_amount_"`
}

type Location

type Location struct {
	OperationId string `json:"-" gorm:"primaryKey"`
	DbIdx       int    `json:"dbIdx" gorm:"primaryKey"`

	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Loyalty

type Loyalty struct {
	ProgramName            string   `json:"programName"`
	ProgramCode            string   `json:"programCode"`
	AccountBackgroundColor string   `json:"accountBackgroundColor"`
	CashbackProgram        bool     `json:"cashbackProgram"`
	CoreGroup              string   `json:"coreGroup"`
	LoyaltyPointsId        uint8    `json:"loyaltyPointsId"`
	AccrualBonuses         *float64 `json:"accrualBonuses,omitempty"`
	LinkedBonuses          *string  `json:"linkedBonuses,omitempty"`
	TotalAvailableBonuses  *float64 `json:"totalAvailableBonuses,omitempty"`
	AvailableBonuses       *float64 `json:"availableBonuses,omitempty"`
}

type LoyaltyAmount

type LoyaltyAmount struct {
	Value               float64 `json:"value"`
	LoyaltyProgramId    string  `json:"loyaltyProgramId"`
	Loyalty             string  `json:"loyalty"`
	Name                string  `json:"name"`
	LoyaltySteps        uint8   `json:"loyaltySteps"`
	LoyaltyPointsId     uint8   `json:"loyaltyPointsId"`
	LoyaltyPointsName   string  `json:"loyaltyPointsName"`
	LoyaltyImagine      bool    `json:"loyaltyImagine"`
	PartialCompensation bool    `json:"partialCompensation"`
}

type LoyaltyBonus

type LoyaltyBonus struct {
	OperationId string `json:"-" gorm:"primaryKey"`
	DbIdx       int    `json:"dbIdx" gorm:"primaryKey"`

	Description      string        `json:"description"`
	Icon             string        `json:"icon"`
	LoyaltyType      string        `json:"loyaltyType"`
	Amount           LoyaltyAmount `json:"amount" gorm:"embedded"`
	CompensationType string        `json:"compensationType"`
}

type LoyaltyBonusSummary

type LoyaltyBonusSummary struct {
	Amount float64 `json:"amount"`
}

type LoyaltyPayment

type LoyaltyPayment struct {
	OperationId string `json:"-" gorm:"primaryKey"`
	DbIdx       int    `json:"dbIdx" gorm:"primaryKey"`

	Amount   LoyaltyPaymentAmount `json:"amount" gorm:"embedded"`
	Status   string               `json:"status"`
	SoldTime *Milliseconds        `json:"soldTime"`
}

type LoyaltyPaymentAmount

type LoyaltyPaymentAmount struct {
	LoyaltyAmount `gorm:"embedded"`
	Price         float64 `json:"price"`
}

type Merchant

type Merchant struct {
	Name   string  `json:"name" gorm:"index"`
	Region *Region `json:"region,omitempty" gorm:"embedded"`
}

type Milliseconds

type Milliseconds struct {
	tinkoff.Milliseconds
}

func (Milliseconds) GormDataType

func (ms Milliseconds) GormDataType() string

func (*Milliseconds) Scan

func (ms *Milliseconds) Scan(value any) error

func (Milliseconds) Value

func (ms Milliseconds) Value() (driver.Value, error)

type MultiCardCluster

type MultiCardCluster struct {
	Id string `json:"id"`
}

type Operation

type Operation struct {
	AccountId string  `json:"account" gorm:"index"`
	Account   Account `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	BrandId *string `json:"-" gorm:"index"`
	Brand   *Brand  `json:"brand,omitempty" gorm:"constraint:OnDelete:CASCADE"`

	SpendingCategoryId string           `json:"-" gorm:"index"`
	SpendingCategory   SpendingCategory `json:"spendingCategory" gorm:"constraint:OnDelete:CASCADE"`

	CategoryId string   `json:"-" gorm:"index"`
	Category   Category `json:"category" gorm:"constraint:OnDelete:CASCADE"`

	SubgroupId *string   `json:"-" gorm:"index"`
	Subgroup   *Subgroup `json:"subgroup,omitempty" gorm:"constraint:OnDelete:CASCADE"`

	IsDispute              bool                    `json:"isDispute"`
	IsOffline              bool                    `json:"isOffline"`
	HasStatement           bool                    `json:"hasStatement"`
	IsSuspicious           bool                    `json:"isSuspicious"`
	AuthorizationId        *string                 `json:"authorizationId,omitempty"`
	IsInner                bool                    `json:"isInner" gorm:"index"`
	Id                     string                  `json:"id" gorm:"primaryKey"`
	Status                 string                  `json:"status" gorm:"index"`
	OperationTransferred   bool                    `json:"operationTransferred"`
	IdSourceType           string                  `json:"idSourceType"`
	HasShoppingReceipt     *bool                   `json:"hasShoppingReceipt,omitempty" gorm:"index"`
	Type                   string                  `json:"type" gorm:"index"`
	Locations              []Location              `json:"locations,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationId"`
	LoyaltyBonus           []LoyaltyBonus          `json:"loyaltyBonus,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationId"`
	CashbackAmount         OperationCashbackAmount `json:"cashbackAmount" gorm:"embedded"`
	AuthMessage            *string                 `json:"authMessage,omitempty"`
	Description            string                  `json:"description"`
	IsTemplatable          bool                    `json:"isTemplatable"`
	Cashback               float64                 `json:"cashback"`
	Amount                 OperationAmount         `json:"amount" gorm:"embedded"`
	OperationTime          Milliseconds            `json:"operationTime" gorm:"index"`
	IsHce                  bool                    `json:"isHce"`
	Mcc                    uint                    `json:"mcc"`
	AdditionalInfo         []AdditionalInfo        `json:"additionalInfo,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationId"`
	VirtualPaymentType     uint8                   `json:"virtualPaymentType"`
	Ucid                   *string                 `json:"ucid,omitempty"`
	Merchant               *Merchant               `json:"merchant,omitempty" gorm:"embedded;embeddedPrefix:merchant_"`
	Card                   *string                 `json:"card,omitempty" gorm:"index"`
	LoyaltyPayment         []LoyaltyPayment        `json:"loyaltyPayment,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationId"`
	TrancheCreationAllowed bool                    `json:"trancheCreationAllowed"`
	Group                  *string                 `json:"group,omitempty"`
	MccString              string                  `json:"mccString"`
	CardPresent            bool                    `json:"cardPresent"`
	IsExternalCard         bool                    `json:"isExternalCard"`
	CardNumber             *string                 `json:"cardNumber,omitempty"`
	AccountAmount          OperationAccountAmount  `json:"accountAmount" gorm:"embedded"`
	LoyaltyBonusSummary    *LoyaltyBonusSummary    `json:"loyaltyBonusSummary,omitempty" gorm:"embedded;embeddedPrefix:loyalty_bonus_summary_"`
	TypeSerno              *uint                   `json:"typeSerno"`
	Payment                *Payment                `json:"payment,omitempty" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationId"`
	OperationPaymentType   *string                 `json:"operationPaymentType,omitempty"`
	DebitingTime           *Milliseconds           `json:"debitingTime,omitempty" gorm:"index"`
	PosId                  *string                 `json:"posId,omitempty"`
	Subcategory            *string                 `json:"subcategory,omitempty" gorm:"index"`
	SenderAgreement        *string                 `json:"senderAgreement,omitempty"`
	PointOfSaleId          *uint64                 `json:"pointOfSaleId,omitempty"`
	Compensation           *string                 `json:"compensation,omitempty"`
	InstallmentStatus      *string                 `json:"installmentStatus,omitempty"`
	SenderDetails          *string                 `json:"senderDetails,omitempty"`
	PartnerType            *string                 `json:"partnerType,omitempty"`
	Nomination             *string                 `json:"nomination,omitempty"`
	Message                *string                 `json:"message,omitempty"`
	TrancheId              *string                 `json:"trancheId,omitempty"`
}

type OperationAccountAmount added in v0.0.23

type OperationAccountAmount struct {
	AccountCurrencyCode uint     `json:"-" gorm:"index"`
	AccountCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	AccountValue float64 `json:"value"`
}

type OperationAmount added in v0.0.23

type OperationAmount struct {
	CurrencyCode uint     `json:"-" gorm:"index"`
	Currency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	Value float64 `json:"value"`
}

type OperationCashbackAmount added in v0.0.23

type OperationCashbackAmount struct {
	CashbackCurrencyCode uint     `json:"-" gorm:"index"`
	CashbackCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	CashbackValue float64 `json:"value"`
}

type Payment

type Payment struct {
	OperationId string `json:"-" gorm:"primaryKey"`

	SourceIsQr      bool              `json:"sourceIsQr"`
	BankAccountId   string            `json:"bankAccountId"`
	PaymentId       string            `json:"paymentId"`
	ProviderGroupId *string           `json:"providerGroupId,omitempty"`
	PaymentType     string            `json:"paymentType"`
	FeeAmount       *PaymentFeeAmount `json:"feeAmount,omitempty" gorm:"embedded"`
	ProviderId      string            `json:"providerId"`
	HasPaymentOrder bool              `json:"hasPaymentOrder"`
	Comment         string            `json:"comment"`
	IsQrPayment     bool              `json:"isQrPayment"`
	//FieldsValues       map[string]any `json:"fieldsValues"`
	Repeatable         bool    `json:"repeatable"`
	CardNumber         string  `json:"cardNumber"`
	TemplateId         *string `json:"templateId,omitempty"`
	TemplateIsFavorite *bool   `json:"templateIsFavorite,omitempty"`
}

type PaymentFeeAmount added in v0.0.23

type PaymentFeeAmount struct {
	FeeAmountCurrencyCode uint     `json:"-" gorm:"index"`
	FeeAmountCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	FeeAmountValue float64 `json:"value"`
}

type Receipt

type Receipt struct {
	OperationId string    `json:"-" gorm:"primaryKey"`
	Operation   Operation `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	RetailPlace             *string       `json:"retailPlace,omitempty"`
	RetailPlaceAddress      *string       `json:"retailPlaceAddress,omitempty"`
	CreditSum               *float64      `json:"creditSum,omitempty"`
	ProvisionSum            *float64      `json:"provisionSum,omitempty"`
	FiscalDriveNumber       *uint64       `json:"fiscalDriveNumber,omitempty"`
	OperationType           uint8         `json:"operationType"`
	CashTotalSum            float64       `json:"cashTotalSum"`
	ShiftNumber             uint          `json:"shiftNumber"`
	KktRegId                string        `json:"kktRegId"`
	Items                   []ReceiptItem `json:"items" gorm:"constraint:OnDelete:CASCADE;foreignKey:OperationId"`
	TotalSum                float64       `json:"totalSum"`
	EcashTotalSum           float64       `json:"ecashTotalSum"`
	Nds10                   *float64      `json:"nds10,omitempty"`
	Nds18                   *float64      `json:"nds18,omitempty"`
	UserInn                 string        `json:"userInn"`
	DateTime                Seconds       `json:"dateTime"`
	TaxationType            uint8         `json:"taxationType"`
	PrepaidSum              *float64      `json:"prepaidSum,omitempty"`
	FiscalSign              uint64        `json:"fiscalSign"`
	RequestNumber           uint          `json:"requestNumber"`
	Operator                *string       `json:"operator,omitempty"`
	AppliedTaxationType     uint8         `json:"appliedTaxationType"`
	FiscalDocumentNumber    uint64        `json:"fiscalDocumentNumber"`
	User                    *string       `json:"user,omitempty"`
	FiscalDriveNumberString string        `json:"fiscalDriveNumberString"`
}

type ReceiptItem

type ReceiptItem struct {
	OperationId string `json:"-" gorm:"primaryKey"`
	DbIdx       int    `json:"dbIdx" gorm:"primaryKey"`

	Name     string   `json:"name" gorm:"index"`
	Price    float64  `json:"price"`
	Sum      float64  `json:"sum"`
	Quantity float64  `json:"quantity"`
	NdsRate  *uint8   `json:"ndsRate"`
	Nds      *uint8   `json:"nds"`
	Nds10    *float64 `json:"nds10,omitempty"`
	Nds18    *float64 `json:"nds18,omitempty"`
	BrandId  *uint64  `json:"brand_id,omitempty"`
	GoodId   *uint64  `json:"good_id,omitempty"`
}

type Region

type Region struct {
	Country    *string `json:"country,omitempty"`
	City       *string `json:"city,omitempty"`
	Address    *string `json:"address,omitempty"`
	Zip        *string `json:"zip,omitempty"`
	AddressRus *string `json:"addressRus,omitempty"`
}

type Seconds

type Seconds struct {
	tinkoff.Seconds
}

func (Seconds) GormDataType

func (s Seconds) GormDataType() string

func (*Seconds) Scan

func (s *Seconds) Scan(value any) error

func (Seconds) Value

func (s Seconds) Value() (driver.Value, error)

type Session

type Session struct {
	UserPhone string `json:"-" gorm:"primaryKey"`
	User      User   `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	ID string
}

type SpendingCategory

type SpendingCategory struct {
	Id   string `json:"id" gorm:"primaryKey"`
	Name string `json:"name" gorm:"index"`
}

type Statement

type Statement struct {
	AccountId string  `json:"-" gorm:"index"`
	Account   Account `json:"-" gorm:"constraint:OnDelete:CASCADE"`

	OverdraftFee           *StatementOverdraftFee           `json:"overdraftFee,omitempty" gorm:"embedded"`
	Expense                StatementExpense                 `json:"expense" gorm:"embedded"`
	OverLimitDebt          *StatementOverLimitDebt          `json:"overLimitDebt,omitempty" gorm:"embedded"`
	PeriodEndBalance       StatementPeriodEndBalance        `json:"periodEndBalance" gorm:"embedded"`
	ArrestAmount           *StatementArrestAmount           `json:"arrestAmount,omitempty" gorm:"embedded"`
	OtherBonus             *StatementOtherBonus             `json:"otherBonus,omitempty" gorm:"embedded"`
	CreditLimit            *StatementCreditLimit            `json:"creditLimit,omitempty" gorm:"embedded"`
	TranchesMonthlyPayment *StatementTranchesMonthlyPayment `json:"tranchesMonthlyPayment,omitempty" gorm:"embedded"`
	BilledDebt             *StatementBilledDebt             `json:"billedDebt,omitempty" gorm:"embedded"`
	Cashback               StatementCashback                `json:"cashback" gorm:"embedded"`
	Balance                StatementBalance                 `json:"balance" gorm:"embedded"`
	HighCashback           *StatementHighCashback           `json:"highCashback,omitempty" gorm:"embedded"`
	PeriodStartBalance     StatementPeriodStartBalance      `json:"periodStartBalance" gorm:"embedded"`
	LowCashback            *StatementLowCashback            `json:"lowCashback,omitempty" gorm:"embedded"`
	AvailableLimit         *StatementAvailableLimit         `json:"availableLimit,omitempty" gorm:"embedded"`
	Id                     string                           `json:"id" gorm:"primaryKey"`
	InterestBonus          *StatementInterestBonus          `json:"interestBonus,omitempty" gorm:"embedded"`
	Interest               StatementInterest                `json:"interest" gorm:"embedded"`
	Date                   Milliseconds                     `json:"date" gorm:"index"`
	Income                 StatementIncome                  `json:"income" gorm:"embedded"`
	CreditBonus            *StatementCreditBonus            `json:"creditBonus,omitempty" gorm:"embedded"`
	LastPaymentDate        *Milliseconds                    `json:"lastPaymentDate,omitempty"`
	OtherCashback          *StatementOtherCashback          `json:"otherCashback,omitempty" gorm:"embedded"`
	MinimalPaymentAmount   *StatementMinimalPaymentAmount   `json:"minimalPaymentAmount,omitempty" gorm:"embedded"`
	PastDueDebt            *StatementPastDueDebt            `json:"pastDueDebt,omitempty" gorm:"embedded"`
	Period                 StatementPeriod                  `json:"period" gorm:"embedded;embeddedPrefix:period_"`
	NoOverdue              *bool                            `json:"noOverdue,omitempty"`
	Repaid                 *string                          `json:"repaid,omitempty"`
}

type StatementArrestAmount added in v0.0.23

type StatementArrestAmount struct {
	ArrestAmountCurrencyCode uint     `json:"-" gorm:"index"`
	ArrestAmountCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	ArrestAmountValue float64 `json:"value"`
}

type StatementAvailableLimit added in v0.0.23

type StatementAvailableLimit struct {
	AvailableLimitCurrencyCode uint     `json:"-" gorm:"index"`
	AvailableLimitCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	AvailableLimitValue float64 `json:"value"`
}

type StatementBalance added in v0.0.23

type StatementBalance struct {
	BalanceCurrencyCode uint     `json:"-" gorm:"index"`
	BalanceCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	BalanceValue float64 `json:"value"`
}

type StatementBilledDebt added in v0.0.23

type StatementBilledDebt struct {
	BilledDebtCurrencyCode uint     `json:"-" gorm:"index"`
	BilledDebtCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	BilledDebtValue float64 `json:"value"`
}

type StatementCashback added in v0.0.23

type StatementCashback struct {
	CashbackCurrencyCode uint     `json:"-" gorm:"index"`
	CashbackCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	CashbackValue float64 `json:"value"`
}

type StatementCreditBonus added in v0.0.23

type StatementCreditBonus struct {
	CreditBonusCurrencyCode uint     `json:"-" gorm:"index"`
	CreditBonusCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	CreditBonusValue float64 `json:"value"`
}

type StatementCreditLimit added in v0.0.23

type StatementCreditLimit struct {
	CreditLimitCurrencyCode uint     `json:"-" gorm:"index"`
	CreditLimitCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	CreditLimitValue float64 `json:"value"`
}

type StatementExpense added in v0.0.23

type StatementExpense struct {
	ExpenseCurrencyCode uint     `json:"-" gorm:"index"`
	ExpenseCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	ExpenseValue float64 `json:"value"`
}

type StatementHighCashback added in v0.0.23

type StatementHighCashback struct {
	HighCashbackCurrencyCode uint     `json:"-" gorm:"index"`
	HighCashbackCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	HighCashbackValue float64 `json:"value"`
}

type StatementIncome added in v0.0.23

type StatementIncome struct {
	IncomeCurrencyCode uint     `json:"-" gorm:"index"`
	IncomeCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	IncomeValue float64 `json:"value"`
}

type StatementInterest added in v0.0.23

type StatementInterest struct {
	InterestCurrencyCode uint     `json:"-" gorm:"index"`
	InterestCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	InterestValue float64 `json:"value"`
}

type StatementInterestBonus added in v0.0.23

type StatementInterestBonus struct {
	InterestBonusCurrencyCode uint     `json:"-" gorm:"index"`
	InterestBonusCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	InterestBonusValue float64 `json:"value"`
}

type StatementLowCashback added in v0.0.23

type StatementLowCashback struct {
	LowCashbackCurrencyCode uint     `json:"-" gorm:"index"`
	LowCashbackCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	LowCashbackValue float64 `json:"value"`
}

type StatementMinimalPaymentAmount added in v0.0.23

type StatementMinimalPaymentAmount struct {
	MinimalPaymentAmountCurrencyCode uint     `json:"-" gorm:"index"`
	MinimalPaymentAmountCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	MinimalPaymentAmountValue float64 `json:"value"`
}

type StatementOtherBonus added in v0.0.23

type StatementOtherBonus struct {
	OtherBonusCurrencyCode uint     `json:"-" gorm:"index"`
	OtherBonusCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	OtherBonusValue float64 `json:"value"`
}

type StatementOtherCashback added in v0.0.23

type StatementOtherCashback struct {
	OtherCashbackCurrencyCode uint     `json:"-" gorm:"index"`
	OtherCashbackCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	OtherCashbackValue float64 `json:"value"`
}

type StatementOverLimitDebt added in v0.0.23

type StatementOverLimitDebt struct {
	OverLimitDebtCurrencyCode uint     `json:"-" gorm:"index"`
	OverLimitDebtCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	OverLimitDebtValue float64 `json:"value"`
}

type StatementOverdraftFee added in v0.0.23

type StatementOverdraftFee struct {
	OverdraftFeeCurrencyCode uint     `json:"-" gorm:"index"`
	OverdraftFeeCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	OverdraftFeeValue float64 `json:"value"`
}

type StatementPastDueDebt added in v0.0.23

type StatementPastDueDebt struct {
	PastDueDebtCurrencyCode uint     `json:"-" gorm:"index"`
	PastDueDebtCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	PastDueDebtValue float64 `json:"value"`
}

type StatementPeriod

type StatementPeriod struct {
	Start Milliseconds `json:"start"`
	End   Milliseconds `json:"end"`
}

type StatementPeriodEndBalance added in v0.0.23

type StatementPeriodEndBalance struct {
	PeriodEndBalanceCurrencyCode uint     `json:"-" gorm:"index"`
	PeriodEndBalanceCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	PeriodEndBalanceValue float64 `json:"value"`
}

type StatementPeriodStartBalance added in v0.0.23

type StatementPeriodStartBalance struct {
	PeriodStartBalanceCurrencyCode uint     `json:"-" gorm:"index"`
	PeriodStartBalanceCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	PeriodStartBalanceValue float64 `json:"value"`
}

type StatementTranchesMonthlyPayment added in v0.0.23

type StatementTranchesMonthlyPayment struct {
	TranchesMonthlyPaymentCurrencyCode uint     `json:"-" gorm:"index"`
	TranchesMonthlyPaymentCurrency     Currency `json:"currency" gorm:"constraint:OnDelete:CASCADE"`

	TranchesMonthlyPaymentValue float64 `json:"value"`
}

type Subgroup

type Subgroup struct {
	Id   string  `json:"id" gorm:"primaryKey"`
	Name *string `json:"name,omitempty" gorm:"index"`
}

type Trade

type Trade struct {
	InvestOperationInternalId string `json:"-" gorm:"primaryKey"`
	DbIdx                     int    `json:"dbIdx" gorm:"primaryKey"`

	Date          DateTimeMilliOffset `json:"date"`
	Num           string              `json:"num"`
	Price         InvestAmount        `json:"price" gorm:"embedded;embeddedPrefix:price_"`
	Quantity      int                 `json:"quantity"`
	Yield         *InvestAmount       `json:"yield,omitempty" gorm:"embedded;embeddedPrefix:yield_"`
	YieldRelative *float64            `json:"yieldRelative,omitempty"`
}

type TradesInfo

type TradesInfo struct {
	Trades     []Trade `json:"trades" gorm:"constraint:OnDelete:CASCADE;foreignKey:InvestOperationInternalId"`
	TradesSize int     `json:"tradesSize"`
}

type User

type User struct {
	Phone string `gorm:"primaryKey"`
	Name  string `gorm:"index"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL