forked from git.gladyson/openmonetis
refactor: migrate from ESLint to Biome and extract SQL queries to data.ts
- Replace ESLint with Biome for linting and formatting - Configure Biome with tabs, double quotes, and organized imports - Move all SQL/Drizzle queries from page.tsx files to data.ts files - Create new data.ts files for: ajustes, dashboard, relatorios/categorias - Update existing data.ts files: extrato, fatura (add lancamentos queries) - Remove all drizzle-orm imports from page.tsx files - Update README.md with new tooling info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,30 +4,30 @@ import { z } from "zod";
|
||||
* Categorias de insights
|
||||
*/
|
||||
export const INSIGHT_CATEGORIES = {
|
||||
behaviors: {
|
||||
id: "behaviors",
|
||||
title: "Comportamentos Observados",
|
||||
icon: "RiEyeLine",
|
||||
color: "blue",
|
||||
},
|
||||
triggers: {
|
||||
id: "triggers",
|
||||
title: "Gatilhos de Consumo",
|
||||
icon: "RiFlashlightLine",
|
||||
color: "amber",
|
||||
},
|
||||
recommendations: {
|
||||
id: "recommendations",
|
||||
title: "Recomendações Práticas",
|
||||
icon: "RiLightbulbLine",
|
||||
color: "green",
|
||||
},
|
||||
improvements: {
|
||||
id: "improvements",
|
||||
title: "Melhorias Sugeridas",
|
||||
icon: "RiRocketLine",
|
||||
color: "purple",
|
||||
},
|
||||
behaviors: {
|
||||
id: "behaviors",
|
||||
title: "Comportamentos Observados",
|
||||
icon: "RiEyeLine",
|
||||
color: "blue",
|
||||
},
|
||||
triggers: {
|
||||
id: "triggers",
|
||||
title: "Gatilhos de Consumo",
|
||||
icon: "RiFlashlightLine",
|
||||
color: "amber",
|
||||
},
|
||||
recommendations: {
|
||||
id: "recommendations",
|
||||
title: "Recomendações Práticas",
|
||||
icon: "RiLightbulbLine",
|
||||
color: "green",
|
||||
},
|
||||
improvements: {
|
||||
id: "improvements",
|
||||
title: "Melhorias Sugeridas",
|
||||
icon: "RiRocketLine",
|
||||
color: "purple",
|
||||
},
|
||||
} as const;
|
||||
|
||||
export type InsightCategoryId = keyof typeof INSIGHT_CATEGORIES;
|
||||
@@ -36,29 +36,29 @@ export type InsightCategoryId = keyof typeof INSIGHT_CATEGORIES;
|
||||
* Schema para item individual de insight
|
||||
*/
|
||||
export const InsightItemSchema = z.object({
|
||||
text: z.string().min(1),
|
||||
text: z.string().min(1),
|
||||
});
|
||||
|
||||
/**
|
||||
* Schema para categoria de insights
|
||||
*/
|
||||
export const InsightCategorySchema = z.object({
|
||||
category: z.enum([
|
||||
"behaviors",
|
||||
"triggers",
|
||||
"recommendations",
|
||||
"improvements",
|
||||
]),
|
||||
items: z.array(InsightItemSchema).min(1).max(6),
|
||||
category: z.enum([
|
||||
"behaviors",
|
||||
"triggers",
|
||||
"recommendations",
|
||||
"improvements",
|
||||
]),
|
||||
items: z.array(InsightItemSchema).min(1).max(6),
|
||||
});
|
||||
|
||||
/**
|
||||
* Schema for complete insights response from AI
|
||||
*/
|
||||
export const InsightsResponseSchema = z.object({
|
||||
month: z.string().regex(/^\d{4}-\d{2}$/), // YYYY-MM
|
||||
generatedAt: z.string(), // ISO datetime
|
||||
categories: z.array(InsightCategorySchema).length(4),
|
||||
month: z.string().regex(/^\d{4}-\d{2}$/), // YYYY-MM
|
||||
generatedAt: z.string(), // ISO datetime
|
||||
categories: z.array(InsightCategorySchema).length(4),
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user