usecase

package
v0.0.0-...-b784633 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cart

type Cart struct {
	Details []CartDetail `json:"details"`
}

type CartDetail

type CartDetail struct {
	ProductID string `json:"productId"`
	Quantity  int    `json:"quantity"`
}

type CartInfo

type CartInfo struct {
	TotalPrice int              `json:"totalPrice"`
	Details    []CartInfoDetail `json:"details"`
}

type CartInfoDetail

type CartInfoDetail struct {
	SubTotal  int    `json:"subTotal"`
	ProductID string `json:"productId"`
	Quantity  int    `json:"quantity"`
}

type Transaction

type Transaction struct {
	ID         string              `json:"id"`
	UserID     string              `json:"userId"`
	Details    []TransactionDetail `json:"details"`
	TotalPrice int64               `json:"totalPrice"`
	CreatedAt  time.Time           `json:"createdAt"`
	UpdatedAt  time.Time           `json:"updatedAt"`
}

type TransactionCartGetter

type TransactionCartGetter interface {
	GetCart(ctx context.Context, userId string) (CartInfo, error)
}

type TransactionCartUpdater

type TransactionCartUpdater interface {
	UpdateCart(ctx context.Context, userId string, cart Cart) error
}

type TransactionCreator

type TransactionCreator interface {
	Create(ctx context.Context, userId string) error
}

type TransactionDetail

type TransactionDetail struct {
	ID        string `json:"id"`
	ProductID string `json:"productId"`
	Price     int64  `json:"price"`
	Quantity  int    `json:"quantity"`
}

type TransactionList

type TransactionList struct {
	Count  int           `json:"count"`
	Limit  int           `json:"limit"`
	Offset int           `json:"offset"`
	Data   []Transaction `json:"data"`
}

type TransactionLister

type TransactionLister interface {
	List(ctx context.Context, userId string, limit, offset int) (TransactionList, error)
}

Directories

Path Synopsis
Package usecasemock is a generated GoMock package.
Package usecasemock is a generated GoMock package.

Jump to

Keyboard shortcuts

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