<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * WHMCS hook compatibility shim.
 *
 * This model exists ONLY so that WHMCS-style "Contact*" action hooks
 * (ContactAdd / ContactEdit / ContactDelete) have an Eloquent surface to
 * observe (see {@see \App\Observers\ContactObserver} and
 * {@see \App\Core\Hook\HookBridge::buildContactContext()}).
 *
 * It is NOT the authorized-user system.
 *
 *   - The `client_contacts` table has NO `client_id` column and therefore
 *     cannot belong to a {@see Client}. Do not add a relation here without
 *     also migrating the schema.
 *   - No production code writes to this table. Records exist only via
 *     seeders/factories used by hook lifecycle tests.
 *   - For real "authorized accounts / sub-users" on a client, use
 *     {@see ClientAuthorization} and
 *     {@see ClientAuthorizationInvitation} instead.
 *
 * If you are building a feature that needs WHMCS-like "contacts" on a
 * client, first decide whether it should be:
 *   (a) a new contact role on top of {@see ClientAuthorization}, or
 *   (b) a schema migration that adds `client_id` here and wires up a
 *       proper `Client::contacts()` relation.
 * Do not mix the two.
 *
 * @property int $id
 * @property string $name
 * @property string $surname
 * @property string $email
 * @property string $password
 * @property string $status
 * @property string|null $permissions
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 *
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ClientContact newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ClientContact newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ClientContact query()
 *
 * @mixin \Eloquent
 */
class ClientContact extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'surname',
        'email',
        'password',
        'status',
        'permissions',
    ];
}
