niki/domain/wallet/service/service.go

30 lines
679 B
Go

package service
import (
"context"
"git.gocasts.ir/ebhomengo/niki/domain/wallet/entity"
"git.gocasts.ir/ebhomengo/niki/pkg/database/postgres"
)
type Repository interface {
GetTransactionListByUserID(ctx context.Context, UserID uint64, DBPagination postgres.DBPagination) ([]entity.Transaction, int64, error)
GetWalletByUserID(ctx context.Context, UserID uint64) (entity.Wallet, error)
InsertTransaction(ctx context.Context, transaction entity.Transaction) error
}
type Config struct {
PageSize int64 `koanf:"page_size"`
}
type Service struct {
repo Repository
cfg Config
}
func New(repo Repository, cfg Config) Service {
return Service{repo: repo, cfg: cfg}
}