bid

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bid

type Bid struct {
	ID             uuid.UUID `json:"id"`
	InvoiceID      uuid.UUID `json:"invoice_id"`
	InvestorID     uuid.UUID `json:"investor_id"`
	Amount         float64   `json:"amount"`
	AcceptedAmount float64   `json:"accepted_amount"`
	Status         Status    `json:"status"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

func New

func New(invoiceID, investorID uuid.UUID, amount float64) (*Bid, 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) CreateBid

func (_m *MockRepository) CreateBid(ctx context.Context, b *Bid, opts ...unitofwork.Option) error

CreateBid provides a mock function with given fields: ctx, b, opts

func (*MockRepository) DeleteBid

func (_m *MockRepository) DeleteBid(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) error

DeleteBid provides a mock function with given fields: ctx, id, opts

func (*MockRepository) GetBidByID

func (_m *MockRepository) GetBidByID(ctx context.Context, id uuid.UUID) (*Bid, error)

GetBidByID provides a mock function with given fields: ctx, id

func (*MockRepository) ListBidsByInvestorID

func (_m *MockRepository) ListBidsByInvestorID(ctx context.Context, investorID uuid.UUID) ([]*Bid, error)

ListBidsByInvestorID provides a mock function with given fields: ctx, investorID

func (*MockRepository) ListBidsByInvoiceID

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

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

func (*MockRepository) UpdateBid

func (_m *MockRepository) UpdateBid(ctx context.Context, b *Bid, opts ...unitofwork.Option) error

UpdateBid provides a mock function with given fields: ctx, b, opts

type Repository

type Repository interface {
	CreateBid(ctx context.Context, b *Bid, opts ...unitofwork.Option) error
	GetBidByID(ctx context.Context, id uuid.UUID) (*Bid, error)
	UpdateBid(ctx context.Context, b *Bid, opts ...unitofwork.Option) error
	DeleteBid(ctx context.Context, id uuid.UUID, opts ...unitofwork.Option) error
	ListBidsByInvoiceID(ctx context.Context, invoiceID uuid.UUID, opts ...unitofwork.Option) ([]*Bid, error)
	ListBidsByInvestorID(ctx context.Context, investorID uuid.UUID) ([]*Bid, error)
}

type Service

type Service interface {
	CreateBid(ctx context.Context, bid *Bid) (*Bid, error)
	GetBidByID(ctx context.Context, id uuid.UUID) (*Bid, error)
	UpdateBid(ctx context.Context, bid *Bid) (*Bid, error)
	DeleteBid(ctx context.Context, id uuid.UUID) error
	ListBidsByInvoiceID(ctx context.Context, invoiceID uuid.UUID) ([]*Bid, error)
	ListBidsByInvestorID(ctx context.Context, investorID uuid.UUID) ([]*Bid, error)
}

type Status

type Status string
const (
	// Pending declares a bid has been created but has not been approved or rejected yet
	Pending Status = "PENDING"
	// Accepted declares a bid has been approved for transaction
	Accepted Status = "ACCEPTED"
	// Rejected declares the bid has not been approved
	Rejected Status = "REJECTED"
)

Jump to

Keyboard shortcuts

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