expense

package
v0.0.0-...-94d2d5c Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	*handler.Context
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(ctx *handler.Context, db *postgresql.DatabasePostgreSQL) *Context

func (*Context) CreateAnExpense

func (c *Context) CreateAnExpense(gc *gin.Context)

func (*Context) DeleteExpense

func (c *Context) DeleteExpense(gc *gin.Context)

func (*Context) GetAllExpenses

func (c *Context) GetAllExpenses(gc *gin.Context)

func (*Context) GetAnExpenses

func (c *Context) GetAnExpenses(context *gin.Context)

func (*Context) ImportExpenseFromCSV

func (c *Context) ImportExpenseFromCSV(gc *gin.Context)

type Database

type Database struct {
	*postgresql.DatabasePostgreSQL
}

func NewDatabase

func NewDatabase(db *postgresql.DatabasePostgreSQL) *Database

func (*Database) CreateExpense

func (db *Database) CreateExpense(expense *Expense) error

func (Database) GetAllExpensesOfAnAccount

func (db Database) GetAllExpensesOfAnAccount(id string) ([]*Expense, error)

func (Database) GetExpensesOfAnAccountBetween

func (db Database) GetExpensesOfAnAccountBetween(id, from, to string) ([]*Expense, error)

type Expense

type Expense struct {
	ExpenseEditable
	AccountId string `json:"accountId,omitempty"`
}

type ExpenseEditable

type ExpenseEditable struct {
	ID          string     `json:"id,omitempty"`
	Value       float32    `json:"value"`
	Libelle     string     `json:"libelle"`
	TypeExpense string     `json:"typeExpense"`
	ExpenseDate time.Time  `json:"expenseDate,omitempty"`
	CreatedAt   *time.Time `json:"createdAt,omitempty"`
	UpdatedAt   *time.Time `json:"updatedAt,omitempty"`
}

type Service

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

func NewService

func NewService(database *Database) *Service

func (Service) CreateExpense

func (s Service) CreateExpense(expense *Expense) error

func (Service) GetAllExpensesOfAnAccount

func (s Service) GetAllExpensesOfAnAccount(accountId string) ([]*Expense, error)

func (Service) GetExpensesOfAnAccountBetween

func (s Service) GetExpensesOfAnAccountBetween(accountId, from, to string) ([]*Expense, error)

func (Service) ProcessCSVFile

func (s Service) ProcessCSVFile(filedata [][]string, account *account.Account) error

Jump to

Keyboard shortcuts

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