// Package health provides health check implementations for various components.
package health

import (
	"context"

	"git.dcentral.systems/toolz/goplt/internal/infra/database"
	"git.dcentral.systems/toolz/goplt/pkg/health"
)

// DatabaseChecker implements health checks for the database.
type DatabaseChecker struct {
	client *database.Client
}

// NewDatabaseChecker creates a new database health checker.
func NewDatabaseChecker(client *database.Client) health.HealthChecker {
	return &DatabaseChecker{
		client: client,
	}
}

// Check performs a database health check.
func (d *DatabaseChecker) Check(ctx context.Context) error {
	return d.client.Ping(ctx)
}
