mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
19 lines
484 B
Go
19 lines
484 B
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/formancehq/go-libs/v3/bun/bunpaginate"
|
|
"github.com/formancehq/payments/internal/models"
|
|
"github.com/formancehq/payments/internal/storage"
|
|
)
|
|
|
|
func (s *Service) AccountsList(ctx context.Context, query storage.ListAccountsQuery) (*bunpaginate.Cursor[models.Account], error) {
|
|
accounts, err := s.storage.AccountsList(ctx, query)
|
|
if err != nil {
|
|
return nil, newStorageError(err, "cannot list accounts")
|
|
}
|
|
|
|
return accounts, nil
|
|
}
|