loans

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoanFlowStarted    = "loan.flow.started"
	EmailConfirmedType = "loan.email_confirmed"
)
View Source
const EntityType = "loans"

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

type Aggregate struct {
	es.AggregateBase[*LoanView]
}

func New

func New() *Aggregate

New creates a new aggregate with a new ID.

func (*Aggregate) AcceptTermsAndConditions

func (a *Aggregate) AcceptTermsAndConditions(
	term int,
	deferredPct Percent,
	acceptConditions bool,
) error

func (*Aggregate) ConfirmEmail

func (a *Aggregate) ConfirmEmail() error

func (*Aggregate) StartFlow

func (a *Aggregate) StartFlow(cmd StartFlowCmd) error

func (*Aggregate) State

func (a *Aggregate) State() State

type ClientID

type ClientID string

type EmailConfirmed

type EmailConfirmed struct {
}

func (EmailConfirmed) Apply

func (e EmailConfirmed) Apply(snapshot *LoanView) error

type Event

type Event = event.Event

type FlowStarted

type FlowStarted struct {
	ClientID      ClientID
	TransactionID string
	TotalAmount   Money
}

func (FlowStarted) Apply

func (f FlowStarted) Apply(state *LoanView) error

type LoanView added in v0.1.6

type LoanView struct {
	ID               ids.ID
	Version          int
	ClientID         ClientID
	TransactionID    string
	TotalAmount      Money
	State            State
	Term             int
	DeferredPct      Percent
	IsEmailConfirmed bool
}

func (*LoanView) Apply added in v0.2.0

func (v *LoanView) Apply(event event.Event) error

func (*LoanView) SetVersion added in v0.1.6

func (v *LoanView) SetVersion(version int)

type Money

type Money float64

type Percent

type Percent float64

type StartFlowCmd

type StartFlowCmd struct {
	ClientID      ClientID
	TransactionID string
	TotalAmount   Money
}

type State

type State string
const (
	Started   State = "started"
	Accepted  State = "accepted"
	Confirmed State = "confirmed"
)

type TermsAndConditionsAccepted

type TermsAndConditionsAccepted struct {
	Term             int
	DeferredPct      Percent
	AcceptConditions bool
}

func (TermsAndConditionsAccepted) Apply

func (t TermsAndConditionsAccepted) Apply(snapshot *LoanView) error

Jump to

Keyboard shortcuts

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