<?php
declare(strict_types=1);

use BaserCore\Database\Migration\BcSeed;

/**
 * MailFields seed.
 */
class MailFieldsSeed extends BcSeed
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeds is available here:
     * https://book.cakephp.org/phinx/0/en/seeding.html
     *
     * @return void
     */
    public function run(): void
    {
        $data = [
            [
                'id' => 1,
                'mail_content_id' => 1,
                'no' => 1,
                'name' => '姓',
                'field_name' => 'name_1',
                'type' => 'text',
                'head' => 'お名前',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 255,
                'options' => 'placeholder|姓',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'name',
                'group_valid' => 'name',
                'valid' => 'VALID_NOT_EMPTY',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 1,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 1,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 2,
                'mail_content_id' => 1,
                'no' => 2,
                'name' => '名',
                'field_name' => 'name_2',
                'type' => 'text',
                'head' => 'お名前',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 255,
                'options' => 'placeholder|名',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'name',
                'group_valid' => 'name',
                'valid' => 'VALID_NOT_EMPTY',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 1,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 2,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 5,
                'mail_content_id' => 1,
                'no' => 5,
                'name' => '性別',
                'field_name' => 'sex',
                'type' => 'radio',
                'head' => '性別',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '男性|女性',
                'size' => 0,
                'text_rows' => 0,
                'maxlength' => NULL,
                'options' => '',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => '',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 5,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 6,
                'mail_content_id' => 1,
                'no' => 7,
                'name' => 'メールアドレス',
                'field_name' => 'email_1',
                'type' => 'email',
                'head' => 'メールアドレス',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 50,
                'options' => '',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'email',
                'group_valid' => 'email',
                'valid' => 'VALID_EMAIL',
                'valid_ex' => 'VALID_EMAIL_CONFIRM',
                'auto_convert' => '',
                'not_empty' => 1,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 6,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 7,
                'mail_content_id' => 1,
                'no' => 8,
                'name' => 'メールアドレス確認',
                'field_name' => 'email_2',
                'type' => 'text',
                'head' => 'メールアドレス（確認）',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 50,
                'options' => 'placeholder|確認のためもう一度入力して下さい',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'email',
                'group_valid' => 'email',
                'valid' => 'VALID_EMAIL',
                'valid_ex' => 'VALID_EMAIL_CONFIRM',
                'auto_convert' => '',
                'not_empty' => 1,
                'use_field' => 1,
                'no_send' => 1,
                'sort' => 7,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 8,
                'mail_content_id' => 1,
                'no' => 9,
                'name' => '電話番号',
                'field_name' => 'tel',
                'type' => 'text',
                'head' => '電話番号',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 11,
                'options' => 'placeholder|ハイフン抜きで入力して下さい',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => '',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => 'CONVERT_HANKAKU',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 8,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 11,
                'mail_content_id' => 1,
                'no' => 12,
                'name' => '郵便番号',
                'field_name' => 'zip',
                'type' => 'autozip',
                'head' => '住所',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => 'address_1
address_2',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 8,
                'options' => 'placeholder|〒 郵便番号をハイフン抜きで入力してください',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'address',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => 'CONVERT_HANKAKU',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 11,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 12,
                'mail_content_id' => 1,
                'no' => 13,
                'name' => '都道府県',
                'field_name' => 'address_1',
                'type' => 'pref',
                'head' => '住所',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => NULL,
                'options' => '',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'address',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 12,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 13,
                'mail_content_id' => 1,
                'no' => 14,
                'name' => '市区町村・番地',
                'field_name' => 'address_2',
                'type' => 'text',
                'head' => '住所',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 200,
                'options' => 'placeholder|市区町村・番地',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'address',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 13,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 14,
                'mail_content_id' => 1,
                'no' => 15,
                'name' => '建物名',
                'field_name' => 'address_3',
                'type' => 'text',
                'head' => '住所',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => NULL,
                'text_rows' => NULL,
                'maxlength' => 200,
                'options' => 'placeholder|建物名',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'address',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 14,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 15,
                'mail_content_id' => 1,
                'no' => 16,
                'name' => 'お問い合わせ項目',
                'field_name' => 'category',
                'type' => 'multi_check',
                'head' => 'お問い合わせ項目',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '資料請求|問い合わせ|その他',
                'size' => 0,
                'text_rows' => 0,
                'maxlength' => NULL,
                'options' => '',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => '',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => 'VALID_NOT_UNCHECKED',
                'auto_convert' => '',
                'not_empty' => 1,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 15,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 16,
                'mail_content_id' => 1,
                'no' => 17,
                'name' => 'お問い合わせ内容',
                'field_name' => 'message',
                'type' => 'textarea',
                'head' => 'お問い合わせ内容',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '',
                'source' => '',
                'size' => 48,
                'text_rows' => 12,
                'maxlength' => NULL,
                'options' => '',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => '',
                'group_valid' => '',
                'valid' => '',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 0,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 16,
                'created' => NULL,
                'modified' => NULL,
            ],
            [
                'id' => 17,
                'mail_content_id' => 1,
                'no' => 18,
                'name' => 'ルート',
                'field_name' => 'root',
                'type' => 'select',
                'head' => 'どうやってこのサイトをお知りになりましたか？',
                'attention' => '',
                'before_attachment' => '',
                'after_attachment' => '<br>',
                'source' => '検索エンジン|web広告|紙面広告|求人案内|その他',
                'size' => 0,
                'text_rows' => 0,
                'maxlength' => NULL,
                'options' => '',
                'class' => '',
                'default_value' => '',
                'description' => '',
                'group_field' => 'root',
                'group_valid' => '',
                'valid' => 'VALID_NOT_EMPTY',
                'valid_ex' => '',
                'auto_convert' => '',
                'not_empty' => 1,
                'use_field' => 1,
                'no_send' => 0,
                'sort' => 17,
                'created' => NULL,
                'modified' => NULL,
            ],
        ];

        $table = $this->table('mail_fields');
        $table->insert($data)->save();
    }
}
