handlers

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxnCategoryTypeCallback    CallbackType = "txn-category"
	TxnSubcategoryTypeCallback CallbackType = "txn-subcategory"

	TransactionTypeCallback     CallbackType = "Transaction"
	TransactionFlagTypeCallback CallbackType = "Transaction with flags"
	SummaryTypeCallback         CallbackType = "Summary"
	ReportTypeCallback          CallbackType = "Report"
	AccountTypeCallback         CallbackType = "Account"
	UserTypeCallback            CallbackType = "DebtorsCreditors"

	StepTxnType     NextStep = "txn-type"
	StepAmount      NextStep = "txn-amount"
	StepSrcID       NextStep = "txn-srcid"
	StepDstID       NextStep = "txn-dstid"
	StepCategory    NextStep = "txn-cat"
	StepSubcategory NextStep = "txn-subcat"
	StepUser        NextStep = "txn-user"
	StepRemarks     NextStep = "txn-remarks"
	StepDone        NextStep = "txn-done"
)
View Source
const (
	StepGroupBy  NextStep = "group-by"
	StepDuration NextStep = "duration"

	GroupByTxnType        SummaryGroupBy = "Transaction Type"
	GroupByTxnCategory    SummaryGroupBy = "Category"
	GroupByTxnSubCategory SummaryGroupBy = "Subcategory"

	DurationOneWeek   SummaryDuration = "1 Week"
	DurationThisMonth SummaryDuration = "This Month"
	DurationOneMonth  SummaryDuration = "One Month"
	DurationHalfYear  SummaryDuration = "Last 6 Months"
	DurationThisYear  SummaryDuration = "This Year"
	DurationOneYear   SummaryDuration = "One Year"
)

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(ctx telebot.Context) error

func Callback

func Callback(ctx telebot.Context) error

func Help added in v1.0.1

func Help(ctx telebot.Context) error

func ListAccounts

func ListAccounts(ctx telebot.Context) error

func ListExpenses

func ListExpenses(ctx telebot.Context) error

func ListTransactionSubcategories

func ListTransactionSubcategories(ctx telebot.Context) error

func ListTransactions

func ListTransactions(ctx telebot.Context) error

func ListUsers

func ListUsers(ctx telebot.Context) error

func New

func New(ctx telebot.Context) error

func NewTransaction

func NewTransaction(ctx telebot.Context) error

func NewUser

func NewUser(ctx telebot.Context) error

func StartTrackingExpenses added in v1.0.1

func StartTrackingExpenses(ctx telebot.Context) error

func SyncSQLiteDatabase added in v0.2.0

func SyncSQLiteDatabase(ctx telebot.Context) error

func TransactionCategoryCallback

func TransactionCategoryCallback(ctx telebot.Context) error

func TransactionReportCallback

func TransactionReportCallback(ctx telebot.Context) error

func TransactionSummary

func TransactionSummary(ctx telebot.Context) error

func TransactionSummaryCallback

func TransactionSummaryCallback(ctx telebot.Context) error

func TransactionTextCallback

func TransactionTextCallback(ctx telebot.Context) error

func Welcome

func Welcome(ctx telebot.Context) error

Types

type AccountCallbackOptions

type AccountCallbackOptions struct {
	NextStep  NextStep           `json:"nextStep"`
	Type      models.AccountType `json:"type"`
	ShortName string             `json:"shortName"`
	Name      string             `json:"name"`
}

type CallbackOptions

type CallbackOptions struct {
	Type              CallbackType               `json:"type"`
	Transaction       TransactionCallbackOptions `json:"transaction,omitempty"`
	Summary           SummaryCallbackOptions     `json:"summary,omitempty"`
	Report            ReportCallbackOptions      `json:"report,omitempty"`
	Account           AccountCallbackOptions     `json:"account,omitempty"`
	User              UserCallbackOptions        `json:"user,omitempty"`
	Category          TxnCategoryCallbackOptions `json:"category,omitempty"`
	LastSelectedValue string
}

type CallbackType

type CallbackType string

type NextStep

type NextStep string
const (
	StepAccountType NextStep = "type"
	StepAccountInfo NextStep = "info"
)
const (
	StepCategoryID    NextStep = "cat-id"
	StepSubcategoryID NextStep = "subcat-id"
)

type ReportCallbackOptions

type ReportCallbackOptions struct {
	Duration SummaryDuration `json:"duration"`
}

type SummaryCallbackOptions

type SummaryCallbackOptions struct {
	NextStep NextStep        `json:"nextStep"`
	GroupBy  SummaryGroupBy  `json:"groupBy,omitempty"`
	Duration SummaryDuration `json:"duration,omitempty"`
}

type SummaryDuration

type SummaryDuration string

type SummaryGroupBy

type SummaryGroupBy string

type TransactionCallbackOptions

type TransactionCallbackOptions struct {
	NextStep NextStep `json:"nextStep"`

	Type models.TransactionType `json:"type"`

	Amount             float64 `json:"amount,omitempty"`
	SrcID              string  `json:"srcID,omitempty"`
	DstID              string  `json:"dstID,omitempty"`
	CategoryID         string  `json:"catID,omitempty"`
	SubcategoryID      string  `json:"subcatID,omitempty"`
	DebtorCreditorName string  `json:"userID,omitempty"`
	Remarks            string  `json:"remarks,omitempty"`
}

type TransactionOptions

type TransactionOptions struct {
	Type     string
	Amount   float64
	SubCatID string
	SrcID    string
	DstID    string
	UserID   string
	Remarks  string
}

type TxnCategoryCallbackOptions

type TxnCategoryCallbackOptions struct {
	NextStep      NextStep `json:"nextStep"`
	CategoryID    string   `json:"categoryID"`
	SubcategoryID string   `json:"subcategoryID"`
}

type UserCallbackOptions

type UserCallbackOptions struct {
	NickName string `json:"id"`
	FullName string `json:"name"`
	Email    string `json:"email"`
}

Jump to

Keyboard shortcuts

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