package bootstrapimpl

import (
	"github.com/pingcap-inc/nexuscrm-contract/pkg/runtimeports"
)

// FieldProvenanceInitializerImpl is the concrete runtimeports.FieldProvenanceInitializer.
// It delegates each method to the canonical bootstrap function of the same name.
// It carries no logic and no state of its own: behavior is byte-for-byte identical
// to calling the bootstrap function directly. None of the wrapped functions take a
// *sql.DB (they read L0 system metadata + internal packspec and mutate the
// fieldprovenance package default), so the struct binds no per-call dependency.
//
// The port interface lives in pkg/serverruntime/runtimeports (a leaf package that
// imports nothing backend-internal). bootstrap is allowed to import runtimeports,
// so the concrete impl is hosted here next to the functions it wraps. The runtime
// composition root (pkg/serverruntime) constructs this and injects it into the
// control-plane consumers, which depend only on the port.
type FieldProvenanceInitializerImpl struct{}

// NewFieldProvenanceInitializerImpl returns a FieldProvenanceInitializerImpl.
// Intended for composition-root wiring.
func NewFieldProvenanceInitializerImpl() FieldProvenanceInitializerImpl {
	return FieldProvenanceInitializerImpl{}
}

// Compile-time assertion that the bootstrap impl satisfies the runtimeports port.
var _ runtimeports.FieldProvenanceInitializer = FieldProvenanceInitializerImpl{}

// DefaultPlatformStandardFields delegates to bootstrap.DefaultPlatformStandardFields.
func (FieldProvenanceInitializerImpl) DefaultPlatformStandardFields() []string {
	return DefaultPlatformStandardFields()
}

// InitFieldProvenance delegates to bootstrap.InitFieldProvenance.
func (FieldProvenanceInitializerImpl) InitFieldProvenance(platformStandardFields []string) error {
	return InitFieldProvenance(platformStandardFields)
}

// InitFieldProvenanceFromStandardObjectSpecs delegates to bootstrap.InitFieldProvenanceFromStandardObjectSpecs.
func (FieldProvenanceInitializerImpl) InitFieldProvenanceFromStandardObjectSpecs(platformStandardFields []string, objectSpecPayloads ...[]byte) error {
	return InitFieldProvenanceFromStandardObjectSpecs(platformStandardFields, objectSpecPayloads...)
}
