Files
eway/internal/entity/repository.go
2024-02-04 13:14:56 +03:00

25 lines
670 B
Go

package entity
import "context"
type GoodsItemRepository interface {
ListIter(context.Context, int) (<-chan GoodsItem, error)
List(context.Context) ([]GoodsItem, error)
Get(context.Context, string) (GoodsItem, error)
GetByCart(context.Context, int64) (GoodsItem, error)
UpsertMany(context.Context, ...GoodsItem) ([]GoodsItem, error)
Delete(context.Context, string) (GoodsItem, error)
}
type CategoryRepository interface {
List(context.Context) ([]Category, error)
Get(context.Context, int64) (Category, error)
Create(ctx context.Context, name string) (Category, error)
}
type Mapper interface {
CategoryNameToID(context.Context, string) (int64, error)
}