repository

package
v0.0.0-...-ffaedda Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInfrastructure = errors.New(`infrastructure`)

	ErrNoEvents = errors.New(`no new event into log`)
)

Functions

func Ack

func Ack(ctx context.Context, offset int) error

func Close

func Close(ctx context.Context) error

func GetEvent

func GetEvent(ctx context.Context) (offset int, event schema.PaymentsEvent, err error)

func Init

func Init(cfg *config.Config) func(context.Context) error

func PersistTransaction

func PersistTransaction(ctx context.Context, customerID uuid.UUID, event domain.Event) (domain.Payment, error)

Types

type Balance

type Balance struct {
	CustomerID pgtype.UUID
	Available  decimal.Decimal
	Reserved   decimal.Decimal
}

type Payment

type Payment struct {
	PaymentID  pgtype.UUID
	CustomerID pgtype.UUID
	OrderID    pgtype.UUID
	Amount     decimal.Decimal
	Status     string
}

Jump to

Keyboard shortcuts

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