domain

package
v0.0.0-...-d2da372 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID      int `json:"id"`
	Limit   int `json:"limit"`
	Balance int `json:"balance"`
}

type Transaction

type Transaction struct {
	ClientID    int             `json:"client-id"`
	Type        TransactionType `json:"type"`
	Value       int             `json:"value"`
	Description string          `json:"description"`
	Timestamp   time.Time       `json:"timestamp"`
}

func NewTransaction

func NewTransaction(params TransactionParams) (*Transaction, error)

type TransactionParams

type TransactionParams struct {
	ClientID    int    `json:"client-id"`
	Type        string `json:"type"`
	Value       int    `json:"value"`
	Description string `json:"description"`
}

func (*TransactionParams) Validate

func (t *TransactionParams) Validate() error

type TransactionType

type TransactionType string
const (
	Debit  TransactionType = "d"
	Credit TransactionType = "c"
)

Jump to

Keyboard shortcuts

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