<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    protected $fillable = [
        'tenant_id', 'name', 'price', 'sale_price',
        'description', 'images', 'stock', 'low_stock_threshold',
        'category', 'variants', 'is_active',
        'nameBangla', 'highlight', 'image', 'sizes',
        'priceConfigs', 'usage', 'features', 'isFeatured',
        'landingTitle', 'landingSubtitle', 'landingUsageTitle', 'packageSectionImage',
        'faqs', 'qualityStandards', 'usageTips', 'landingProductImage',
        'landingPackageImages', 'landingTestimonialImages', 'gallery',
        'landingProblemTitle', 'landingProblems', 'landingSolutionName',
        'landingSolutionDesc', 'landingSolutionBenefits', 'landingSolutionImage',
        'landingBenefitsTitle', 'landingBenefitsSubtitle', 'landingWhyChooseUs',
        'landingAuthorityTitle', 'landingAuthorityPoints', 'landingGuaranteeTitle',
        'landingGuaranteeText', 'landingProcessSteps', 'landingCtaTitle',
        'landingCtaSubtitle', 'landingTheme', 'freeDeliveryEnabled',
        'variant_stock', 'landingOfferTitle', 'landingOfferBadge',
        'landingReviewsTitle', 'landingReviewsSubtitle', 'landingTrustTitle',
        'landingTrustElements', 'videoTestimonialUrl', 'videoTestimonialTitle',
        'comparisonImage1', 'comparisonLabel1', 'comparisonImage2',
        'comparisonLabel2', 'marketingCoupons'
    ];

    protected $casts = [
        'images'   => 'array',
        'variants' => 'array',
        'is_active' => 'boolean',
        'sizes' => 'array',
        'priceConfigs' => 'array',
        'usage' => 'array',
        'features' => 'array',
        'isFeatured' => 'boolean',
        'faqs' => 'array',
        'qualityStandards' => 'array',
        'usageTips' => 'array',
        'landingPackageImages' => 'array',
        'landingTestimonialImages' => 'array',
        'gallery' => 'array',
        'landingProblems' => 'array',
        'landingSolutionBenefits' => 'array',
        'landingWhyChooseUs' => 'array',
        'landingAuthorityPoints' => 'array',
        'landingProcessSteps' => 'array',
        'freeDeliveryEnabled' => 'boolean',
        'variant_stock' => 'array',
        'landingTrustElements' => 'array',
        'marketingCoupons' => 'array'
    ];

    public function tenant()
    {
        return $this->belongsTo(Tenant::class);
    }
}
