<?php

namespace Storeplugin\PDFInvoice\Framework\Contracts;

defined('ABSPATH') || exit;

/**
 * Term Meta Builder Interface
 *
 * Defines the public API for creating and configuring custom fields for taxonomy terms.
 * Internal WordPress registration and callback methods are marked with @internal in
 * the implementing class.
 *
 * @package Storeplugin\PDFInvoice\Framework\Contracts
 */
interface TermInterface
{
    /**
     * Create a new term meta instance
     *
     * @param string       $id         Unique identifier for this term meta group
     * @param string|array $taxonomies Taxonomies to show the fields on
     * @param string       $optionKey  Prefix for form field names
     *
     * @return self
     */
    public static function create($id, $taxonomies, string $optionKey): self;

    /**
     * Add a section of fields
     *
     * @param string $title  Section title
     * @param array  $fields Array of field definitions
     *
     * @return self
     */
    public function addSection($title, $fields): self;

    /**
     * Register and initialize the term meta fields
     *
     * @return void
     */
    public function render(): void;
}
