<?php

namespace Shm\ShmPayment\TBankPayment\TBankCollections;

use Shm\Collection\Collection;
use Shm\Shm;
use Shm\ShmTypes\StructureType;
use Shm\ShmUtils\MaterialIcons;

class TNominalBankDetails extends Collection
{

    public function schema(): StructureType
    {
        $schema = Shm::structure([
            "beneficiary" => TNominalBeneficiaries::ID()->title("Юридическое лицо")->inAdmin()->editable()->inTable()->display(),
            "type" => Shm::static("PAYMENT_DETAILS")->title("Тип")->inAdmin()->editable()->inTable()->display(),
            "isDefault" => Shm::boolean()->title("Основной")->inAdmin()->editable()->inTable()->display(),
            "bik" => Shm::string()->title("БИК")->inAdmin()->editable()->inTable()->display(),
            "kpp" => Shm::string()->title("КПП")->inAdmin()->editable()->inTable()->display(),
            "inn" => Shm::string()->title("ИНН")->inAdmin()->editable()->inTable()->display(),
            "name" => Shm::string()->title("ФИО получателя ИП или Юр.лицо")->inAdmin()->editable()->inTable()->display(),
            "bankName" => Shm::string()->title("Наименование банка")->inAdmin()->editable()->inTable()->display(),
            "accountNumber" => Shm::string()->title("Номер счета")->inAdmin()->editable()->inTable()->display(),
            "corrAccountNumber" => Shm::string()->title("Корреспондентский счет")->inAdmin()->editable()->inTable()->display(),
        ])->inAdmin();

        $schema->title("Банковские реквизиты");
        $schema->canCreate()->canUpdate()->canDelete();
        $schema->icon(MaterialIcons::Bookmark());

        return $schema;
    }
}