<?php

namespace App\Modules\Integrations\Platform\Models;

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

class IntegrationEvent extends Model
{
    use BelongsToTenant;

    public $incrementing = false;

    protected $keyType = 'string';

    public $timestamps = false;

    protected $fillable = [
        'id',
        'tenant_id',
        'name',
        'version',
        'payload',
        'payload_hash',
        'occurred_at',
        'dispatched_at',
        'created_at',
    ];

    protected $casts = [
        'payload' => 'array',
        'occurred_at' => 'datetime',
        'dispatched_at' => 'datetime',
        'created_at' => 'datetime',
    ];
}

