<?php

namespace App\Modules\Integrations\Platform\Models;

use App\Modules\Admin\Tenancy\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;

class IntegrationWebhook extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'tenant_id',
        'name',
        'url',
        'secret_enc',
        'topics',
        'is_active',
        'health_status',
        'last_success_at',
        'last_failure_at',
        'failure_count',
    ];

    protected $casts = [
        'topics' => 'array',
        'is_active' => 'boolean',
        'last_success_at' => 'datetime',
        'last_failure_at' => 'datetime',
    ];
}

