loans

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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