package datastore

import (
	"fmt"
	"log/slog"

	"go.dev.pztrn.name/featurer/server/internal/application"
	"go.dev.pztrn.name/featurer/server/internal/services/core"
)

type datastore struct {
	app *application.Application
}

// Initialize initializes service.
func Initialize(app *application.Application) error {
	plan := &datastore{
		app: app,
	}

	if err := app.RegisterService(plan); err != nil {
		return fmt.Errorf("%w: %w", core.ErrDatastore, err)
	}

	return nil
}

func (p *datastore) ConnectDependencies() error {
	return nil
}

func (p *datastore) GetName() string {
	return core.ServiceNameDatastore
}

func (p *datastore) Initialize() error {
	slog.Info("Initializing data storage...")

	return nil
}

func (p *datastore) LaunchStartupTasks() error {
	return nil
}

func (p *datastore) Shutdown() error {
	return nil
}
