MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / validateBalanceTimeParams

Function validateBalanceTimeParams

database/balance.go:1415–1425  ·  view source on GitHub ↗

validateBalanceTimeParams validates the input parameters for GetBalanceAtTime

(balanceID string, targetTime time.Time)

Source from the content-addressed store, hash-verified

1413
1414// validateBalanceTimeParams validates the input parameters for GetBalanceAtTime
1415func validateBalanceTimeParams(balanceID string, targetTime time.Time) error {
1416 if balanceID == "" {
1417 return apierror.NewAPIError(apierror.ErrBadRequest, "Balance ID cannot be empty", nil)
1418 }
1419
1420 if targetTime.IsZero() {
1421 return apierror.NewAPIError(apierror.ErrBadRequest, "Target time cannot be zero", nil)
1422 }
1423
1424 return nil
1425}
1426
1427// getBalanceInfo retrieves basic information about a balance
1428func (d Datasource) getBalanceInfo(ctx context.Context, tx *sql.Tx, balanceID string) (currency string, createdAt time.Time, err error) {

Callers 1

GetBalanceAtTimeMethod · 0.85

Calls 1

NewAPIErrorFunction · 0.92

Tested by

no test coverage detected