server

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 20 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 GetAllocation

func GetAllocation(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 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 GetPrices added in v0.2.2

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

func Listen

func Listen(db *gorm.DB)

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 Breakdown

type Breakdown struct {
	Group            string  `json:"group"`
	InvestmentAmount float64 `json:"investment_amount"`
	WithdrawalAmount float64 `json:"withdrawal_amount"`
	MarketAmount     float64 `json:"market_amount"`
	BalanceUnits     float64 `json:"balance_units"`
	LatestPrice      float64 `json:"latest_price"`
	XIRR             float64 `json:"xirr"`
}

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"`
	Harvestable Harvestable              `json:"harvestable"`
}

type FYCapitalGain added in v0.2.2

type FYCapitalGain struct {
	Gain          float64 `json:"gain"`
	Units         float64 `json:"units"`
	PurchasePrice float64 `json:"purchase_price"`
	SellPrice     float64 `json:"sell_price"`
}

type Gain

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

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 {
	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 Level added in v0.2.3

type Level string
const (
	WARN  Level = "warning"
	ERROR Level = "danger"
)

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 Rule added in v0.2.3

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

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 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"`
}

Jump to

Keyboard shortcuts

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