<?php

declare(strict_types=1);

namespace apexl\Io\modules\payment\Entity;

use apexl\entityCore\traits\HasCasts;
use apexl\Io\includes\Entity;

/**
 * PaymentProviderRef — generic mapping table between consumer-side
 * entity refs and gateway-side refs.
 *
 * Multi-purpose: maps {Subscription, Product, Plan, Invoice, Customer,
 * PaymentMethod} entities to their gateway-side IDs. Lets multi-gateway
 * consumers track "this consumer Plan #5 = stripe_price_xyz123 in our
 * Stripe Connect account / paypal_plan_abc789 in PayPal".
 *
 * @property int         $id
 * @property string      $gateway
 * @property string      $entity_type           consumer-side entity FQN or short ref
 * @property int|string  $entity_id
 * @property string      $gateway_ref
 * @property string|null $kind                  optional sub-type (e.g. 'price', 'product', 'mandate')
 * @property bool        $is_test
 * @property array|null  $meta
 * @property int         $created
 * @property int         $created_by
 * @property int|null    $modified
 * @property int|null    $modified_by
 */
class PaymentProviderRef extends Entity
{
    use HasCasts;

    public final const string TABLE = 'payment_provider_refs';

    public function __construct()
    {
        parent::__construct(static::TABLE);
    }

    public function casts(): array
    {
        return [...parent::casts()];
    }
}
