model

package
v0.0.0-...-26a0867 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package model contains the models of the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankAccount

type BankAccount struct {
	ID BankAccountID `db:"id"`

	BankAccountState
}

BankAccount represent a bank account.

type BankAccountID

type BankAccountID int64

BankAccountID is the type of BankAccount id.

type BankAccountState

type BankAccountState struct {
	OrganizationName string `db:"organization_name" json:"organization_name"`
	BalanceCents     Cents  `db:"balance_cents"`
	Iban             string `db:"iban"`
	Bic              string `db:"bic"`
}

BankAccountState represents the BankAccount internal state/data.

type Cents

type Cents int64

Cents represents cents.

func ToCents

func ToCents(f float64) Cents

ToCents convert float into cents.

type Transaction

type Transaction struct {
	ID TransactionID `db:"id"`

	TransactionState
}

Transaction represent a transaction.

type TransactionID

type TransactionID int64

TransactionID is the type of Transaction id.

type TransactionState

type TransactionState struct {
	CounterpartyName string        `db:"counterparty_name"`
	CounterpartyIban string        `db:"counterparty_iban"`
	CounterpartyBic  string        `db:"counterparty_bic"`
	AmountCents      Cents         `db:"amount_cents"`
	AmountCurrency   string        `db:"amount_currency"`
	BankAccountID    BankAccountID `db:"bank_account_id"`
	Description      string        `db:"description"`
}

TransactionState represents the Transaction internal state/data.

Jump to

Keyboard shortcuts

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