feat: implementar sistema de preferências do usuário e refatorar changelog
Adiciona sistema completo de preferências de usuário: - Cria tabela userPreferences no schema com campos disableMagnetlines, periodMonthsBefore e periodMonthsAfter - Implementa página de Ajustes com abas (Preferências, Alterar nome, Senha, E-mail, Deletar conta) - Adiciona componente PreferencesForm para configuração de magnetlines e períodos de exibição - Propaga periodPreferences para todos os componentes de lançamentos e calendário Refatora sistema de changelog: - Remove implementação anterior baseada em JSON estático - Adiciona nova página de changelog dinâmica em app/(dashboard)/changelog - Adiciona componente changelog-list.tsx - Remove arquivos obsoletos (changelog-notification, actions, data, utils, scripts) Adiciona controle de saldo inicial em contas: - Novo campo excludeInitialBalanceFromIncome em contas - Permite excluir saldo inicial do cálculo de receitas - Atualiza queries de lançamentos para respeitar esta configuração Melhorias adicionais: - Adiciona componente ui/accordion.tsx do shadcn/ui - Refatora formatPeriodLabel para displayPeriod centralizado - Propaga estabelecimentos para componentes de lançamentos - Remove variável DB_PROVIDER obsoleta do .env.example e documentação - Adiciona 6 migrações de banco de dados (0003-0008)
This commit is contained in:
1
drizzle/0003_green_korg.sql
Normal file
1
drizzle/0003_green_korg.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE "anotacoes" ADD COLUMN "arquivada" boolean DEFAULT false NOT NULL;
|
||||
1
drizzle/0004_acoustic_mach_iv.sql
Normal file
1
drizzle/0004_acoustic_mach_iv.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE "contas" ADD COLUMN "excluir_saldo_inicial_receitas" boolean DEFAULT false NOT NULL;
|
||||
1
drizzle/0005_adorable_bruce_banner.sql
Normal file
1
drizzle/0005_adorable_bruce_banner.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE "user" ADD COLUMN "disable_magnetlines" boolean DEFAULT false NOT NULL;
|
||||
17
drizzle/0006_youthful_mister_fear.sql
Normal file
17
drizzle/0006_youthful_mister_fear.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "user_preferences" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"user_id" text NOT NULL,
|
||||
"disable_magnetlines" boolean DEFAULT false NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "user_preferences_user_id_unique" UNIQUE("user_id")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "user_preferences" ADD CONSTRAINT "user_preferences_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
-- Migrate existing data from user table to user_preferences
|
||||
INSERT INTO "user_preferences" ("user_id", "disable_magnetlines", "created_at", "updated_at")
|
||||
SELECT "id", COALESCE("disable_magnetlines", false), now(), now()
|
||||
FROM "user"
|
||||
WHERE "disable_magnetlines" IS NOT NULL OR "disable_magnetlines" = true;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "user" DROP COLUMN "disable_magnetlines";
|
||||
1
drizzle/0007_sturdy_kate_bishop.sql
Normal file
1
drizzle/0007_sturdy_kate_bishop.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE "user_update_log" CASCADE;
|
||||
2
drizzle/0008_fat_stick.sql
Normal file
2
drizzle/0008_fat_stick.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "user_preferences" ADD COLUMN "period_months_before" integer DEFAULT 3 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "user_preferences" ADD COLUMN "period_months_after" integer DEFAULT 3 NOT NULL;
|
||||
1951
drizzle/meta/0003_snapshot.json
Normal file
1951
drizzle/meta/0003_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1958
drizzle/meta/0004_snapshot.json
Normal file
1958
drizzle/meta/0004_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1965
drizzle/meta/0005_snapshot.json
Normal file
1965
drizzle/meta/0005_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
2027
drizzle/meta/0006_snapshot.json
Normal file
2027
drizzle/meta/0006_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1952
drizzle/meta/0007_snapshot.json
Normal file
1952
drizzle/meta/0007_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1966
drizzle/meta/0008_snapshot.json
Normal file
1966
drizzle/meta/0008_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,48 @@
|
||||
"when": 1765200545692,
|
||||
"tag": "0002_slimy_flatman",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "7",
|
||||
"when": 1767102605526,
|
||||
"tag": "0003_green_korg",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "7",
|
||||
"when": 1767104066872,
|
||||
"tag": "0004_acoustic_mach_iv",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 5,
|
||||
"version": "7",
|
||||
"when": 1767106121811,
|
||||
"tag": "0005_adorable_bruce_banner",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 6,
|
||||
"version": "7",
|
||||
"when": 1767107487318,
|
||||
"tag": "0006_youthful_mister_fear",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 7,
|
||||
"version": "7",
|
||||
"when": 1767118780033,
|
||||
"tag": "0007_sturdy_kate_bishop",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 8,
|
||||
"version": "7",
|
||||
"when": 1767125796314,
|
||||
"tag": "0008_fat_stick",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user