model

package
v0.0.0-...-3638110 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID          string         `json:"id"`
	DisplayName string         `json:"displayName"`
	Labels      []*KeyAndValue `json:"labels"`
	Children    []*Account     `json:"children"`
	Parent      *Account       `json:"parent"`
}

type AccountUpdate

type AccountUpdate struct {
	DisplayName *string             `json:"displayName"`
	Labels      []*KeyAndValueInput `json:"labels"`
	ParentID    *string             `json:"parentID"`
}

type KeyAndValue

type KeyAndValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type KeyAndValueInput

type KeyAndValueInput struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Money

type Money uint64

func NewMoney

func NewMoney(primary, secondary uint64) Money

func ParseMoney

func ParseMoney(s string) (Money, error)

func (Money) FormatContext

func (m Money) FormatContext(_ context.Context) (string, error)

func (Money) MarshalGQLContext

func (m Money) MarshalGQLContext(ctx context.Context, w io.Writer) error

func (Money) Primary

func (m Money) Primary() uint64

func (Money) Secondary

func (m Money) Secondary() uint64

func (Money) String

func (m Money) String() string

func (*Money) UnmarshalGQLContext

func (m *Money) UnmarshalGQLContext(_ context.Context, v interface{}) error

type NewAccount

type NewAccount struct {
	ID          *string             `json:"id"`
	DisplayName string              `json:"displayName"`
	Labels      []*KeyAndValueInput `json:"labels"`
	ParentID    *string             `json:"parentID"`
}

type NewTransaction

type NewTransaction struct {
	Date            time.Time `json:"Date"`
	TargetAccountID string    `json:"targetAccountID"`
	SourceAccountID string    `json:"sourceAccountID"`
	ReferenceID     string    `json:"referenceID"`
	Amount          Money     `json:"amount"`
	Description     string    `json:"description"`
}

type Tenant

type Tenant struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
	Slug        string `json:"slug"`
}

type Transaction

type Transaction struct {
	ID            string    `json:"id"`
	Date          time.Time `json:"Date"`
	TargetAccount *Account  `json:"targetAccount"`
	SourceAccount *Account  `json:"sourceAccount"`
	ReferenceID   string    `json:"referenceID"`
	Amount        Money     `json:"amount"`
	Description   string    `json:"description"`
}

Jump to

Keyboard shortcuts

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