linting
This commit is contained in:
@@ -68,6 +68,7 @@ func (p *Payments) FindByIdempotencyKey(ctx context.Context, key string) (*model
|
||||
var result model.PaymentRecord
|
||||
err := p.repo.FindOneByFilter(ctx, repository.Filter(fieldIdempotencyKey, key), &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
@@ -87,6 +88,7 @@ func (p *Payments) FindByOperationRef(ctx context.Context, key string) (*model.P
|
||||
var result model.PaymentRecord
|
||||
err := p.repo.FindOneByFilter(ctx, repository.Filter(fieldOperationRef, key), &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
@@ -114,6 +114,7 @@ func (p *PendingConfirmations) FindByRequestID(ctx context.Context, requestID st
|
||||
var result model.PendingConfirmation
|
||||
err := p.repo.FindOneByFilter(ctx, repository.Filter(fieldPendingRequestID, requestID), &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
@@ -130,6 +131,7 @@ func (p *PendingConfirmations) FindByMessageID(ctx context.Context, messageID st
|
||||
var result model.PendingConfirmation
|
||||
err := p.repo.FindOneByFilter(ctx, repository.Filter(fieldPendingMessageID, messageID), &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
@@ -165,6 +165,7 @@ func (t *TreasuryRequests) FindByRequestID(ctx context.Context, requestID string
|
||||
err := t.repo.FindOneByFilter(ctx, repository.Filter(fieldTreasuryRequestID, requestID), &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
t.logger.Debug("Treasury request not found", zap.String("request_id", requestID))
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
@@ -190,6 +191,7 @@ func (t *TreasuryRequests) FindActiveByLedgerAccountID(ctx context.Context, ledg
|
||||
err := t.repo.FindOneByFilter(ctx, query, &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
t.logger.Debug("Active treasury request not found", zap.String("ledger_account_id", ledgerAccountID))
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
@@ -57,6 +57,7 @@ func (t *TreasuryTelegramUsers) FindByTelegramUserID(ctx context.Context, telegr
|
||||
var result model.TreasuryTelegramUser
|
||||
err := t.repo.FindOneByFilter(ctx, repository.Filter(fieldTreasuryTelegramUserID, telegramUserID), &result)
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
//nolint:nilnil // Not-found is represented as (nil, nil) by this store contract.
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
@@ -79,6 +80,7 @@ func (t *TreasuryTelegramUsers) FindByTelegramUserID(ctx context.Context, telegr
|
||||
result.AllowedChatIDs = normalized
|
||||
}
|
||||
if result.TelegramUserID == "" || result.LedgerAccountID == "" {
|
||||
//nolint:nilnil // Invalid/incomplete records are treated as missing binding.
|
||||
return nil, nil
|
||||
}
|
||||
return &result, nil
|
||||
|
||||
Reference in New Issue
Block a user