Files
carvalho-finances/apps/api/internal/migration/sql/008_cosmetics.sql
T
Mlcavalho1andClaude Sonnet 4.6 c327d5c970 feat(#29): Arcade Neon design system — visual overhaul completo
Implementa o sistema visual Arcade Neon do neon-handoff/ em todo o app:

- tokens.css: tokens --fc-*, utilities (fc-pixel/mono/body/glow), form inputs/buttons globais
- AppHud.vue: HUD persistente com LV/XP/META + nav chips por rota
- BottomNav.vue: nav mobile com 5 rotas
- NeonPanel.vue, CharacterSprite.vue, XPBar.vue, HUDStat.vue: componentes base
- MonthSwitcher.vue, LevelUpModal.vue
- HomeView, CharacterView, TransactionsView, ImportView, CategoriesView,
  AccountsView, SettingsView: reescritos com Arcade Neon
- sprites PNG (lv01–lv15) + sprite-data.json: cosméticos com temas de cor
- game.ts: equippedTheme getter para merge de cores do cosmético equipado
- 008_cosmetics.sql: seeds alinhados com sprite-data.json

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-05-26 22:53:41 -03:00

33 lines
1.9 KiB
SQL

CREATE TABLE IF NOT EXISTS cosmetics (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL UNIQUE,
type VARCHAR(20) NOT NULL CHECK (type IN ('outfit','hat','accessory')),
unlock_level INTEGER NOT NULL,
css_data JSONB NOT NULL DEFAULT '{}'
);
CREATE TABLE IF NOT EXISTS player_cosmetics (
id SERIAL PRIMARY KEY,
cosmetic_id INTEGER NOT NULL REFERENCES cosmetics(id) ON DELETE CASCADE UNIQUE,
equipped BOOLEAN NOT NULL DEFAULT FALSE,
unlocked_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-- Seeds aligned with sprite-data.json themes (keys = sprite color slots)
INSERT INTO cosmetics (name, type, unlock_level, css_data) VALUES
('Tripulante Iniciante', 'outfit', 1,
'{"sprite_id":"lv01-tripulante","h":"#5a3a1d","w":"#5a3a1d","c":"#0ea5e9","C":"#075985","p":"#a16207","P":"#7c4a08","b":"#1e293b"}'),
('Boné Verolme', 'outfit', 3,
'{"sprite_id":"lv03-bone-verolme","h":"#1e40af","w":"#fde68a","c":"#0ea5e9","C":"#075985","p":"#a16207","P":"#7c4a08","b":"#1e293b"}'),
('Camiseta Wingspan', 'outfit', 5,
'{"sprite_id":"lv05-wingspan","h":"#ffd84d","w":"#fde68a","c":"#10b981","C":"#065f46","p":"#3a1f6e","P":"#2d1857","b":"#0f172a"}'),
('Chapéu de Sol', 'outfit', 7,
'{"sprite_id":"lv07-chapeu-sol","h":"#ffd84d","w":"#fde68a","c":"#00f0ff","C":"#0369a1","p":"#3a1f6e","P":"#2d1857","b":"#0f172a"}'),
('Casaco Anti-Vento', 'outfit', 10,
'{"sprite_id":"lv10-anti-vento","h":"#1e40af","w":"#fde68a","c":"#a855f7","C":"#581c87","p":"#1e293b","P":"#0f172a","b":"#0f172a"}'),
('Trajado de Capitão', 'outfit', 15,
'{"sprite_id":"lv15-capitao","h":"#ffd84d","w":"#dc2626","c":"#dc2626","C":"#7a0e0e","p":"#1c1917","P":"#0c0a09","b":"#0c0a09"}')
ON CONFLICT (name) DO NOTHING;
INSERT INTO schema_migrations (version) VALUES (8) ON CONFLICT DO NOTHING;