package packs

import (
	"log"

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

// managedTableDefinitions is the packs-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
}

// systemTableDefinitions is the packs-local fail-fast accessor for the system
// table definitions, sourced from the kernel L0 schema catalog SSoT. It mirrors
// the historical bootstrap.GetSystemTableDefinitions wrapper.
func systemTableDefinitions() []domainschema.TableDefinition {
	defs, err := schemacatalog.SystemTableDefinitions()
	if err != nil {
		log.Fatalf("system table definitions: %v", err)
	}
	return defs
}
