package repository

import (
	"git.kirlllll.ru/volontery/backend/internal/database"
	"github.com/jackc/pgx/v5/pgxpool"
)

// Repository содержит все репозитории приложения
type Repository struct {
	User    *UserRepository
	Auth    *AuthRepository
	Request *RequestRepository
	RBAC    *RBACRepository
}

// New создает новый экземпляр Repository
func New(pool *pgxpool.Pool) *Repository {
	queries := database.New(pool)

	return &Repository{
		User:    NewUserRepository(queries),
		Auth:    NewAuthRepository(queries),
		Request: NewRequestRepository(queries),
		RBAC:    NewRBACRepository(queries),
	}
}
