package packs

import (
	"database/sql"

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

// ReconcilePackAccessPolicies reconciles managed access policies using the
// provided table definitions instead of the substrate definitions. This is used
// by packs whose object table defs are not in the substrate (system_tables.json).
//
// Carved out of internal/bootstrap/schema.go in wave5 s5d (behavior-identical).
// The reconcile body and its private helpers stay in bootstrap (co-resident with
// the schema-package SharingModel/HierarchySharing primitives); this pack entry
// point reaches them through the
// schemaProvisioner.ReconcileManagedStandardObjectAccessPoliciesWithDefs port
// method.
func ReconcilePackAccessPolicies(rawDB *sql.DB, tableDefs []domainschema.TableDefinition) error {
	return schemaProvisioner.ReconcileManagedStandardObjectAccessPoliciesWithDefs(rawDB, tableDefs)
}
