<?php

namespace App\Entities\Customer\Wallet;

use App\Entities\Customer\CustomerEntity;

abstract class WalletEntity extends CustomerEntity
{
    /**
     * 생성자
     */
    public function __construct(array|null $data = null)
    {
        parent::__construct($data);
        $this->nullableFields = [
            ...$this->nullableFields,
            'clientinfo_uid',
            'content',
        ];
    }

    /*
    |--------------------------------------------------------------------------
    | Getter (절대 attributes 직접 접근하지 않음)
    |--------------------------------------------------------------------------
    */

    final public function getClientInfoUid(): ?int
    {
        return $this->clientinfo_uid;
    }

    final public function getAmount(): int
    {
        return (int) ($this->amount ?? 0);
    }

    final public function getBalance(): int
    {
        return (int) ($this->balance ?? 0);
    }

    final public function getContent(): ?string
    {
        return $this->content;
    }
}