interestvalue

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package interestvalue provides struct values and associated operations for interest calculations for each deposit in the bank, then for each bank and finally for all banks with 30day average earning

Index

Constants

View Source
const (

	// Sa for aving type
	Sa = "Saving"
	// CD for cd type
	CD = "CD"
	// Ch gor checking type
	Ch = "Checking"
	// Br for Brokered type
	Br = "Brokered CD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank struct {
	Name     string    `json:"name"`
	Deposits []Deposit `json:"deposits"`

	Delta float64 `json:"delta"`
}

Bank is for output/response with Bank data and its deposists

type CreateInterestRequest

type CreateInterestRequest struct {
	NewBanks []NewBank `json:"banks"`
}

CreateInterestRequest is for input/request

func (CreateInterestRequest) CalculateDelta

func (cireq CreateInterestRequest) CalculateDelta() (CreateInterestResponse, error)

CalculateDelta calculations for all banks

type CreateInterestResponse

type CreateInterestResponse struct {
	Banks []Bank `json:"banks"`

	Delta float64 `json:"delta"`
}

CreateInterestResponse is for output/response

type Deposit

type Deposit struct {
	Account     string `json:"account"`
	AccountType string `json:"annualType"`

	APY    float64 `json:"annualRate%"`
	Years  float64 `json:"years"`
	Amount float64 `json:"amount"`

	Delta float64 `json:"delta"`
}

Deposit is for output/reponse with Deposit data

type NewBank

type NewBank struct {
	Name        string       `json:"name"`
	NewDeposits []NewDeposit `json:"deposits"`
}

NewBank is for input/request with Bank data and its deposits

type NewDeposit

type NewDeposit struct {
	Account     string `json:"account"`
	AccountType string `json:"annualType"`

	APY    float64 `json:"annualRate%"`
	Years  float64 `json:"years"`
	Amount float64 `json:"amount"`
}

NewDeposit is is for input/request with Bank data and its deposits

Jump to

Keyboard shortcuts

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