money

package
v0.0.0-...-9bfc92b Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMonthlyStatCreate

func AutoMonthlyStatCreate(w http.ResponseWriter, r *http.Request)

func AutoNewMonthlyStat

func AutoNewMonthlyStat(archive_date ...string)

func CreateMoneysTable

func CreateMoneysTable()

func ForceMonthlyStatCreate

func ForceMonthlyStatCreate(w http.ResponseWriter, r *http.Request)

func InitRoutes

func InitRoutes()

func Launcher

func Launcher()

func MoneysCreate

func MoneysCreate(w http.ResponseWriter, r *http.Request)

func MoneysIndex

func MoneysIndex(w http.ResponseWriter, r *http.Request)

func MoneysShowByLabel

func MoneysShowByLabel(w http.ResponseWriter, r *http.Request)

func MonthlyStatShowByDate

func MonthlyStatShowByDate(w http.ResponseWriter, r *http.Request)

func MonthlyStatsIndex

func MonthlyStatsIndex(w http.ResponseWriter, r *http.Request)

func NewMoney

func NewMoney(mon *Money)

func NewMonthlyStat

func NewMonthlyStat(stat *Money_Stat)

func Specimen

func Specimen()

func TheDb

func TheDb() *sql.DB

func TheLogger

func TheLogger() *logger.Logger

func TheRouter

func TheRouter() *mux.Router

func TheSecureRouter

func TheSecureRouter() *mux.Router

func UpdateMonthlyStat

func UpdateMonthlyStat(stat *Money_Stat)

Types

type Money

type Money struct {
	// Id of the entry
	// in: int
	// read only: true
	Id int `json:"id"`
	// Label of the operation
	// in: string
	// example: event
	// required: true
	Label string `json:"label"`
	// Price of the operation
	// in: float
	// example: 1.5
	// required: true
	Price float64 `json:"price"`
	// Payment type of the operation
	// in: string
	// example: cash
	// required: true
	PaymentType string `json:"payment_type"`
	// Payment date of the operation
	// in: string
	// example: 2023-01-23
	// required: true
	PaymentDate string `json:"payment_date"`
	// CreatedAt date of the operation
	// in: time.Time
	// read only: true
	CreatedAt time.Time `json:"created_at"`
}

swagger:model Money

type Money_Stat

type Money_Stat struct {
	// Id of the entry
	// in: int
	// read only: true
	Id int `json:"id"`
	// Archive date of the stat
	// in: string
	// example: 2023-01
	// required: true
	ArchiveDate string `json:"archive_date"`
	// Number of each label
	// in: json
	// example: {"event": 12, "esncard": 4}
	// read only: true
	NbPerLabel json.RawMessage `json:"nb_per_label"`
	// Average prices per type of label
	// in: json
	// example: {"adhesion": 12.5, "esncard": 5}
	// read only: true
	AvgPrices json.RawMessage `json:"avg_prices"`
	// Min prices per type of label
	// in: json
	// example: {"adhesion": 1, "esncard": 5}
	// read only: true
	MinPrices json.RawMessage `json:"min_prices"`
	// Max prices per type of label
	// in: json
	// example: {"adhesion": 20, "esncard": 5}
	// read only: true
	MaxPrices json.RawMessage `json:"max_prices"`
	// Number of Payments type
	// in: json
	// example: {"cash": 12, "cb": 5}
	// read only: true
	NbPaymentTypes json.RawMessage `json:"nb_payments_type"`
	// CreatedAt date of the operation
	// in: time.Time
	// read only: true
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt date of the operation
	// in: time.Time
	// read only: true
	UpdatedAt time.Time `json:"updated_at"`
}

swagger:model Money_Stats

func FindMonthlyStatByDate

func FindMonthlyStatByDate(archive_date string) *Money_Stat

type Money_Stats

type Money_Stats []Money_Stat

func AllMonthlyStats

func AllMonthlyStats() *Money_Stats

type Moneys

type Moneys []Money

func AllMoneys

func AllMoneys() *Moneys

func FindMoneysByDate

func FindMoneysByDate(payment_date string) *Moneys

func FindMoneysByLabel

func FindMoneysByLabel(label string) *Moneys

Jump to

Keyboard shortcuts

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