server

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_FORMAT string = "02 Jan 2006"

Variables

View Source
var CII_START_DATE, _ = time.Parse("2006-01-02", "2001-03-31")
View Source
var EQUITY_GRANDFATHER_DATE, _ = time.Parse("2006-01-02", "2018-02-01")

Functions

func DeleteBackups added in v0.3.2

func DeleteBackups(file LedgerFile) gin.H

func GetAllocation

func GetAllocation(db *gorm.DB) gin.H

func GetCapitalGains added in v0.2.6

func GetCapitalGains(db *gorm.DB) gin.H

func GetDiagnosis added in v0.2.3

func GetDiagnosis(db *gorm.DB) gin.H

func GetExpense added in v0.2.0

func GetExpense(db *gorm.DB) gin.H

func GetFile added in v0.3.2

func GetFile(file LedgerFile) gin.H

func GetFiles added in v0.3.1

func GetFiles(db *gorm.DB) gin.H

func GetGain

func GetGain(db *gorm.DB) gin.H

func GetHarvest added in v0.2.2

func GetHarvest(db *gorm.DB) gin.H

func GetIncome added in v0.1.3

func GetIncome(db *gorm.DB) gin.H

func GetInvestment

func GetInvestment(db *gorm.DB) gin.H

func GetLedger

func GetLedger(db *gorm.DB) gin.H

func GetOverview

func GetOverview(db *gorm.DB) gin.H

func GetPortfolioAllocation added in v0.3.0

func GetPortfolioAllocation(db *gorm.DB) gin.H

func GetPrices added in v0.2.2

func GetPrices(db *gorm.DB) gin.H

func GetScheduleAL added in v0.2.5

func GetScheduleAL(db *gorm.DB) gin.H

func GetTransactions added in v0.2.9

func GetTransactions(db *gorm.DB) gin.H

func Listen

func Listen(db *gorm.DB)

func SaveFile added in v0.3.1

func SaveFile(file LedgerFile) gin.H

func Sync added in v0.2.8

func Sync(db *gorm.DB, request SyncRequest) gin.H

func ValidateFile added in v0.3.1

func ValidateFile(file LedgerFile) gin.H

Types

type Aggregate

type Aggregate struct {
	Date         time.Time `json:"date"`
	Account      string    `json:"account"`
	Amount       float64   `json:"amount"`
	MarketAmount float64   `json:"market_amount"`
}

type AllocationTarget added in v0.1.3

type AllocationTarget struct {
	Name       string               `json:"name"`
	Target     float64              `json:"target"`
	Current    float64              `json:"current"`
	Aggregates map[string]Aggregate `json:"aggregates"`
}

type AllocationTargetConfig added in v0.1.3

type AllocationTargetConfig struct {
	Name     string
	Target   float64
	Accounts []string
}

type CapitalGain added in v0.2.2

type CapitalGain struct {
	Account     string                   `json:"account"`
	TaxCategory string                   `json:"tax_category"`
	FY          map[string]FYCapitalGain `json:"fy"`
}

type CommodityBreakdown added in v0.3.0

type CommodityBreakdown struct {
	ParentCommodityID string  `json:"parent_commodity_id"`
	CommodityName     string  `json:"commodity_name"`
	SecurityName      string  `json:"security_name"`
	SecurityRating    string  `json:"security_rating"`
	SecurityIndustry  string  `json:"security_industry"`
	Percentage        float64 `json:"percentage"`
	SecurityID        string  `json:"security_id"`
	SecurityType      string  `json:"security_type"`
	Amount            float64 `json:"amount"`
}

type FYCapitalGain added in v0.2.2

type FYCapitalGain struct {
	Gain          float64       `json:"gain"`
	TaxableGain   float64       `json:"taxable_gain"`
	ShortTermTax  float64       `json:"short_term_tax"`
	LongTermTax   float64       `json:"long_term_tax"`
	Units         float64       `json:"units"`
	PurchasePrice float64       `json:"purchase_price"`
	SellPrice     float64       `json:"sell_price"`
	PostingPairs  []PostingPair `json:"posting_pairs"`
}

type Gain

type Gain struct {
	Account          string     `json:"account"`
	OverviewTimeline []Overview `json:"overview_timeline"`
	XIRR             float64    `json:"xirr"`
}

type Graph added in v0.3.2

type Graph struct {
	Nodes []Node `json:"nodes"`
	Links []Link `json:"links"`
}

type HarvestBreakdown added in v0.2.2

type HarvestBreakdown struct {
	Units                 float64   `json:"units"`
	PurchaseDate          time.Time `json:"purchase_date"`
	PurchasePrice         float64   `json:"purchase_price"`
	CurrentPrice          float64   `json:"current_price"`
	PurchaseUnitPrice     float64   `json:"purchase_unit_price"`
	UnrealizedGain        float64   `json:"unrealized_gain"`
	TaxableUnrealizedGain float64   `json:"taxable_unrealized_gain"`
}

type Harvestable added in v0.2.2

type Harvestable struct {
	Account               string             `json:"account"`
	TaxCategory           string             `json:"tax_category"`
	TotalUnits            float64            `json:"total_units"`
	HarvestableUnits      float64            `json:"harvestable_units"`
	UnrealizedGain        float64            `json:"unrealized_gain"`
	TaxableUnrealizedGain float64            `json:"taxable_unrealized_gain"`
	HarvestBreakdown      []HarvestBreakdown `json:"harvest_breakdown"`
	CurrentUnitPrice      float64            `json:"current_unit_price"`
	GrandfatherUnitPrice  float64            `json:"grandfather_unit_price"`
	CurrentUnitDate       time.Time          `json:"current_unit_date"`
}

type Income added in v0.1.3

type Income struct {
	Date     time.Time         `json:"date"`
	Postings []posting.Posting `json:"postings"`
}

type Issue added in v0.2.3

type Issue struct {
	Level       Level  `json:"level"`
	Summary     string `json:"summary"`
	Description string `json:"description"`
	Details     string `json:"details"`
}

type LedgerFile added in v0.3.1

type LedgerFile struct {
	Name     string   `json:"name"`
	Content  string   `json:"content"`
	Versions []string `json:"versions"`
}

type Level added in v0.2.3

type Level string
const (
	WARN  Level = "warning"
	ERROR Level = "danger"
)
type Link struct {
	Source uint    `json:"source"`
	Target uint    `json:"target"`
	Value  float64 `json:"value"`
}

type Node added in v0.3.2

type Node struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

type Overview

type Overview struct {
	Date             time.Time `json:"date"`
	InvestmentAmount float64   `json:"investment_amount"`
	WithdrawalAmount float64   `json:"withdrawal_amount"`
	GainAmount       float64   `json:"gain_amount"`
}

type Pair added in v0.3.2

type Pair struct {
	Source uint `json:"source"`
	Target uint `json:"target"`
}

type PortfolioAggregate added in v0.3.0

type PortfolioAggregate struct {
	Group      string               `json:"group"`
	SubGroup   string               `json:"sub_group"`
	ID         string               `json:"id"`
	Percentage float64              `json:"percentage"`
	Amount     float64              `json:"amount"`
	Breakdowns []CommodityBreakdown `json:"breakdowns"`
}

type PortfolioDimension added in v0.3.0

type PortfolioDimension struct {
	Group      string
	GroupFn    func(CommodityBreakdown) string
	SubGroup   string
	SubGroupFn func(CommodityBreakdown) string
	FilterFn   func(CommodityBreakdown, int) bool
}

type PostingPair added in v0.2.6

type PostingPair struct {
	Purchase     posting.Posting `json:"purchase"`
	Sell         posting.Posting `json:"sell"`
	Gain         float64         `json:"gain"`
	TaxableGain  float64         `json:"taxable_gain"`
	ShortTermTax float64         `json:"short_term_tax"`
	LongTermTax  float64         `json:"long_term_tax"`
}

type Rule added in v0.2.3

type Rule struct {
	Issue     Issue
	Predicate func(db *gorm.DB) []error
}

type ScheduleALConfig added in v0.2.5

type ScheduleALConfig struct {
	Code     string
	Accounts []string
}

type ScheduleALEntry added in v0.2.5

type ScheduleALEntry struct {
	Section ScheduleALSection `json:"section"`
	Amount  float64           `json:"amount"`
}

type ScheduleALSection added in v0.2.5

type ScheduleALSection struct {
	Code    string `json:"code"`
	Section string `json:"section"`
	Details string `json:"details"`
}

type SyncRequest added in v0.3.0

type SyncRequest struct {
	Journal    bool `json:"journal"`
	Prices     bool `json:"prices"`
	Portfolios bool `json:"portfolios"`
}

type Tax added in v0.1.3

type Tax struct {
	StartDate time.Time         `json:"start_date"`
	EndDate   time.Time         `json:"end_date"`
	Postings  []posting.Posting `json:"postings"`
}

type Transaction added in v0.2.9

type Transaction struct {
	ID       string            `json:"id"`
	Date     time.Time         `json:"date"`
	Payee    string            `json:"payee"`
	Postings []posting.Posting `json:"postings"`
}

type YearlyCard added in v0.1.5

type YearlyCard struct {
	StartDate         time.Time         `json:"start_date"`
	EndDate           time.Time         `json:"end_date"`
	Postings          []posting.Posting `json:"postings"`
	GrossSalaryIncome float64           `json:"gross_salary_income"`
	GrossOtherIncome  float64           `json:"gross_other_income"`
	NetTax            float64           `json:"net_tax"`
	NetIncome         float64           `json:"net_income"`
	NetInvestment     float64           `json:"net_investment"`
	NetExpense        float64           `json:"net_expense"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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