<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

use JsonSerializable;
use OCP\AppFramework\Db\Entity;

/**
 * Family entity mapping all columns from oc_mv_families.
 *
 * @method string getName()
 * @method void setName(string $name)
 * @method string|null getKontoinhaberEncrypted()
 * @method void setKontoinhaberEncrypted(?string $kontoinhaberEncrypted)
 * @method string|null getIbanEncrypted()
 * @method void setIbanEncrypted(?string $ibanEncrypted)
 * @method string|null getBic()
 * @method void setBic(?string $bic)
 * @method string|null getKreditinstitut()
 * @method void setKreditinstitut(?string $kreditinstitut)
 * @method string getCreatedAt()
 * @method void setCreatedAt(string $createdAt)
 * @method string getUpdatedAt()
 * @method void setUpdatedAt(string $updatedAt)
 */
class Family extends Entity implements JsonSerializable {

    protected string $name = '';
    protected ?string $kontoinhaberEncrypted = null;
    protected ?string $ibanEncrypted = null;
    protected ?string $bic = null;
    protected ?string $kreditinstitut = null;
    protected string $createdAt = '';
    protected string $updatedAt = '';

    public function __construct() {
        $this->addType('id', 'integer');
    }

    public function jsonSerialize(): array {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'kontoinhaberEncrypted' => $this->kontoinhaberEncrypted,
            'ibanEncrypted' => $this->ibanEncrypted,
            'bic' => $this->bic,
            'kreditinstitut' => $this->kreditinstitut,
            'createdAt' => $this->createdAt,
            'updatedAt' => $this->updatedAt,
        ];
    }
}
