package newsrepository

import (
	"legalgo-BE-go/database"
	newsdomain "legalgo-BE-go/internal/domain/news"
)

type accessor struct {
	db *database.DB
}

type News interface {
	GetAll() ([]newsdomain.News, error)
	GetBySlug(string) (*newsdomain.News, error)
	Create(newsdomain.News) error
	Update(newsdomain.News) error
	Delete(string) error
}

func New(db *database.DB) News {
	return &accessor{db}
}
