package repositories

import (
	"context"

	"gitea.d3m0k1d.ru/d3m0k1d/d3m0k1d.ru/backend/internal/storage"
)

type PostRepository interface {
	GetAll(ctx context.Context) ([]storage.PostReq, error)
	GetAllAdmin(ctx context.Context) ([]storage.PostReq, error)
	GetByID(ctx context.Context, id int) (storage.PostReq, error)
	GetLastID(ctx context.Context) (int, error)
	IsExist(ctx context.Context, id int) bool
	Create(ctx context.Context, post storage.Post) error
	Update(ctx context.Context, id int, post storage.Post) error
	Delete(ctx context.Context, id int) error
}

type AuthRepository interface {
	Register(ctx context.Context, user storage.UserReg) (int, error)
	IsRegistered(ctx context.Context, github_id int) (bool, error)
	GetUserByGithubID(ctx context.Context, githubID int) (*storage.User, error)
}

type CommentRepository interface {
	CreateComment(ctx context.Context, comment *storage.CommentCreate) error
	GetAllComments(ctx context.Context) ([]storage.Comment, error)
	GetCommentsOfPost(ctx context.Context, id int) ([]storage.Comment, error)
	DeleteComment(ctx context.Context, id int) error
	UpdateComment(ctx context.Context, id int, comment *storage.Comment) error
}
