fix: remove linter that dosn't allow add todo on the top of the func

This commit is contained in:
skeris 2023-11-25 14:23:19 +03:00
parent 0a232e505d
commit 66fd4545a7
4 changed files with 7 additions and 10 deletions

@ -44,7 +44,7 @@ linters:
- revive
- rowserrcheck
- staticcheck
- stylecheck
# - stylecheck
- thelper
- typecheck
- unconvert

@ -71,7 +71,7 @@ func (receiver *Controller) GetHistoryList(ctx echo.Context, params swagger.GetH
return ctx.JSON(http.StatusOK, histories)
}
// TODO:tests
// TODO:tests.
func (receiver *Controller) GetRecentTariffs(ctx echo.Context) error {
userID, ok := ctx.Get(models.AuthJWTDecodedUserIDKey).(string)
if !ok {

@ -3,9 +3,7 @@ package repository
import (
"context"
"fmt"
"go.mongodb.org/mongo-driver/bson"
"log"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
@ -14,6 +12,7 @@ import (
"go.uber.org/zap"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/dto"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
mongoWrapper "penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/mongo"
)
@ -111,9 +110,8 @@ func (receiver *HistoryRepository) CountAll(ctx context.Context, dto *dto.GetHis
}
// TODO:tests
// GetRecentTariffs method for processing a user request with data aggregation with a limit of 100 sorted in descending order
// GetRecentTariffs method for processing a user request with data aggregation with a limit of 100 sorted in descending order.
func (receiver *HistoryRepository) GetRecentTariffs(ctx context.Context, userID string) ([]models.TariffID, errors.Error) {
matchStage := bson.D{
{Key: "$match", Value: bson.D{
{Key: fields.History.UserID, Value: userID},

@ -92,9 +92,8 @@ func (receiver *Service) CreateHistory(ctx context.Context, history *models.Hist
return createdHistory, nil
}
// TODO:tests
// TODO:tests.
func (receiver *Service) GetRecentTariffs(ctx context.Context, userID string) ([]models.TariffID, errors.Error) {
if userID == "" {
receiver.logger.Error("user id is missing in <GetRecentTariffs> of <HistoryService>")
return nil, errors.New(