feat: núcleo de tickets com Convex (CRUD, play, comentários com anexos) + auth placeholder; docs em AGENTS.md; toasts e updates otimistas; mapeadores Zod; refinos PT-BR e layout do painel de detalhes

This commit is contained in:
esdrasrenan 2025-10-04 00:31:44 -03:00
parent 2230590e57
commit 27b103cb46
97 changed files with 15117 additions and 15715 deletions

23
web/convex/bootstrap.ts Normal file
View file

@ -0,0 +1,23 @@
import { mutation } from "./_generated/server";
import { v } from "convex/values";
export const ensureDefaults = mutation({
args: { tenantId: v.string() },
handler: async (ctx, { tenantId }) => {
const existing = await ctx.db
.query("queues")
.withIndex("by_tenant", (q) => q.eq("tenantId", tenantId))
.collect();
if (existing.length === 0) {
const queues = [
{ name: "Suporte N1", slug: "suporte-n1" },
{ name: "Suporte N2", slug: "suporte-n2" },
{ name: "Field Services", slug: "field-services" },
];
for (const q of queues) {
await ctx.db.insert("queues", { tenantId, name: q.name, slug: q.slug, teamId: undefined });
}
}
},
});