transactionv1

package
v0.0.0-...-1419b38 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateReport

func GenerateReport(ctx *gin.Context)

Types

type AccountBalance

type AccountBalance struct {
	Account        string
	TotalBalance   float64
	BalacePerMonth *dataframe.DataFrame
	DebitTx        *TransactionData
	CreditTx       *TransactionData
}

func (*AccountBalance) GetAccount

func (a *AccountBalance) GetAccount() string

GetAccount returns the account field

func (*AccountBalance) GetBalacePerMonth

func (a *AccountBalance) GetBalacePerMonth() *dataframe.DataFrame

GetBalacePerMonth returns the dataframe with total balance per month

func (*AccountBalance) GetCreditTx

func (a *AccountBalance) GetCreditTx() *TransactionData

GetCreditTx returns the credit transactions data

func (*AccountBalance) GetDebitTx

func (a *AccountBalance) GetDebitTx() *TransactionData

GetDebitTx returns the debit transactions data

func (*AccountBalance) GetTopTransactionStr

func (a *AccountBalance) GetTopTransactionStr(txType TransactionType, topNum int) (topTxStr string)

func (*AccountBalance) GetTotalBalance

func (a *AccountBalance) GetTotalBalance() float64

GetTotalBalance returns the total balance field

func (*AccountBalance) SendReport

func (a *AccountBalance) SendReport(receiverEmail string) error

type ExtractRequest

type ExtractRequest struct {
	Account       string `json:"account" binding:"required"`
	Year          int    `json:"year" binding:"required"`
	ReceiverEmail string `json:"receiver_email" binding:"required"`
}

func (*ExtractRequest) GetAccount

func (e *ExtractRequest) GetAccount() string

GetAccount returns the Account field

func (*ExtractRequest) GetReceiverEmail

func (e *ExtractRequest) GetReceiverEmail() string

GetReceiverEmail returns the ReceiverEmail field

func (*ExtractRequest) GetYear

func (e *ExtractRequest) GetYear() int

GetYear returns the Year field

type TransactionData

type TransactionData struct {
	AverageTxValue  float64
	TopTransactions *dataframe.DataFrame
}

func (*TransactionData) GetAverageTxValue

func (t *TransactionData) GetAverageTxValue() float64

GetAverageTxValue returns the average transaction value

func (*TransactionData) GetTopTransactions

func (t *TransactionData) GetTopTransactions() *dataframe.DataFrame

GetTopTransactions returns the dataframe with top transactions field

type TransactionDataframe

type TransactionDataframe struct {
	// contains filtered or unexported fields
}

func NewTransactionDF

func NewTransactionDF(account, csvPath string, year int) (tx *TransactionDataframe, err error)

func (*TransactionDataframe) InsertData

func (t *TransactionDataframe) InsertData() error

func (*TransactionDataframe) NewAccountBalance

func (t *TransactionDataframe) NewAccountBalance() *AccountBalance

func (*TransactionDataframe) PreProcessData

func (t *TransactionDataframe) PreProcessData()

type TransactionType

type TransactionType int
const (
	TransactionType_UNKNOWN TransactionType = iota
	TransactionType_DEBIT
	TransactionType_CREDIT
)

Jump to

Keyboard shortcuts

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