package composite

import (
	"github.com/nexuscrm/shared/pkg/constants"
	"github.com/nexuscrm/shared/pkg/fieldprovenance"
)

// init installs a minimal field-provenance classifier for tests in this
// package. Cannot import bootstrap due to an existing import cycle
// (composite → metadata → ports → composite), so build the classifier
// inline from the platform standard-field list. This is enough to make
// Name / Id / audit fields classify as managed so Layer 1d does not
// block basic CRUD; fields without manifest declarations still
// classify as discovered via the fallback, which is fine for composite
// tests because they exercise composite-request paths, not the
// classifier itself. Issue #1582 RFC v1.6.
func init() {
	platformStd := []string{
		constants.FieldID,
		constants.FieldName,
		constants.FieldOwnerID,
		constants.FieldCreatedByID,
		constants.FieldLastModifiedByID,
		constants.FieldCreatedDate,
		constants.FieldLastModifiedDate,
		constants.FieldSystemModstamp,
		constants.FieldIsDeleted,
	}
	c := fieldprovenance.BuildClassifier(nil, nil, nil, platformStd)
	fieldprovenance.SetDefault(c)
}
