feat(market): add Minha Intenções tab with panel, hook, and badge
- Introduced "Minhas Intenções" tab visible only to logged-in users. - Integrated MyPurchaseIntentionsPanel and useMyPurchaseIntentions hook. - Added tab badge showing count of pending intentions. - Extended session API to include user’s main character for downstream features.
This commit is contained in:
1 parent
f35fee944d
commit
7f42def478
55 files changed
+4906
-95
No files matched your search
@@ -0,0 +1,13 @@
|
||||
-- Adicionar campo para contar trocas de método de pagamento
|
||||
ALTER TABLE purchase_intentions
|
||||
ADD COLUMN IF NOT EXISTS payment_method_change_count INT DEFAULT 0;
|
||||
|
||||
-- Atualizar registros existentes para 0
|
||||
UPDATE purchase_intentions
|
||||
SET payment_method_change_count = 0
|
||||
WHERE payment_method_change_count IS NULL;
|
||||
|
||||
-- Adicionar índice para queries de verificação
|
||||
CREATE INDEX IF NOT EXISTS idx_purchase_intentions_buyer_listing
|
||||
ON purchase_intentions(buyer_id, listing_id, status);
|
||||
|
||||
@@ -18,7 +18,8 @@ import { getPool, query, healthCheck } from "../index";
|
||||
const MIGRATIONS_DIR = join(__dirname, ".");
|
||||
|
||||
// Lista de migrations em ordem
|
||||
const MIGRATIONS = [ "001_users.sql",
|
||||
const MIGRATIONS = [
|
||||
"001_users.sql",
|
||||
"002_servers.sql",
|
||||
"003_fix_servers_location.sql",
|
||||
"004_listings.sql",
|
||||
@@ -33,9 +34,11 @@ const MIGRATIONS = [ "001_users.sql",
|
||||
"013_add_trade_item_support.sql",
|
||||
"014_add_bid_increment.sql",
|
||||
"015_add_purchase_intentions.sql",
|
||||
"016_add_payment_method_change_count.sql",
|
||||
"016_create_unified_items_table.sql",
|
||||
"017_add_items_foreign_key.sql",
|
||||
"018_migrate_listings_to_unified_items.sql",];
|
||||
"018_migrate_listings_to_unified_items.sql",
|
||||
];
|
||||
|
||||
async function runMigrations() {
|
||||
console.log("🚀 Iniciando execução de migrations...\n");
|
||||
@@ -84,7 +87,7 @@ async function runMigrations() {
|
||||
console.log(`📠Executando migration: ${migrationFile}...`);
|
||||
|
||||
// Ler arquivo SQL
|
||||
const sql = readFileSync(migrationPath, "utf-8");
|
||||
const sql = readFileSync(migrationPath, "utf-8").replace(/^\uFEFF/, "");
|
||||
|
||||
// Executar migration
|
||||
await query(sql);
|
||||
|
||||
Reference in new issue
Block a user