package tenantoverlay

import (
	"log"

	domainschema "github.com/nexuscrm/kernel/pkg/schema"
	schemacatalog "github.com/nexuscrm/kernel/pkg/schemacatalog"
)

// managedTableDefinitions is the tenantoverlay-local fail-fast accessor for the
// substrate table definitions, sourced from the kernel L0 schema catalog SSoT.
// It mirrors the historical bootstrap.GetManagedTableDefinitions wrapper so this
// package reaches the SSoT directly without routing through internal/bootstrap.
func managedTableDefinitions() []domainschema.TableDefinition {
	defs, err := schemacatalog.ManagedTableDefinitions()
	if err != nil {
		log.Fatalf("managed table definitions: %v", err)
	}
	return defs
}
