Files
hfb_sys/backend/internal/modules/wallet/service.go
T

28 lines
539 B
Go

package wallet
import "errors"
var ErrDependencyUnavailable = errors.New("dependency unavailable")
type Service struct {
repo *Repository
}
func NewService(repo *Repository) *Service {
return &Service{repo: repo}
}
func (s *Service) Account(userID uint64) (*AccountDTO, error) {
if s.repo == nil {
return nil, ErrDependencyUnavailable
}
return s.repo.Account(userID)
}
func (s *Service) Ledger(userID uint64) ([]LedgerDTO, error) {
if s.repo == nil {
return nil, ErrDependencyUnavailable
}
return s.repo.Ledger(userID)
}