<?php

declare(strict_types=1);

namespace Apexl\Tests\Core\Infrastructure;

use apexl\Io\includes\Entity;

/**
 * An entity whose primary key is a natural one — chosen by the caller, never
 * generated by the database (the shape `refresh_tokens` had when its PK was
 * `user_id`).
 *
 * @property int $user_key
 * @property string $token
 */
final class NaturalKeyTestEntity extends Entity
{
    public const string PRIMARY_KEY = 'user_key';

    public static ?string $tableName = null;

    public function __construct()
    {
        parent::__construct(self::$tableName, self::PRIMARY_KEY);
    }

    public static function primaryKey(): string
    {
        return self::PRIMARY_KEY;
    }
}
