bid_usecase

package
v0.0.0-...-e7e69c2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidInputDTO

type BidInputDTO struct {
	UserId    string  `json:"user_id"`
	AuctionId string  `json:"auction_id"`
	Amount    float64 `json:"amount"`
}

type BidOutputDTO

type BidOutputDTO struct {
	Id        string    `json:"id"`
	UserId    string    `json:"user_id"`
	AuctionId string    `json:"auction_id"`
	Amount    float64   `json:"amount"`
	Timestamp time.Time `json:"timestamp" time_format:"2006-01-02 15:04:05"`
}

type BidUseCase

type BidUseCase struct {
	BidRepository bid_entity.BidRepositoryInterface
	// contains filtered or unexported fields
}

func (*BidUseCase) CreateBid

func (bu *BidUseCase) CreateBid(
	ctx context.Context,
	bidInputDTO BidInputDTO) (*BidOutputDTO, *internal_error.InternalError)

func (*BidUseCase) FindBidByAuctionId

func (bu *BidUseCase) FindBidByAuctionId(
	ctx context.Context, auctionId string) ([]BidOutputDTO, *internal_error.InternalError)

func (*BidUseCase) FindWinningBidByAuctionId

func (bu *BidUseCase) FindWinningBidByAuctionId(
	ctx context.Context, auctionId string) (*BidOutputDTO, *internal_error.InternalError)

type BidUseCaseInterface

type BidUseCaseInterface interface {
	CreateBid(
		ctx context.Context,
		bidInputDTO BidInputDTO) (*BidOutputDTO, *internal_error.InternalError)

	FindWinningBidByAuctionId(
		ctx context.Context,
		auctionId string) (*BidOutputDTO, *internal_error.InternalError)

	FindBidByAuctionId(
		ctx context.Context,
		auctionId string) ([]BidOutputDTO, *internal_error.InternalError)
}

func NewBidUseCase

func NewBidUseCase(bidRepository bid_entity.BidRepositoryInterface) BidUseCaseInterface

Jump to

Keyboard shortcuts

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