ledger

package
v0.0.0-...-fa32389 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPending  Status = "pending"
	StatusResolved Status = "resolved"

	EntityTypeIssuer   Entity = "issuer"
	EntityTypeInvestor Entity = "investor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity string

type Ledger

type Ledger struct {
	ID uuid.UUID `json:"id"`
	// Status is the status of the ledger
	Status Status `json:"status"`
	// InvoiceID is the ID of the invoice that this ledger is associated with
	InvoiceID uuid.UUID `json:"invoice_id"`
	// Entity is the type of entity that this ledger is associated with
	Entity Entity `json:"entity"`
	// EntityID is the ID of the entity that this ledger is associated with
	EntityID uuid.UUID `json:"entity_id"`
	// Amount is the amount of money that this ledger is associated with
	Amount float64 `json:"amount"`
	// CreatedAt is the time that this ledger was created
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt is the time that this ledger was last updated
	UpdatedAt time.Time `json:"updated_at"`
}

func New

func New(invoiceID uuid.UUID, entity Entity, entityID uuid.UUID, amount float64) (*Ledger, error)

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func NewMockRepository

func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository

NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockRepository) AddLedgerEntry

func (_m *MockRepository) AddLedgerEntry(ctx context.Context, _a1 *Ledger, opts ...unitofwork.Option) error

AddLedgerEntry provides a mock function with given fields: ctx, _a1, opts

func (*MockRepository) GetLedgerEntriesByInvoiceID

func (_m *MockRepository) GetLedgerEntriesByInvoiceID(ctx context.Context, invoiceID uuid.UUID, opts ...unitofwork.Option) ([]*Ledger, error)

GetLedgerEntriesByInvoiceID provides a mock function with given fields: ctx, invoiceID, opts

type Repository

type Repository interface {
	AddLedgerEntry(ctx context.Context, ledger *Ledger, opts ...unitofwork.Option) error
	GetLedgerEntriesByInvoiceID(ctx context.Context, invoiceID uuid.UUID, opts ...unitofwork.Option) ([]*Ledger, error)
}

type Service

type Service interface {
	AddLedgerEntry(ctx context.Context, invoiceID uuid.UUID, entity Entity, amount float64) (*Ledger, error)
}

type Status

type Status string

Jump to

Keyboard shortcuts

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