<?php

return [
  'data' => [
    [
      "is_generate" => false,
      "model" => "User",
      "table_name" => "users",
      "migration" => "2014_10_12_000000_create_users_table",
      "label" => "Pengguna",
      "icon" => "fas fa-users",
      "columns" => [
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'username' => ['label' => 'Username', 'isSearchable' => true],
        'email' => ['label' => 'Email', 'isSearchable' => true],
        'role' => ['label' => 'Peran'],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'name' => 'required|string',
        'username' => 'nullable|string',
        'phone' => 'nullable|string',
        'email' => 'required|string|unique:users,email',
        'password' => 'nullable|string',
        'role' => 'required|string',
        'picture' => 'nullable|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'role' => "\App\Enums\UserType::User",
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'username', 'label' => 'Username', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'email', 'label' => 'Email', 'type' => 'email']],
          ['form' => 'input', 'props' => ['name' => 'phone', 'label' => 'Telepon', 'type' => 'text']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'role', 'label' => 'Peran', 'options' => 'props.roles']],
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'password', 'label' => 'Password', 'type' => 'password']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'picture', 'label' => 'Foto']],
        ],
      ],
    ],
    [
      "is_generate" => false,
      "model" => "Configuration",
      "table_name" => "configurations",
      "migration" => "2023_08_04_081335_create_configurations_table",
      "label" => "Konfigurasi",
      "icon" => "fas fa-cogs",
      "columns" => [
        'type' => ['label' => 'Tipe', 'isSearchable' => true],
        'status' => ['label' => 'Status'],
        'description' => ['label' => 'Deskripsi'],
      ],
      "validations" => [
        'type' => 'required|string',
        'value' => 'nullable|string',
        'status' => 'required|string',
        'description' => 'nullable|string',
      ],
      "defaults" => [
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'type', 'label' => 'Tipe', 'type' => 'text']],
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'value', 'label' => 'Nilai']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'description', 'label' => 'Deskripsi']],
        ],
      ],
    ],
    [
      "model" => "Department",
      "table_name" => "departments",
      "migration" => "2026_01_20_145911_create_departments_table",
      "label" => "Departemen",
      "icon" => "fas fa-building",
      "options_source" => [
        'users' => 'App\Models\User',
      ],
      "columns" => [
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'status' => ['label' => 'Status'],
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'name' => 'required|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
        ],
      ],
    ],
    [
      "model" => "Bank",
      "table_name" => "banks",
      "migration" => "2026_01_20_145912_create_banks_table",
      "label" => "Bank",
      "icon" => "fas fa-university",
      "columns" => [
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'code' => 'required|string',
        'name' => 'required|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
      ],
    ],
    [
      "model" => "Vendor",
      "table_name" => "vendors",
      "migration" => "2026_01_20_145913_create_vendors_table",
      "label" => "Vendor",
      "icon" => "fas fa-store",
      "columns" => [
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'company_name' => ['label' => 'Nama Perusahaan', 'isSearchable' => true],
        'phone' => ['label' => 'Telepon'],
        'city' => ['label' => 'Kota'],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'name' => 'required|string',
        'company_name' => 'required|string',
        'phone' => 'required|string',
        'address' => 'required|string',
        'city' => 'required|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'company_name', 'label' => 'Nama Perusahaan', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'phone', 'label' => 'Telepon', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'city', 'label' => 'Kota', 'type' => 'text']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'address', 'label' => 'Alamat']],
        ],
      ],
    ],
    [
      "model" => "Category",
      "table_name" => "categories",
      "migration" => "2026_01_20_145914_create_categories_table",
      "label" => "Kategori",
      "icon" => "fas fa-tags",
      "columns" => [
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'period_type' => ['label' => 'Tipe Periode'],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'name' => 'required|string',
        'period_type' => 'required|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'period_type' => "\App\Enums\PeriodType::Monthly",
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'period_type', 'label' => 'Tipe Periode', 'type' => 'text']],
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
      ],
    ],
    [
      "model" => "Company",
      "table_name" => "companies",
      "migration" => "2026_01_20_145914_create_companies_table",
      "label" => "Perusahaan",
      "icon" => "fas fa-briefcase",
      "columns" => [
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'code' => 'required|string',
        'name' => 'required|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
      ],
    ],
    [
      "is_react_page" => false,
      "model" => "UserDepartment",
      "table_name" => "user_departments",
      "migration" => "2026_01_20_145929_create_user_departments_table",
      "label" => "Departemen Pengguna",
      "icon" => "fas fa-users-cog",
      "options_source" => [
        'users' => 'App\Models\User',
        'departments' => 'App\Models\Department',
      ],
      "columns" => [
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
        'department_id' => [
          'label' => 'Departemen',
          'value' => 'department.name',
          'isSearchable' => true,
        ],
        'type' => ['label' => 'Tipe'],
        'is_finance' => ['label' => 'Keuangan'],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'department_id' => 'required|integer|exists:departments,id',
        'type' => 'required|string',
        'is_finance' => 'required|boolean',
      ],
      "defaults" => [
        'type' => "\App\Enums\UserDepartmentType::User",
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'department_id',
              'label' => 'Departemen',
              'options' => 'props.departments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("department_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'type', 'label' => 'Tipe', 'type' => 'text']],
          ['form' => 'checkbox', 'props' => ['name' => 'is_finance', 'label' => 'Keuangan']],
        ],
      ],
    ],
    [
      "is_react_page" => false,
      "model" => "UserBank",
      "table_name" => "user_banks",
      "migration" => "2026_01_20_145930_create_user_banks_table",
      "label" => "Bank Pengguna",
      "icon" => "fas fa-money-check-alt",
      "options_source" => [
        'users' => 'App\Models\User',
        'banks' => 'App\Models\Bank',
      ],
      "columns" => [
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
        'bank_id' => [
          'label' => 'Bank',
          'value' => 'bank.name',
          'isSearchable' => true,
        ],
        'account_number' => ['label' => 'No. Rekening'],
        'account_name' => ['label' => 'Nama Rekening'],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'bank_id' => 'required|integer|exists:banks,id',
        'account_number' => 'required|integer',
        'account_name' => 'required|string',
        'status' => 'required|string',
      ],
      "defaults" => [
        'status' => "\App\Enums\OriginStatusType::Active",
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'bank_id',
              'label' => 'Bank',
              'options' => 'props.banks',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("bank_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'account_number', 'label' => 'No. Rekening', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'account_name', 'label' => 'Nama Rekening', 'type' => 'text']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
      ],
    ],
    [
      "is_react_page" => false,
      "model" => "UserCompany",
      "table_name" => "user_companies",
      "migration" => "2026_01_20_145930_create_user_companies_table",
      "label" => "Perusahaan Pengguna",
      "icon" => "fas fa-building-user",
      "options_source" => [
        'users' => 'App\Models\User',
        'companies' => 'App\Models\Company',
      ],
      "columns" => [
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
        'company_id' => [
          'label' => 'Perusahaan',
          'value' => 'company.name',
          'isSearchable' => true,
        ],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'company_id' => 'required|integer|exists:companies,id',
      ],
      "defaults" => [],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'company_id',
              'label' => 'Perusahaan',
              'options' => 'props.companies',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("company_id", e?.value)',
            ]
          ],
        ],
      ],
    ],
    [
      "is_react_page" => false,
      "model" => "UserOwner",
      "table_name" => "user_owners",
      "migration" => "2026_01_20_145931_create_user_owners_table",
      "label" => "Pemilik Pengguna",
      "icon" => "fas fa-user-tie",
      "options_source" => [
        'users' => 'App\Models\User',
        'owners' => 'App\Models\User', // Mapped to User model for owner
      ],
      "columns" => [
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
        'owner_id' => [
          'label' => 'Pemilik',
          'value' => 'owner.name',
          'isSearchable' => true,
        ],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'owner_id' => 'required|integer|exists:users,id', // owner is user
      ],
      "defaults" => [],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'owner_id',
              'label' => 'Pemilik',
              'options' => 'props.owners',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("owner_id", e?.value)',
            ]
          ],
        ],
      ],
    ],
    [
      "is_react_page" => false,
      "model" => "UserCategory",
      "table_name" => "user_categories",
      "migration" => "2026_01_20_145932_create_user_categories_table",
      "label" => "Kategori Pengguna",
      "icon" => "fas fa-tag",
      "options_source" => [
        'users' => 'App\Models\User',
        'categories' => 'App\Models\Category',
        'departments' => 'App\Models\Department',
      ],
      "columns" => [
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
        'category_id' => [
          'label' => 'Kategori',
          'value' => 'category.name',
          'isSearchable' => true,
        ],
        'department_id' => [
          'label' => 'Departemen',
          'value' => 'department.name',
          'isSearchable' => true,
        ],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'category_id' => 'required|integer|exists:categories,id',
        'department_id' => 'required|integer|exists:departments,id',
      ],
      "defaults" => [],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'category_id',
              'label' => 'Kategori',
              'options' => 'props.categories',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("category_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'department_id',
              'label' => 'Departemen',
              'options' => 'props.departments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("department_id", e?.value)',
            ]
          ],
        ],
      ],
    ],
    [
      "model" => "Balance",
      "table_name" => "balances",
      "migration" => "2026_01_20_150004_create_balances_table",
      "label" => "Saldo",
      "icon" => "fas fa-wallet",
      "options_source" => [
        'companies' => 'App\Models\Company',
        'users' => 'App\Models\User',
        'departments' => 'App\Models\Department',
      ],
      "columns" => [
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'year' => ['label' => 'Tahun'],
        'month' => ['label' => 'Bulan'],
        'debit_amount' => ['label' => 'Debit', 'type' => 'currency'],
        'credit_amount' => ['label' => 'Kredit', 'type' => 'currency'],
      ],
      "validations" => [
        'company_id' => 'required|integer|exists:companies,id',
        'code' => 'required|string',
        'user_id' => 'required|integer|exists:users,id',
        'department_id' => 'required|integer|exists:departments,id',
        'debit_amount' => 'required|integer',
        'credit_amount' => 'required|integer',
        'year' => 'required|string', // Year type fits string/integer
        'month' => 'required|integer',
      ],
      "defaults" => [],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'company_id',
              'label' => 'Perusahaan',
              'options' => 'props.companies',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("company_id", e?.value)',
            ]
          ],
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'department_id',
              'label' => 'Departemen',
              'options' => 'props.departments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("department_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'debit_amount', 'label' => 'Debit', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'credit_amount', 'label' => 'Kredit', 'type' => 'number']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'year', 'label' => 'Tahun', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'month', 'label' => 'Bulan', 'type' => 'number']],
        ],
      ],
    ],
    [
      "model" => "Budget",
      "table_name" => "budgets",
      "migration" => "2026_01_20_150012_create_budgets_table",
      "label" => "Anggaran",
      "icon" => "fas fa-money-bill-wave",
      "options_source" => [
        'companies' => 'App\Models\Company',
        'users' => 'App\Models\User',
        'balances' => 'App\Models\Balance',
        'departments' => 'App\Models\Department',
      ],
      "columns" => [
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'date' => ['label' => 'Tanggal', 'dateFormat' => 'DD MMM YYYY'],
        'status' => ['label' => 'Status'],
        'debit_amount' => ['label' => 'Debit', 'type' => 'currency'],
        'credit_amount' => ['label' => 'Kredit', 'type' => 'currency'],
      ],
      "validations" => [
        'company_id' => 'required|integer|exists:companies,id',
        'user_id' => 'required|integer|exists:users,id',
        'balance_id' => 'required|integer|exists:balances,id',
        'department_id' => 'required|integer|exists:departments,id',
        'name' => 'required|string',
        'code' => 'required|string',
        'date' => 'required|date',
        'year' => 'required|string',
        'debit_amount' => 'required|integer',
        'credit_amount' => 'required|integer',
        'description' => 'nullable|string',
        'status' => 'required|string',
        'status_message' => 'nullable|string',
        'review_at' => 'nullable|date',
      ],
      "defaults" => [
        'status' => "\App\Enums\BudgetStatusType::Draft",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'company_id',
              'label' => 'Perusahaan',
              'options' => 'props.companies',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("company_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'department_id',
              'label' => 'Departemen',
              'options' => 'props.departments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("department_id", e?.value)',
            ]
          ],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'balance_id',
              'label' => 'Saldo',
              'options' => 'props.balances',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("balance_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'date', 'label' => 'Tanggal', 'type' => 'date']],
          ['form' => 'input', 'props' => ['name' => 'year', 'label' => 'Tahun', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'review_at', 'label' => 'Review At', 'type' => 'date']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'debit_amount', 'label' => 'Debit', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'credit_amount', 'label' => 'Kredit', 'type' => 'number']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'description', 'label' => 'Deskripsi']],
          ['form' => 'textarea', 'props' => ['name' => 'status_message', 'label' => 'Pesan Status']],
        ],
      ],
    ],
    [
      "model" => "BudgetDetail",
      "table_name" => "budget_details",
      "migration" => "2026_01_20_150013_create_budget_details_table",
      "label" => "Detail Anggaran",
      "icon" => "fas fa-list-alt",
      "options_source" => [
        'budgets' => 'App\Models\Budget',
        'users' => 'App\Models\User',
      ],
      "columns" => [
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'quantity' => ['label' => 'Jumlah', 'type' => 'number'],
        'price_total' => ['label' => 'Total Harga', 'type' => 'currency'],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'budget_id' => 'required|integer|exists:budgets,id',
        'user_id' => 'required|integer|exists:users,id',
        'code' => 'required|string',
        'name' => 'required|string',
        'description' => 'nullable|string',
        'quantity' => 'required|integer',
        'unit_type' => 'required|string',
        'price' => 'required|integer',
        'price_total' => 'required|integer',
        'status' => 'required|string',
        'status_message' => 'nullable|string',
      ],
      "defaults" => [
        'unit_type' => "\App\Enums\UnitType::Unit",
        'status' => "\App\Enums\BudgetStatusType::Draft",
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'budget_id',
              'label' => 'Anggaran',
              'options' => 'props.budgets',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("budget_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'quantity', 'label' => 'Jumlah', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'unit_type', 'label' => 'Tipe Unit', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'price', 'label' => 'Harga', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'price_total', 'label' => 'Total Harga', 'type' => 'number']],
        ],
        [
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'description', 'label' => 'Deskripsi']],
          ['form' => 'textarea', 'props' => ['name' => 'status_message', 'label' => 'Pesan Status']],
        ],
      ],
    ],
    [
      "model" => "Transaction",
      "table_name" => "transactions",
      "migration" => "2026_01_20_150027_create_transactions_table",
      "label" => "Transaksi",
      "icon" => "fas fa-exchange-alt",
      "options_source" => [
        'budget_details' => 'App\Models\BudgetDetail',
        'users' => 'App\Models\User',
        'vendors' => 'App\Models\Vendor',
      ],
      "columns" => [
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'name' => ['label' => 'Nama', 'isSearchable' => true],
        'vendor_id' => [
          'label' => 'Vendor',
          'value' => 'vendor.name',
          'isSearchable' => true,
        ],
        'price_total' => ['label' => 'Total Harga', 'type' => 'currency'],
        'status' => ['label' => 'Status'],
      ],
      "validations" => [
        'budget_detail_id' => 'required|integer|exists:budget_details,id',
        'user_id' => 'required|integer|exists:users,id',
        'vendor_id' => 'required|integer|exists:vendors,id',
        'code' => 'required|string',
        'name' => 'required|string',
        'description' => 'nullable|string',
        'quantity' => 'required|integer',
        'unit_type' => 'required|string',
        'price' => 'required|integer',
        'price_total' => 'required|integer',
        'status' => 'required|string',
        'status_message' => 'nullable|string',
      ],
      "defaults" => [
        'unit_type' => "\App\Enums\UnitType::Unit",
        'status' => "\App\Enums\BudgetStatusType::Draft",
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'budget_detail_id',
              'label' => 'Detail Anggaran',
              'options' => 'props.budget_details',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("budget_detail_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'vendor_id',
              'label' => 'Vendor',
              'options' => 'props.vendors',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("vendor_id", e?.value)',
            ]
          ],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'name', 'label' => 'Nama', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'unit_type', 'label' => 'Tipe Unit', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'quantity', 'label' => 'Jumlah', 'type' => 'number']],
          ['form' => 'input', 'props' => ['name' => 'price', 'label' => 'Harga', 'type' => 'number']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'price_total', 'label' => 'Total Harga', 'type' => 'number']],
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'description', 'label' => 'Deskripsi']],
          ['form' => 'textarea', 'props' => ['name' => 'status_message', 'label' => 'Pesan Status']],
        ],
      ],
    ],
    [
      "model" => "Payment",
      "table_name" => "payments",
      "migration" => "2026_01_20_150028_create_payments_table",
      "label" => "Pembayaran",
      "icon" => "fas fa-file-invoice-dollar",
      "options_source" => [
        'companies' => 'App\Models\Company',
        'departments' => 'App\Models\Department',
        'budgets' => 'App\Models\Budget',
        'users' => 'App\Models\User',
        'user_banks' => 'App\Models\UserBank',
        'banks' => 'App\Models\Bank',
      ],
      "columns" => [
        'code' => ['label' => 'Kode', 'isSearchable' => true],
        'amount' => ['label' => 'Jumlah', 'type' => 'currency'],
        'payment_date' => ['label' => 'Tanggal Bayar', 'dateFormat' => 'DD MMM YYYY'],
        'status' => ['label' => 'Status'],
        'method' => ['label' => 'Metode'],
      ],
      "validations" => [
        'company_id' => 'required|integer|exists:companies,id',
        'department_id' => 'required|integer|exists:departments,id',
        'budget_id' => 'required|integer|exists:budgets,id',
        'user_review_id' => 'required|integer|exists:users,id',
        'user_bank_id' => 'required|integer|exists:user_banks,id',
        'bank_id' => 'required|integer|exists:banks,id',
        'code' => 'required|string',
        'type' => 'required|string',
        'method' => 'required|string',
        'amount' => 'required|integer',
        'payment_date' => 'required|date',
        'due_date' => 'required|date',
        'cheque_number' => 'required|string',
        'description' => 'nullable|string',
        'status' => 'required|string',
        'status_message' => 'nullable|string',
        'review_at' => 'nullable|date',
      ],
      "defaults" => [
        'type' => "\App\Enums\PaymentType::Full",
        'method' => "\App\Enums\PaymentMethodType::EBanking",
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'company_id',
              'label' => 'Perusahaan',
              'options' => 'props.companies',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("company_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'department_id',
              'label' => 'Departemen',
              'options' => 'props.departments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("department_id", e?.value)',
            ]
          ],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'budget_id',
              'label' => 'Anggaran',
              'options' => 'props.budgets',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("budget_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_review_id',
              'label' => 'Reviewer',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_review_id", e?.value)',
            ]
          ],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_bank_id',
              'label' => 'Bank Pengguna',
              'options' => 'props.user_banks',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_bank_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'bank_id',
              'label' => 'Bank',
              'options' => 'props.banks',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("bank_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'code', 'label' => 'Kode', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'cheque_number', 'label' => 'No. Cek', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'type', 'label' => 'Tipe', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'method', 'label' => 'Metode', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'amount', 'label' => 'Jumlah', 'type' => 'number']],
          ['form' => 'select', 'props' => ['name' => 'status', 'label' => 'Status', 'options' => 'props.status']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'payment_date', 'label' => 'Tanggal Bayar', 'type' => 'date']],
          ['form' => 'input', 'props' => ['name' => 'due_date', 'label' => 'Jatuh Tempo', 'type' => 'date']],
          ['form' => 'input', 'props' => ['name' => 'review_at', 'label' => 'Review At', 'type' => 'date']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'description', 'label' => 'Deskripsi']],
          ['form' => 'textarea', 'props' => ['name' => 'status_message', 'label' => 'Pesan Status']],
        ],
      ],
    ],
    [
      "model" => "CodeConfig",
      "table_name" => "code_configs",
      "migration" => "2026_01_20_150029_create_code_configs_table",
      "label" => "Konfigurasi Kode",
      "icon" => "fas fa-code-branch",
      "columns" => [
        'module' => ['label' => 'Modul', 'isSearchable' => true],
        'prefix' => ['label' => 'Prefix'],
        'last_number' => ['label' => 'Nomor Terakhir'],
        'is_user_alias' => ['label' => 'Alias Pengguna'],
      ],
      "validations" => [
        'module' => 'required|string|unique:code_configs,module',
        'prefix' => 'required|string',
        'separator' => 'required|string',
        'digits' => 'required|integer',
        'last_number' => 'required|integer',
        'is_user_alias' => 'required|boolean',
      ],
      "defaults" => [
        'module' => "\App\Enums\ModuleType::Budget",
        'separator' => '/',
        'digits' => 4,
        'last_number' => 0,
        'is_user_alias' => false,
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'module', 'label' => 'Modul', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'prefix', 'label' => 'Prefix', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'separator', 'label' => 'Pemisah', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'digits', 'label' => 'Digit', 'type' => 'number']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'last_number', 'label' => 'Nomor Terakhir', 'type' => 'number']],
          ['form' => 'checkbox', 'props' => ['name' => 'is_user_alias', 'label' => 'Gunakan Alias Pengguna']],
        ],
      ],
    ],
    [
      "model" => "Notification",
      "table_name" => "notifications",
      "migration" => "2026_01_20_151000_create_notifications_table",
      "label" => "Notifikasi",
      "icon" => "fas fa-bell",
      "options_source" => [
        'users' => 'App\Models\User',
        'budgets' => 'App\Models\Budget',
        'transactions' => 'App\Models\Transaction',
        'payments' => 'App\Models\Payment',
      ],
      "columns" => [
        'title' => ['label' => 'Judul', 'isSearchable' => true],
        'type' => ['label' => 'Tipe'],
        'is_read' => ['label' => 'Dibaca'],
        'created_at' => ['label' => 'Dibuat Pada'],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'budget_id' => 'nullable|integer|exists:budgets,id',
        'transaction_id' => 'nullable|integer|exists:transactions,id',
        'payment_id' => 'nullable|integer|exists:payments,id',
        'module_type' => 'required|string',
        'type' => 'required|string',
        'title' => 'required|string',
        'message' => 'required|string',
        'link' => 'required|string',
        'is_read' => 'required|boolean',
        'read_at' => 'nullable|date',
      ],
      "defaults" => [
        'module_type' => "\App\Enums\ModuleType::Budget",
        'type' => "\App\Enums\NotificationType::Info",
        'is_read' => false,
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          ['form' => 'input', 'props' => ['name' => 'title', 'label' => 'Judul', 'type' => 'text']],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'budget_id',
              'label' => 'Anggaran',
              'options' => 'props.budgets',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("budget_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'transaction_id',
              'label' => 'Transaksi',
              'options' => 'props.transactions',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("transaction_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'payment_id',
              'label' => 'Pembayaran',
              'options' => 'props.payments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("payment_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'type', 'label' => 'Tipe', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'module_type', 'label' => 'Tipe Modul', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'link', 'label' => 'Link', 'type' => 'text']],
          ['form' => 'checkbox', 'props' => ['name' => 'is_read', 'label' => 'Sudah Dibaca']],
          ['form' => 'input', 'props' => ['name' => 'read_at', 'label' => 'Dibaca Pada', 'type' => 'date']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'message', 'label' => 'Pesan']],
        ],
      ],
    ],
    [
      "model" => "ApprovalLog",
      "table_name" => "approval_logs",
      "migration" => "2026_01_20_151001_create_approval_logs_table",
      "label" => "Log Persetujuan",
      "icon" => "fas fa-clipboard-check",
      "options_source" => [
        'users' => 'App\Models\User',
        'budgets' => 'App\Models\Budget',
        'budget_details' => 'App\Models\BudgetDetail',
        'payments' => 'App\Models\Payment',
      ],
      "columns" => [
        'action' => ['label' => 'Aksi', 'isSearchable' => true],
        'user_id' => [
          'label' => 'Pengguna',
          'value' => 'user.name',
          'isSearchable' => true,
        ],
        'created_at' => ['label' => 'Waktu'],
      ],
      "validations" => [
        'user_id' => 'required|integer|exists:users,id',
        'budget_id' => 'nullable|integer|exists:budgets,id',
        'budget_detail_id' => 'nullable|integer|exists:budget_details,id',
        'payment_id' => 'nullable|integer|exists:payments,id',
        'module_type' => 'required|string',
        'action' => 'required|string',
        'level' => 'required|string',
        'is_finance' => 'required|boolean',
        'note' => 'nullable|string',
        'ip_address' => 'required|string',
        'user_agent' => 'required|string',
      ],
      "defaults" => [
        'module_type' => "\App\Enums\ModuleType::Budget",
        'action' => "\App\Enums\ActionStatusType::Submit",
        'level' => "\App\Enums\UserDepartmentType::Manager",
        'is_finance' => false,
      ],
      "form_layout" => [
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'user_id',
              'label' => 'Pengguna',
              'options' => 'props.users',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("user_id", e?.value)',
            ]
          ],
          ['form' => 'input', 'props' => ['name' => 'action', 'label' => 'Aksi', 'type' => 'text']],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'budget_id',
              'label' => 'Anggaran',
              'options' => 'props.budgets',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("budget_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'budget_detail_id',
              'label' => 'Detail Anggaran',
              'options' => 'props.budget_details',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("budget_detail_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'payment_id',
              'label' => 'Pembayaran',
              'options' => 'props.payments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("payment_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'level', 'label' => 'Level', 'type' => 'text']],
          ['form' => 'checkbox', 'props' => ['name' => 'is_finance', 'label' => 'Keuangan']],
          ['form' => 'input', 'props' => ['name' => 'module_type', 'label' => 'Tipe Modul', 'type' => 'text']],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'ip_address', 'label' => 'IP Address', 'type' => 'text']],
          ['form' => 'textarea', 'props' => ['name' => 'user_agent', 'label' => 'User Agent']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'note', 'label' => 'Catatan']],
        ],
      ],
    ],
    [
      "is_react_page" => false,
      "model" => "Attachment",
      "table_name" => "attachments",
      "migration" => "2026_01_20_151002_create_attachments_table",
      "label" => "Lampiran",
      "icon" => "fas fa-paperclip",
      "options_source" => [
        'transactions' => 'App\Models\Transaction',
        'payments' => 'App\Models\Payment',
      ],
      "columns" => [
        'label' => ['label' => 'Label', 'isSearchable' => true],
        'type' => ['label' => 'Tipe'],
        'created_at' => ['label' => 'Dibuat Pada'],
      ],
      "validations" => [
        'transaction_id' => 'nullable|integer|exists:transactions,id',
        'payment_id' => 'nullable|integer|exists:payments,id',
        'module_type' => 'required|string',
        'type' => 'required|string',
        'label' => 'required|string',
        'value' => 'required|string',
        'description' => 'nullable|string',
      ],
      "defaults" => [
        'module_type' => "\App\Enums\ModuleType::Transaction",
        'type' => "\App\Enums\AttachmentContentType::Image",
      ],
      "form_layout" => [
        [
          ['form' => 'input', 'props' => ['name' => 'label', 'label' => 'Label', 'type' => 'text']],
          ['form' => 'input', 'props' => ['name' => 'type', 'label' => 'Tipe', 'type' => 'text']],
        ],
        [
          [
            'form' => 'select',
            'props' => [
              'name' => 'transaction_id',
              'label' => 'Transaksi',
              'options' => 'props.transactions',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("transaction_id", e?.value)',
            ]
          ],
          [
            'form' => 'select',
            'props' => [
              'name' => 'payment_id',
              'label' => 'Pembayaran',
              'options' => 'props.payments',
              'isReactSelect' => true,
              'isVirtualized' => true,
              'handleChange' => '(e) => setData("payment_id", e?.value)',
            ]
          ],
        ],
        [
          ['form' => 'input', 'props' => ['name' => 'module_type', 'label' => 'Tipe Modul', 'type' => 'text']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'value', 'label' => 'Nilai (URL/Path)']],
        ],
        [
          ['form' => 'textarea', 'props' => ['name' => 'description', 'label' => 'Deskripsi']],
        ],
      ],
    ],
  ]
];
