gcf_interestcal

package module
v0.0.0-...-e575cc6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package gcf_interestcal google cloud function is triggered by upload to illuminating_upload_json_bucket_input by gcf_upload cloud function and starts calculating Delta for each bank account including overall for all deposits. It then also uploads the calculated Deltas with deposit details to illuminating_upload_json_bucket_output google cloud storage bucket for further processing.

Depends on gcf_upload cloud function deployed and having run successfully. See System Diagram for more details.

Index

Constants

View Source
const (
	// Saving for saving type.
	Saving = "Saving"
	// CertDep for cd type.
	CertDep = "CD"
	// Checking gor checking type.
	Checking = "Checking"
	// BrokerCD for Brokered cd type.
	BrokerCD = "Brokered CD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank struct {
	Name     string     `json:"name,omitempty"`
	Deposits []*Deposit `json:"deposits,omitempty"`
	Delta    float64    `json:"delta,omitempty"`
}

type BankResult

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

type CreateInterestRequest

type CreateInterestRequest struct {
	NewBanks []*NewBank `json:"new_banks" validate:"required,dive"` //nolint:tagliatelle
}

type CreateInterestResponse

type CreateInterestResponse struct {
	Banks []*Bank `json:"banks,omitempty"`
	Delta float64 `json:"delta,omitempty"`
}

type DeltaService

type DeltaService struct{}

type Deposit

type Deposit struct {
	Account     string  `json:"account,omitempty"`
	AccountType string  `json:"account_type,omitempty"` //nolint:tagliatelle
	Apy         float64 `json:"apy,omitempty"`
	Years       float64 `json:"years,omitempty"`
	Amount      float64 `json:"amount,omitempty"`
	Delta       float64 `json:"delta,omitempty"`
}

type NewBank

type NewBank struct {
	Name        string        `json:"name" validate:"required"`
	NewDeposits []*NewDeposit `json:"new_deposits" validate:"required,dive"` //nolint:tagliatelle
}

type NewDeposit

type NewDeposit struct {
	Account     string  `json:"account,omitempty"`
	AccountType string  `json:"account_type" validate:"required"` //nolint:tagliatelle
	Apy         float64 `json:"apy" validate:"gte=0"`
	Years       float64 `json:"years" validate:"required"`
	Amount      float64 `json:"amount" validate:"gte=0"`
}

type StorageObjectData

type StorageObjectData struct {
	Bucket         string    `json:"bucket,omitempty"`
	Name           string    `json:"name,omitempty"`
	Metageneration int64     `json:"metageneration,string,omitempty"`
	TimeCreated    time.Time `json:"timeCreated,omitempty"`
	Updated        time.Time `json:"updated,omitempty"`
}

StorageObjectData contains metadata of the Cloud Storage object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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