<?php

namespace App\Observers;

use App\Models\Ecommerce\Product\Property\ProductProperty;

class ProductPropertyObserver
{
    /**
     * Handle the ProductProperty "created" event.
     */
    public function created(ProductProperty $productProperty): void
    {
        $productProperty->product->syncPropertiesJson();
    }

    /**
     * Handle the ProductProperty "updated" event.
     */
    public function updated(ProductProperty $productProperty): void
    {
        $productProperty->product->syncPropertiesJson();
    }

    /**
     * Handle the ProductProperty "deleted" event.
     */
    public function deleted(ProductProperty $productProperty): void
    {
        $productProperty->product->syncPropertiesJson();
    }
}
