package handler

//go:generate mkdir -p mocks
//go:generate rm -rf ./mocks/*_minimock.go
//go:generate minimock -i CacheService,ArticleRepository,TagRepository -o ./mocks/ -s "_minimock.go"

import (
	"context"
	"time"

	"git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/model"
)

type (
	CacheService interface {
		Get(key string) (interface{}, bool)
		Set(key string, value interface{}, expiration *time.Duration)
	}

	ArticleRepository interface {
		GetByURL(ctx context.Context, url string, lang model.LanguageID) (*model.Article, error)
		GetAllPreview(ctx context.Context, lang model.LanguageID) ([]model.ArticlePreview, error)
		GetPreviewByTagID(ctx context.Context, tagID uint64, lang model.LanguageID) ([]model.ArticlePreview, error)
	}

	TagRepository interface {
		GetAllUsed(ctx context.Context, lang model.LanguageID) ([]model.Tag, error)
		GetByURL(ctx context.Context, tag string) (*model.Tag, error)
	}
)
