Documentation
¶
Index ¶
- Constants
- Variables
- type AccountSvc
- type BaseParser
- func (b *BaseParser) DecodeFiles(records []string) ([][]byte, error)
- func (b *BaseParser) GenerateHash(input string) string
- func (b *BaseParser) GetAccountAndAmount(ctx context.Context, req *GetAccountRequest) (*GetSecondaryAccountResponse, error)
- func (b *BaseParser) GetAccountMapByNumbers(accounts []*database.Account) (map[string]*database.Account, error)
- func (b *BaseParser) GetDefaultAccountAndAmount(ctx context.Context, req *GetAccountRequest) (*GetSecondaryAccountResponse, error)
- func (b *BaseParser) ToCreateRequests(ctx context.Context, transactions []*Transaction, skipRules bool, ...) ([]*transactionsv1.CreateTransactionRequest, error)
- type CategoriesSvc
- type CurrencyConverterSvc
- type DeduplicationItem
- type FireflyImporter
- func (f *FireflyImporter) Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
- func (f *FireflyImporter) ParseDate(date string, treatAsUtc bool) (time.Time, error)
- func (f *FireflyImporter) ParseSingleFile(ctx context.Context, req *ParseRequest, content []byte) (*ParseResponse, error)
- func (f *FireflyImporter) Type() importv1.ImportSource
- type GetAccountRequest
- type GetSecondaryAccountResponse
- type Implementation
- type ImportRequest
- type Importer
- func (i *Importer) CheckDuplicates(ctx context.Context, requests []*transactionsv1.CreateTransactionRequest, ...) ([]*DeduplicationItem, error)
- func (i *Importer) ConvertRequestsToTransactions(ctx context.Context, requests []*DeduplicationItem, skipRules bool) ([]*importv1.ParseTransactionsResponse_ParsedTransaction, error)
- func (i *Importer) Import(ctx context.Context, req *importv1.ImportTransactionsRequest) (*importv1.ImportTransactionsResponse, error)
- func (i *Importer) MarkTransactionsIgnored(ctx context.Context, req *importv1.MarkTransactionsIgnoredRequest) (*importv1.MarkTransactionsIgnoredResponse, error)
- func (i *Importer) Parse(ctx context.Context, req *importv1.ParseTransactionsRequest) (*importv1.ParseTransactionsResponse, error)
- func (i *Importer) ParseInternal(ctx context.Context, req *importv1.ParseTransactionsRequest) ([]*DeduplicationItem, error)
- type ImporterConfig
- type MapperSvc
- type Mbank
- type Message
- type Mono
- type Paribas
- type ParibasData
- type ParibasDataExtractor
- type ParibasDataExtractorV1
- type ParibasDataExtractorV2
- type ParseRequest
- type ParseResponse
- type Privat24
- type Record
- type Revolut
- type RuleSvc
- type TagSvc
- type Transaction
- type TransactionSvc
- type TransactionType
Constants ¶
View Source
const ( TransactionTypeUnknown = TransactionType(0) TransactionTypeIncome = TransactionType(1) TransactionTypeExpense = TransactionType(2) TransactionTypeInternalTransfer = TransactionType(3) TransactionTypeRemoteTransfer = TransactionType(4) )
Variables ¶
View Source
var ErrNoReferenceNumbers = errors.New("no valid reference numbers to ignore")
Functions ¶
This section is empty.
Types ¶
type AccountSvc ¶
type BaseParser ¶ added in v0.2.9
type BaseParser struct {
// contains filtered or unexported fields
}
func NewBaseParser ¶ added in v0.2.9
func NewBaseParser( svc CurrencyConverterSvc, txSvc TransactionSvc, mapper MapperSvc, ) *BaseParser
func (*BaseParser) DecodeFiles ¶ added in v0.2.9
func (b *BaseParser) DecodeFiles( records []string, ) ([][]byte, error)
func (*BaseParser) GenerateHash ¶ added in v0.2.9
func (b *BaseParser) GenerateHash(input string) string
func (*BaseParser) GetAccountAndAmount ¶ added in v0.2.9
func (b *BaseParser) GetAccountAndAmount( ctx context.Context, req *GetAccountRequest, ) (*GetSecondaryAccountResponse, error)
func (*BaseParser) GetAccountMapByNumbers ¶ added in v0.2.9
func (*BaseParser) GetDefaultAccountAndAmount ¶ added in v0.2.9
func (b *BaseParser) GetDefaultAccountAndAmount( ctx context.Context, req *GetAccountRequest, ) (*GetSecondaryAccountResponse, error)
func (*BaseParser) ToCreateRequests ¶ added in v0.2.9
func (b *BaseParser) ToCreateRequests( ctx context.Context, transactions []*Transaction, skipRules bool, accountMap map[string]*database.Account, importSource importv1.ImportSource, ) ([]*transactionsv1.CreateTransactionRequest, error)
type CategoriesSvc ¶
type CurrencyConverterSvc ¶ added in v0.2.0
type DeduplicationItem ¶ added in v0.2.9
type DeduplicationItem struct {
CreateRequest *transactionsv1.CreateTransactionRequest
DuplicationTransactionID *int64
Ignored bool
}
type FireflyImporter ¶
type FireflyImporter struct {
*BaseParser
// contains filtered or unexported fields
}
func NewFireflyImporter ¶
func NewFireflyImporter( txSvc TransactionSvc, converter CurrencyConverterSvc, parser *BaseParser, ) *FireflyImporter
func (*FireflyImporter) Parse ¶ added in v0.2.9
func (f *FireflyImporter) Parse( ctx context.Context, req *ParseRequest, ) (*ParseResponse, error)
func (*FireflyImporter) ParseSingleFile ¶ added in v0.2.9
func (f *FireflyImporter) ParseSingleFile( ctx context.Context, req *ParseRequest, content []byte, ) (*ParseResponse, error)
func (*FireflyImporter) Type ¶
func (f *FireflyImporter) Type() importv1.ImportSource
type GetAccountRequest ¶ added in v0.2.9
type GetAccountRequest struct {
InitialAmount decimal.Decimal
InitialCurrency string
Accounts map[string]*database.Account
AccountName string
TransactionType gomoneypbv1.TransactionType
}
type GetSecondaryAccountResponse ¶ added in v0.2.0
type Implementation ¶
type Implementation interface {
Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
Type() importv1.ImportSource
}
type ImportRequest ¶
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
func NewImporter ¶
func NewImporter( cfg *ImporterConfig, impl ...Implementation, ) *Importer
func (*Importer) CheckDuplicates ¶ added in v0.2.9
func (i *Importer) CheckDuplicates( ctx context.Context, requests []*transactionsv1.CreateTransactionRequest, skipDuplicateRefCheck bool, ) ([]*DeduplicationItem, error)
func (*Importer) ConvertRequestsToTransactions ¶ added in v0.2.9
func (i *Importer) ConvertRequestsToTransactions( ctx context.Context, requests []*DeduplicationItem, skipRules bool, ) ([]*importv1.ParseTransactionsResponse_ParsedTransaction, error)
func (*Importer) Import ¶
func (i *Importer) Import( ctx context.Context, req *importv1.ImportTransactionsRequest, ) (*importv1.ImportTransactionsResponse, error)
func (*Importer) MarkTransactionsIgnored ¶ added in v1.7.0
func (i *Importer) MarkTransactionsIgnored( ctx context.Context, req *importv1.MarkTransactionsIgnoredRequest, ) (*importv1.MarkTransactionsIgnoredResponse, error)
func (*Importer) Parse ¶ added in v0.2.9
func (i *Importer) Parse( ctx context.Context, req *importv1.ParseTransactionsRequest, ) (*importv1.ParseTransactionsResponse, error)
func (*Importer) ParseInternal ¶ added in v0.2.9
func (i *Importer) ParseInternal( ctx context.Context, req *importv1.ParseTransactionsRequest, ) ([]*DeduplicationItem, error)
type ImporterConfig ¶ added in v0.2.9
type ImporterConfig struct {
AccountSvc AccountSvc
TagSvc TagSvc
CategoriesSvc CategoriesSvc
TransactionSvc TransactionSvc
MapperSvc MapperSvc
RuleSvc RuleSvc
}
type MapperSvc ¶ added in v0.2.9
type MapperSvc interface {
MapTransaction(ctx context.Context, tx *database.Transaction) *gomoneypbv1.Transaction
}
type Mbank ¶ added in v1.3.0
type Mbank struct {
*BaseParser
}
func NewMbank ¶ added in v1.3.0
func NewMbank(base *BaseParser) *Mbank
func (*Mbank) Parse ¶ added in v1.3.0
func (m *Mbank) Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
func (*Mbank) ParseMessages ¶ added in v1.3.0
func (*Mbank) Type ¶ added in v1.3.0
func (m *Mbank) Type() importv1.ImportSource
type Mono ¶ added in v0.2.9
type Mono struct {
*BaseParser
}
func NewMono ¶ added in v0.2.9
func NewMono(base *BaseParser) *Mono
func (*Mono) Parse ¶ added in v0.2.9
func (m *Mono) Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
func (*Mono) Type ¶ added in v0.2.9
func (m *Mono) Type() importv1.ImportSource
type Paribas ¶ added in v0.2.12
type Paribas struct {
*BaseParser
// contains filtered or unexported fields
}
func NewParibas ¶ added in v0.2.12
func NewParibas(base *BaseParser) *Paribas
func (*Paribas) CanMatchAsInternalTransfer ¶ added in v0.2.28
func (p *Paribas) CanMatchAsInternalTransfer(f, tx *Transaction) bool
func (*Paribas) Parse ¶ added in v0.2.12
func (p *Paribas) Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
func (*Paribas) ParseMessages ¶ added in v0.2.12
func (*Paribas) Type ¶ added in v0.2.12
func (p *Paribas) Type() importv1.ImportSource
type ParibasData ¶ added in v0.2.12
type ParibasData struct {
Date time.Time
DateFromMessage string
Currency string
TransactionCurrency string
Amount decimal.Decimal
AmountString string
TransactionAmount decimal.Decimal
TransactionAmountString string
Sender string
Receiver string
Description string
Account string
DestinationAccount string
TransactionType string
ExecutedAt string
}
type ParibasDataExtractor ¶ added in v0.2.12
type ParibasDataExtractorV1 ¶ added in v0.2.12
type ParibasDataExtractorV1 struct{}
func (ParibasDataExtractorV1) Extract ¶ added in v0.2.12
func (d ParibasDataExtractorV1) Extract(_ context.Context, cells []*xlsx.Cell) (ParibasData, error)
type ParibasDataExtractorV2 ¶ added in v0.2.12
type ParibasDataExtractorV2 struct{}
func (ParibasDataExtractorV2) Extract ¶ added in v0.2.12
func (d ParibasDataExtractorV2) Extract(_ context.Context, cells []*xlsx.Cell) (ParibasData, error)
type ParseRequest ¶ added in v0.2.9
type ParseRequest struct {
ImportRequest
}
type ParseResponse ¶ added in v0.2.9
type ParseResponse struct {
CreateRequests []*transactionsv1.CreateTransactionRequest
}
type Privat24 ¶ added in v0.2.9
type Privat24 struct {
*BaseParser
}
func NewPrivat24 ¶ added in v0.2.9
func NewPrivat24(base *BaseParser) *Privat24
func (*Privat24) Parse ¶ added in v0.2.9
func (p *Privat24) Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
func (*Privat24) ParseMessages ¶ added in v0.2.9
func (*Privat24) Type ¶ added in v0.2.9
func (p *Privat24) Type() importv1.ImportSource
type Revolut ¶ added in v0.2.12
type Revolut struct {
*BaseParser
}
func NewRevolut ¶ added in v0.2.12
func NewRevolut(base *BaseParser) *Revolut
func (*Revolut) AccountName ¶ added in v0.2.12
func (*Revolut) Parse ¶ added in v0.2.12
func (r *Revolut) Parse(ctx context.Context, req *ParseRequest) (*ParseResponse, error)
func (*Revolut) ParseMessages ¶ added in v0.2.12
func (*Revolut) Type ¶ added in v0.2.12
func (r *Revolut) Type() importv1.ImportSource
type RuleSvc ¶ added in v1.7.0
type RuleSvc interface {
ProcessTransactions(
ctx context.Context,
inputTxs []*database.Transaction,
) ([]*database.Transaction, error)
}
type Transaction ¶ added in v0.2.9
type Transaction struct {
ID string
Type TransactionType
SourceAmount decimal.Decimal
SourceCurrency string
DestinationAmount decimal.Decimal
DestinationCurrency string
Date time.Time
Description string
SourceAccount string
DestinationAccount string
DateFromMessage string
Raw string
InternalTransferDirectionTo bool
DuplicateTransactions []*Transaction
OriginalMessage *Message `json:"-"`
DeduplicationKeys []string
OriginalTxType string
OriginalNadawcaName string
ParsingError error `json:"-"`
}
type TransactionSvc ¶
type TransactionSvc interface {
CreateBulkInternal(
ctx context.Context,
reqs []*transactions.BulkRequest,
tx *gorm.DB,
opts transactions.UpsertOptions,
) ([]*transactionsv1.CreateTransactionResponse, error)
ConvertRequestToTransaction(
ctx context.Context,
req *transactionsv1.CreateTransactionRequest,
originalTx *database.Transaction,
) (*database.Transaction, error)
}
type TransactionType ¶ added in v0.2.9
type TransactionType int32
Source Files
¶
Click to show internal directories.
Click to hide internal directories.