355 lines
21 KiB
PHP
355 lines
21 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Carbon\Carbon;
|
|
|
|
/**
|
|
* Seeder de Categorias SEM Keywords
|
|
* Cores e ícones variados para cada categoria
|
|
*/
|
|
class CategoriesOnlySeeder extends Seeder
|
|
{
|
|
private $userId;
|
|
private $now;
|
|
private $categoryId = 0;
|
|
|
|
public function run(): void
|
|
{
|
|
$this->now = Carbon::now();
|
|
|
|
// Pegar o primeiro usuário ou o ID passado
|
|
$this->userId = DB::table('users')->first()->id ?? 1;
|
|
|
|
// Limpar categorias existentes do usuário
|
|
DB::table('category_keywords')
|
|
->whereIn('category_id', function($query) {
|
|
$query->select('id')->from('categories')->where('user_id', $this->userId);
|
|
})->delete();
|
|
DB::table('categories')->where('user_id', $this->userId)->delete();
|
|
|
|
// =====================================================================
|
|
// CATEGORIAS DE DESPESA (expense)
|
|
// =====================================================================
|
|
|
|
// 🏠 MORADIA
|
|
$moradia = $this->createCategory('Moradia', 'expense', '#8B5CF6', 'bi-house-door-fill', 'Gastos com habitação');
|
|
$this->createSubcategories($moradia, [
|
|
['name' => 'Aluguel', 'icon' => 'bi-key-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Hipoteca', 'icon' => 'bi-bank2', 'color' => '#6D28D9'],
|
|
['name' => 'Condomínio', 'icon' => 'bi-buildings-fill', 'color' => '#5B21B6'],
|
|
['name' => 'Água', 'icon' => 'bi-droplet-fill', 'color' => '#3B82F6'],
|
|
['name' => 'Eletricidade', 'icon' => 'bi-lightning-charge-fill', 'color' => '#F59E0B'],
|
|
['name' => 'Gás', 'icon' => 'bi-fire', 'color' => '#EF4444'],
|
|
['name' => 'Internet/Telefone', 'icon' => 'bi-wifi', 'color' => '#06B6D4'],
|
|
['name' => 'Seguro Residencial', 'icon' => 'bi-shield-fill-check', 'color' => '#10B981'],
|
|
['name' => 'Manutenção/Reparos', 'icon' => 'bi-tools', 'color' => '#6B7280'],
|
|
['name' => 'Móveis', 'icon' => 'bi-house-gear-fill', 'color' => '#78716C'],
|
|
['name' => 'Decoração', 'icon' => 'bi-paint-bucket', 'color' => '#EC4899'],
|
|
['name' => 'Limpeza Casa', 'icon' => 'bi-trash2-fill', 'color' => '#14B8A6'],
|
|
]);
|
|
|
|
// 🍽️ ALIMENTAÇÃO
|
|
$alimentacao = $this->createCategory('Alimentação', 'expense', '#22C55E', 'bi-cart4', 'Comida e bebidas');
|
|
$this->createSubcategories($alimentacao, [
|
|
['name' => 'Supermercado', 'icon' => 'bi-basket3-fill', 'color' => '#16A34A'],
|
|
['name' => 'Padaria', 'icon' => 'bi-cake2-fill', 'color' => '#CA8A04'],
|
|
['name' => 'Açougue', 'icon' => 'bi-egg-fried', 'color' => '#DC2626'],
|
|
['name' => 'Peixaria', 'icon' => 'bi-water', 'color' => '#0891B2'],
|
|
['name' => 'Frutas/Verduras', 'icon' => 'bi-basket-fill', 'color' => '#65A30D'],
|
|
['name' => 'Bebidas', 'icon' => 'bi-cup-straw', 'color' => '#7C3AED'],
|
|
['name' => 'Delivery', 'icon' => 'bi-box-seam-fill', 'color' => '#F97316'],
|
|
['name' => 'Café/Snacks', 'icon' => 'bi-cup-hot-fill', 'color' => '#92400E'],
|
|
]);
|
|
|
|
// 🍴 RESTAURANTES E BARES
|
|
$restaurantes = $this->createCategory('Restaurantes e Bares', 'expense', '#F97316', 'bi-cup-straw', 'Comer fora');
|
|
$this->createSubcategories($restaurantes, [
|
|
['name' => 'Restaurante', 'icon' => 'bi-shop-window', 'color' => '#EA580C'],
|
|
['name' => 'Fast Food', 'icon' => 'bi-bag-fill', 'color' => '#DC2626'],
|
|
['name' => 'Bar/Cafetería', 'icon' => 'bi-cup-hot', 'color' => '#92400E'],
|
|
['name' => 'Discoteca/Club', 'icon' => 'bi-music-note-beamed', 'color' => '#7C3AED'],
|
|
['name' => 'Tapas', 'icon' => 'bi-egg-fill', 'color' => '#CA8A04'],
|
|
['name' => 'Comida Asiática', 'icon' => 'bi-yin-yang', 'color' => '#DC2626'],
|
|
['name' => 'Comida Italiana', 'icon' => 'bi-circle', 'color' => '#16A34A'],
|
|
['name' => 'Comida Mexicana', 'icon' => 'bi-fire', 'color' => '#EA580C'],
|
|
['name' => 'Kebab', 'icon' => 'bi-globe2', 'color' => '#854D0E'],
|
|
]);
|
|
|
|
// 🚗 TRANSPORTE
|
|
$transporte = $this->createCategory('Transporte', 'expense', '#3B82F6', 'bi-car-front', 'Deslocamentos');
|
|
$this->createSubcategories($transporte, [
|
|
['name' => 'Metro/Bus', 'icon' => 'bi-train-lightrail-front-fill', 'color' => '#2563EB'],
|
|
['name' => 'Taxi/VTC', 'icon' => 'bi-taxi-front-fill', 'color' => '#CA8A04'],
|
|
['name' => 'Combustível', 'icon' => 'bi-fuel-pump-fill', 'color' => '#DC2626'],
|
|
['name' => 'Estacionamento', 'icon' => 'bi-p-circle-fill', 'color' => '#0891B2'],
|
|
['name' => 'Pedágios', 'icon' => 'bi-sign-stop-fill', 'color' => '#7C2D12'],
|
|
['name' => 'Seguro Carro', 'icon' => 'bi-shield-fill-check', 'color' => '#059669'],
|
|
['name' => 'Manutenção Carro', 'icon' => 'bi-wrench-adjustable', 'color' => '#525252'],
|
|
['name' => 'Multas', 'icon' => 'bi-exclamation-triangle-fill', 'color' => '#DC2626'],
|
|
['name' => 'Aluguel Carro', 'icon' => 'bi-key-fill', 'color' => '#4338CA'],
|
|
['name' => 'BiciMAD/Patinetes', 'icon' => 'bi-scooter', 'color' => '#65A30D'],
|
|
['name' => 'Carsharing', 'icon' => 'bi-ev-front-fill', 'color' => '#0D9488'],
|
|
['name' => 'AVE/Trem', 'icon' => 'bi-train-front-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Avião', 'icon' => 'bi-airplane-engines-fill', 'color' => '#0284C7'],
|
|
['name' => 'BlaBlaCar', 'icon' => 'bi-people-fill', 'color' => '#0891B2'],
|
|
]);
|
|
|
|
// 🛒 COMPRAS
|
|
$compras = $this->createCategory('Compras', 'expense', '#EC4899', 'bi-bag', 'Compras diversas');
|
|
$this->createSubcategories($compras, [
|
|
['name' => 'Roupas', 'icon' => 'bi-handbag-fill', 'color' => '#DB2777'],
|
|
['name' => 'Calçados', 'icon' => 'bi-boot', 'color' => '#9333EA'],
|
|
['name' => 'Acessórios', 'icon' => 'bi-watch', 'color' => '#C026D3'],
|
|
['name' => 'Eletrônicos', 'icon' => 'bi-laptop', 'color' => '#2563EB'],
|
|
['name' => 'Livros/Papelaria', 'icon' => 'bi-book', 'color' => '#854D0E'],
|
|
['name' => 'Presentes', 'icon' => 'bi-gift', 'color' => '#DC2626'],
|
|
['name' => 'Bazar/Casa', 'icon' => 'bi-house', 'color' => '#F59E0B'],
|
|
['name' => 'Bricolagem', 'icon' => 'bi-tools', 'color' => '#525252'],
|
|
['name' => 'Amazon/Online', 'icon' => 'bi-box-seam', 'color' => '#F97316'],
|
|
]);
|
|
|
|
// 💊 SAÚDE
|
|
$saude = $this->createCategory('Saúde', 'expense', '#EF4444', 'bi-heart-pulse', 'Cuidados médicos');
|
|
$this->createSubcategories($saude, [
|
|
['name' => 'Farmácia', 'icon' => 'bi-capsule-pill', 'color' => '#16A34A'],
|
|
['name' => 'Médico/Consulta', 'icon' => 'bi-hospital-fill', 'color' => '#0891B2'],
|
|
['name' => 'Seguro Saúde', 'icon' => 'bi-shield-heart-fill', 'color' => '#DC2626'],
|
|
['name' => 'Dentista', 'icon' => 'bi-emoji-smile-fill', 'color' => '#0EA5E9'],
|
|
['name' => 'Ótica', 'icon' => 'bi-eyeglasses', 'color' => '#4338CA'],
|
|
['name' => 'Análises/Exames', 'icon' => 'bi-clipboard2-pulse-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Psicólogo/Terapia', 'icon' => 'bi-chat-heart-fill', 'color' => '#EC4899'],
|
|
['name' => 'Fisioterapia', 'icon' => 'bi-bandaid-fill', 'color' => '#F59E0B'],
|
|
['name' => 'Hospital/Urgências', 'icon' => 'bi-hospital', 'color' => '#DC2626'],
|
|
]);
|
|
|
|
// 💇 BELEZA E CUIDADO PESSOAL
|
|
$beleza = $this->createCategory('Beleza e Cuidado Pessoal', 'expense', '#D946EF', 'bi-scissors', 'Estética e higiene');
|
|
$this->createSubcategories($beleza, [
|
|
['name' => 'Cabeleireiro', 'icon' => 'bi-scissors', 'color' => '#A21CAF'],
|
|
['name' => 'Manicure/Pedicure', 'icon' => 'bi-brush-fill', 'color' => '#DB2777'],
|
|
['name' => 'Cosméticos', 'icon' => 'bi-bag-heart-fill', 'color' => '#EC4899'],
|
|
['name' => 'Perfumaria', 'icon' => 'bi-droplet-half', 'color' => '#8B5CF6'],
|
|
['name' => 'Spa/Massagem', 'icon' => 'bi-emoji-relaxed-fill', 'color' => '#0D9488'],
|
|
['name' => 'Depilação', 'icon' => 'bi-stars', 'color' => '#F472B6'],
|
|
['name' => 'Higiene Pessoal', 'icon' => 'bi-shop', 'color' => '#0891B2'],
|
|
]);
|
|
|
|
// 🎓 EDUCAÇÃO
|
|
$educacao = $this->createCategory('Educação', 'expense', '#0EA5E9', 'bi-mortarboard', 'Formação e estudos');
|
|
$this->createSubcategories($educacao, [
|
|
['name' => 'Mensalidade Escolar', 'icon' => 'bi-building-fill', 'color' => '#0369A1'],
|
|
['name' => 'Universidade', 'icon' => 'bi-mortarboard-fill', 'color' => '#1D4ED8'],
|
|
['name' => 'Cursos/Formação', 'icon' => 'bi-laptop', 'color' => '#7C3AED'],
|
|
['name' => 'Idiomas', 'icon' => 'bi-translate', 'color' => '#059669'],
|
|
['name' => 'Material Escolar', 'icon' => 'bi-pencil-fill', 'color' => '#CA8A04'],
|
|
['name' => 'Aulas Particulares', 'icon' => 'bi-person-video3', 'color' => '#4338CA'],
|
|
]);
|
|
|
|
// 🎮 ENTRETENIMENTO
|
|
$entretenimento = $this->createCategory('Entretenimento', 'expense', '#A855F7', 'bi-controller', 'Lazer e diversão');
|
|
$this->createSubcategories($entretenimento, [
|
|
['name' => 'Streaming', 'icon' => 'bi-tv-fill', 'color' => '#DC2626'],
|
|
['name' => 'Música/Spotify', 'icon' => 'bi-music-note-beamed', 'color' => '#16A34A'],
|
|
['name' => 'Cinema', 'icon' => 'bi-film', 'color' => '#1D4ED8'],
|
|
['name' => 'Teatro/Shows', 'icon' => 'bi-mask', 'color' => '#C026D3'],
|
|
['name' => 'Museu/Exposições', 'icon' => 'bi-palette-fill', 'color' => '#F59E0B'],
|
|
['name' => 'Concertos', 'icon' => 'bi-megaphone-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Jogos/Gaming', 'icon' => 'bi-controller', 'color' => '#059669'],
|
|
['name' => 'Parques/Zoo', 'icon' => 'bi-emoji-smile', 'color' => '#65A30D'],
|
|
['name' => 'Eventos Esportivos', 'icon' => 'bi-trophy-fill', 'color' => '#CA8A04'],
|
|
]);
|
|
|
|
// 🏋️ FITNESS E ESPORTES
|
|
$fitness = $this->createCategory('Fitness e Esportes', 'expense', '#14B8A6', 'bi-bicycle', 'Atividades físicas');
|
|
$this->createSubcategories($fitness, [
|
|
['name' => 'Academia/Gimnasio', 'icon' => 'bi-buildings-fill', 'color' => '#0F766E'],
|
|
['name' => 'Yoga/Pilates', 'icon' => 'bi-heart-fill', 'color' => '#EC4899'],
|
|
['name' => 'Piscina', 'icon' => 'bi-droplet-fill', 'color' => '#0891B2'],
|
|
['name' => 'Equipamento Esportivo', 'icon' => 'bi-handbag', 'color' => '#2563EB'],
|
|
['name' => 'Futebol/Padel', 'icon' => 'bi-trophy', 'color' => '#16A34A'],
|
|
['name' => 'Corrida/Running', 'icon' => 'bi-lightning-fill', 'color' => '#F97316'],
|
|
['name' => 'Bicicleta', 'icon' => 'bi-bicycle', 'color' => '#65A30D'],
|
|
]);
|
|
|
|
// ✈️ VIAGENS
|
|
$viagens = $this->createCategory('Viagens', 'expense', '#06B6D4', 'bi-airplane', 'Turismo e férias');
|
|
$this->createSubcategories($viagens, [
|
|
['name' => 'Hospedagem/Hotel', 'icon' => 'bi-building', 'color' => '#0891B2'],
|
|
['name' => 'Passagens', 'icon' => 'bi-airplane-fill', 'color' => '#2563EB'],
|
|
['name' => 'Passeios/Tours', 'icon' => 'bi-signpost-fill', 'color' => '#16A34A'],
|
|
['name' => 'Seguro Viagem', 'icon' => 'bi-shield-check', 'color' => '#7C3AED'],
|
|
['name' => 'Souvenirs', 'icon' => 'bi-gift', 'color' => '#EC4899'],
|
|
['name' => 'Alimentação Viagem', 'icon' => 'bi-cup-straw', 'color' => '#F97316'],
|
|
]);
|
|
|
|
// 🐕 PETS/MASCOTAS
|
|
$pets = $this->createCategory('Pets/Mascotas', 'expense', '#F59E0B', 'bi-heart', 'Animais de estimação');
|
|
$this->createSubcategories($pets, [
|
|
['name' => 'Ração/Comida', 'icon' => 'bi-cup-fill', 'color' => '#92400E'],
|
|
['name' => 'Veterinário', 'icon' => 'bi-heart-pulse-fill', 'color' => '#DC2626'],
|
|
['name' => 'Acessórios Pet', 'icon' => 'bi-bag', 'color' => '#7C3AED'],
|
|
['name' => 'Peluquería Canina', 'icon' => 'bi-scissors', 'color' => '#EC4899'],
|
|
['name' => 'Seguro Mascota', 'icon' => 'bi-shield-fill-plus', 'color' => '#059669'],
|
|
]);
|
|
|
|
// 🏦 FINANCEIRO
|
|
$financeiro = $this->createCategory('Financeiro', 'expense', '#64748B', 'bi-bank', 'Serviços bancários');
|
|
$this->createSubcategories($financeiro, [
|
|
['name' => 'Taxas Bancárias', 'icon' => 'bi-bank2', 'color' => '#475569'],
|
|
['name' => 'Juros/Intereses', 'icon' => 'bi-percent', 'color' => '#DC2626'],
|
|
['name' => 'Transferências', 'icon' => 'bi-arrow-left-right', 'color' => '#2563EB'],
|
|
['name' => 'Seguros Diversos', 'icon' => 'bi-shield-fill', 'color' => '#059669'],
|
|
['name' => 'Assessoria/Contabilidade', 'icon' => 'bi-calculator-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Impostos', 'icon' => 'bi-receipt', 'color' => '#DC2626'],
|
|
]);
|
|
|
|
// 👶 FAMÍLIA E FILHOS
|
|
$familia = $this->createCategory('Família e Filhos', 'expense', '#F472B6', 'bi-people', 'Gastos familiares');
|
|
$this->createSubcategories($familia, [
|
|
['name' => 'Creche/Guardería', 'icon' => 'bi-house-heart-fill', 'color' => '#EC4899'],
|
|
['name' => 'Atividades Extracurriculares', 'icon' => 'bi-star-fill', 'color' => '#F59E0B'],
|
|
['name' => 'Brinquedos', 'icon' => 'bi-balloon-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Fraldas/Pañales', 'icon' => 'bi-heart', 'color' => '#0891B2'],
|
|
['name' => 'Mesada/Semanada', 'icon' => 'bi-cash-coin', 'color' => '#16A34A'],
|
|
]);
|
|
|
|
// 📱 ASSINATURAS E SERVIÇOS
|
|
$assinaturas = $this->createCategory('Assinaturas e Serviços', 'expense', '#8B5CF6', 'bi-credit-card-2-front', 'Pagamentos recorrentes');
|
|
$this->createSubcategories($assinaturas, [
|
|
['name' => 'Cloud Storage', 'icon' => 'bi-cloud-fill', 'color' => '#0891B2'],
|
|
['name' => 'Apps/Software', 'icon' => 'bi-phone-fill', 'color' => '#2563EB'],
|
|
['name' => 'Jornais/Revistas', 'icon' => 'bi-newspaper', 'color' => '#525252'],
|
|
['name' => 'Domínios/Hosting', 'icon' => 'bi-globe', 'color' => '#059669'],
|
|
['name' => 'VPN/Segurança', 'icon' => 'bi-shield-lock-fill', 'color' => '#DC2626'],
|
|
['name' => 'Coworking', 'icon' => 'bi-briefcase-fill', 'color' => '#F59E0B'],
|
|
]);
|
|
|
|
// 🎁 DOAÇÕES
|
|
$doacoes = $this->createCategory('Doações', 'expense', '#10B981', 'bi-gift', 'Caridade e contribuições');
|
|
$this->createSubcategories($doacoes, [
|
|
['name' => 'ONGs', 'icon' => 'bi-heart-fill', 'color' => '#DC2626'],
|
|
['name' => 'Crowdfunding', 'icon' => 'bi-people-fill', 'color' => '#7C3AED'],
|
|
['name' => 'Igreja/Religião', 'icon' => 'bi-heart', 'color' => '#F59E0B'],
|
|
]);
|
|
|
|
// 📦 OUTROS GASTOS
|
|
$outros = $this->createCategory('Outros Gastos', 'expense', '#94A3B8', 'bi-three-dots', 'Gastos diversos');
|
|
$this->createSubcategories($outros, [
|
|
['name' => 'Correios/Envíos', 'icon' => 'bi-box-seam', 'color' => '#CA8A04'],
|
|
['name' => 'Loteria/Apostas', 'icon' => 'bi-dice-5-fill', 'color' => '#16A34A'],
|
|
['name' => 'Tabaco', 'icon' => 'bi-cloud-haze2-fill', 'color' => '#78716C'],
|
|
['name' => 'Fotocópias/Impressões', 'icon' => 'bi-printer-fill', 'color' => '#525252'],
|
|
['name' => 'Lavanderia', 'icon' => 'bi-tsunami', 'color' => '#0891B2'],
|
|
['name' => 'Imprevistos', 'icon' => 'bi-exclamation-circle-fill', 'color' => '#DC2626'],
|
|
]);
|
|
|
|
// =====================================================================
|
|
// CATEGORIAS DE RENDA (income)
|
|
// =====================================================================
|
|
|
|
// 💰 SALÁRIO E TRABALHO
|
|
$salario = $this->createCategory('Salário e Trabalho', 'income', '#10B981', 'bi-briefcase', 'Rendimentos de trabalho');
|
|
$this->createSubcategories($salario, [
|
|
['name' => 'Salário Líquido', 'icon' => 'bi-cash-stack', 'color' => '#059669'],
|
|
['name' => 'Horas Extras', 'icon' => 'bi-clock-fill', 'color' => '#0891B2'],
|
|
['name' => 'Bônus', 'icon' => 'bi-trophy-fill', 'color' => '#F59E0B'],
|
|
['name' => 'Comissões', 'icon' => 'bi-percent', 'color' => '#7C3AED'],
|
|
['name' => 'Dietas/Ajudas', 'icon' => 'bi-receipt', 'color' => '#6B7280'],
|
|
['name' => 'Freelance', 'icon' => 'bi-laptop', 'color' => '#2563EB'],
|
|
]);
|
|
|
|
// 📈 INVESTIMENTOS
|
|
$investimentos = $this->createCategory('Investimentos', 'income', '#3B82F6', 'bi-graph-up-arrow', 'Rendimentos de investimentos');
|
|
$this->createSubcategories($investimentos, [
|
|
['name' => 'Dividendos', 'icon' => 'bi-currency-dollar', 'color' => '#16A34A'],
|
|
['name' => 'Juros Poupança', 'icon' => 'bi-piggy-bank-fill', 'color' => '#F59E0B'],
|
|
['name' => 'Venda de Ações', 'icon' => 'bi-graph-up', 'color' => '#059669'],
|
|
['name' => 'Cripto', 'icon' => 'bi-currency-bitcoin', 'color' => '#F97316'],
|
|
['name' => 'Fundos', 'icon' => 'bi-bar-chart-fill', 'color' => '#7C3AED'],
|
|
]);
|
|
|
|
// 🏠 RENDAS E ALUGUÉIS
|
|
$rendas = $this->createCategory('Rendas e Aluguéis', 'income', '#F59E0B', 'bi-house-door', 'Rendimentos de propriedades');
|
|
$this->createSubcategories($rendas, [
|
|
['name' => 'Aluguel Recebido', 'icon' => 'bi-house-check-fill', 'color' => '#16A34A'],
|
|
['name' => 'Aluguel Airbnb', 'icon' => 'bi-house-heart-fill', 'color' => '#EC4899'],
|
|
['name' => 'Garagem/Trastero', 'icon' => 'bi-p-square-fill', 'color' => '#0891B2'],
|
|
]);
|
|
|
|
// 🎁 OUTROS RENDIMENTOS
|
|
$outrosRend = $this->createCategory('Outros Rendimentos', 'income', '#8B5CF6', 'bi-cash-stack', 'Outras fontes de renda');
|
|
$this->createSubcategories($outrosRend, [
|
|
['name' => 'Reembolsos', 'icon' => 'bi-arrow-return-left', 'color' => '#0891B2'],
|
|
['name' => 'Venda de Objetos', 'icon' => 'bi-bag-check-fill', 'color' => '#F97316'],
|
|
['name' => 'Presentes Recebidos', 'icon' => 'bi-gift-fill', 'color' => '#EC4899'],
|
|
['name' => 'Ajudas/Subsídios', 'icon' => 'bi-building', 'color' => '#2563EB'],
|
|
['name' => 'Loteria/Prêmios', 'icon' => 'bi-trophy', 'color' => '#F59E0B'],
|
|
]);
|
|
|
|
// =====================================================================
|
|
// CATEGORIAS MISTAS (both)
|
|
// =====================================================================
|
|
|
|
// 🔄 TRANSFERÊNCIAS
|
|
$transferencias = $this->createCategory('Transferências', 'both', '#6B7280', 'bi-arrow-left-right', 'Movimentações entre contas');
|
|
$this->createSubcategories($transferencias, [
|
|
['name' => 'Entre Contas', 'icon' => 'bi-arrow-down-up', 'color' => '#475569'],
|
|
['name' => 'Bizum', 'icon' => 'bi-phone-vibrate', 'color' => '#0891B2'],
|
|
['name' => 'PayPal', 'icon' => 'bi-paypal', 'color' => '#1D4ED8'],
|
|
['name' => 'Wise/Revolut', 'icon' => 'bi-globe2', 'color' => '#0D9488'],
|
|
]);
|
|
|
|
$this->command->info("✅ {$this->categoryId} categorias criadas para o usuário ID={$this->userId} (SEM keywords)");
|
|
}
|
|
|
|
private function createCategory(string $name, string $type, string $color, string $icon, string $description = null): array
|
|
{
|
|
$this->categoryId++;
|
|
|
|
DB::table('categories')->insert([
|
|
'user_id' => $this->userId,
|
|
'parent_id' => null,
|
|
'name' => $name,
|
|
'type' => $type,
|
|
'description' => $description,
|
|
'color' => $color,
|
|
'icon' => $icon,
|
|
'order' => $this->categoryId,
|
|
'is_active' => true,
|
|
'is_system' => false,
|
|
'created_at' => $this->now,
|
|
'updated_at' => $this->now,
|
|
]);
|
|
|
|
return ['id' => DB::getPdo()->lastInsertId(), 'type' => $type];
|
|
}
|
|
|
|
private function createSubcategories(array $parent, array $subcategories): void
|
|
{
|
|
$parentId = $parent['id'];
|
|
$parentType = $parent['type'];
|
|
|
|
foreach ($subcategories as $index => $sub) {
|
|
$this->categoryId++;
|
|
|
|
DB::table('categories')->insert([
|
|
'user_id' => $this->userId,
|
|
'parent_id' => $parentId,
|
|
'name' => $sub['name'],
|
|
'type' => $parentType,
|
|
'description' => null,
|
|
'color' => $sub['color'] ?? '#6B7280',
|
|
'icon' => $sub['icon'] ?? 'bi-tag',
|
|
'order' => $index + 1,
|
|
'is_active' => true,
|
|
'is_system' => false,
|
|
'created_at' => $this->now,
|
|
'updated_at' => $this->now,
|
|
]);
|
|
}
|
|
}
|
|
}
|