from odoo import api, fields, models


class ResConfigSettings(models.TransientModel):
    _inherit = 'res.config.settings'

    # === SEO Content Settings ===
    seo_default_blog_id = fields.Many2one(
        'blog.blog',
        string='Default Blog',
        config_parameter='otoolkit_seo_content.default_blog_id',
        help='The default blog where generated content will be published. Users can override this for individual content items.'
    )

    seo_default_image_count = fields.Integer(
        string='Default Image Count',
        config_parameter='otoolkit_seo_content.default_image_count',
        default=1,
        help='Default number of AI-generated images to create per content item. Set to 0 to disable image generation by default.'
    )

    seo_default_image_quality = fields.Selection([
        ('standard', 'Standard'),
        ('hd', 'HD'),
    ], string='Default Image Quality',
        config_parameter='otoolkit_seo_content.default_image_quality',
        default='standard',
        help='Default quality setting for generated images. HD produces sharper images with more detail but consumes more tokens.'
    )

    seo_auto_generate_alt_text = fields.Boolean(
        string='Auto-generate Alt Text',
        config_parameter='otoolkit_seo_content.auto_generate_alt_text',
        default=True,
        help='When enabled, SEO-friendly alt text will be automatically generated for each image based on the content title and context.'
    )

    seo_max_versions = fields.Integer(
        string='Max Version History',
        config_parameter='otoolkit_seo_content.max_versions',
        default=5,
        help='Maximum number of content versions to keep in history. When exceeded, the oldest version is automatically deleted. Set to 0 to disable version history.'
    )
