balance defines methods for handling balances.
| 92 | |
| 93 | // balance defines methods for handling balances. |
| 94 | type balance interface { |
| 95 | CreateBalance(balance model.Balance) (model.Balance, error) // Creates a new balance |
| 96 | GetBalanceByID(id string, include []string, withQueued bool) (*model.Balance, error) // Retrieves a balance by ID with additional data and queued status |
| 97 | GetBalanceByIDLite(id string) (*model.Balance, error) // Retrieves a balance by ID with minimal data |
| 98 | GetBalancesByIDsLite(ctx context.Context, ids []string) (map[string]*model.Balance, error) // Retrieves multiple balances by IDs with minimal data (batch query) |
| 99 | GetAllBalances(limit, offset int) ([]model.Balance, error) // Retrieves all balances (legacy) |
| 100 | UpdateBalance(balance *model.Balance) error // Updates a balance |
| 101 | GetBalanceByIndicator(indicator, currency string) (*model.Balance, error) // Retrieves a balance by indicator and currency |
| 102 | UpdateBalances(ctx context.Context, sourceBalance, destinationBalance *model.Balance) error // Updates multiple balances |
| 103 | GetSourceDestination(sourceId, destinationId string) ([]*model.Balance, error) // Retrieves balances between source and destination |
| 104 | TakeBalanceSnapshots(ctx context.Context, batchSize int) (int, error) // Takes balance snapshots |
| 105 | GetBalanceAtTime(ctx context.Context, balanceID string, targetTime time.Time, fromSource bool) (*model.Balance, error) // Retrieves a balance at a specific time |
| 106 | UpdateBalanceIdentity(balanceID string, identityID string) error // Updates only the identity_id of a balance |
| 107 | |
| 108 | // Advanced filtering methods |
| 109 | GetAllBalancesWithFilter(ctx context.Context, filters *filter.QueryFilterSet, limit, offset int) ([]model.Balance, error) // Retrieves balances with advanced filtering |
| 110 | GetAllBalancesWithFilterAndOptions(ctx context.Context, filters *filter.QueryFilterSet, opts *filter.QueryOptions, limit, offset int) ([]model.Balance, *int64, error) // Retrieves balances with filtering, sorting, and count |
| 111 | } |
| 112 | |
| 113 | // account defines methods for handling accounts. |
| 114 | type account interface { |
no outgoing calls
no test coverage detected