import { defineTable } from 'convex/server'; import { v } from 'convex/values'; export const atasTables = { atas: defineTable({ numero: v.string(), dataInicio: v.optional(v.string()), dataFim: v.optional(v.string()), empresaId: v.id('empresas'), pdf: v.optional(v.id('_storage')), numeroSei: v.string(), criadoPor: v.id('usuarios'), criadoEm: v.number(), atualizadoEm: v.number() }) .index('by_numero', ['numero']) .index('by_empresaId', ['empresaId']) .index('by_numeroSei', ['numeroSei']), atasObjetos: defineTable({ ataId: v.id('atas'), objetoId: v.id('objetos') }) .index('by_ataId', ['ataId']) .index('by_objetoId', ['objetoId']), atasDocumentos: defineTable({ ataId: v.id('atas'), nome: v.string(), storageId: v.id('_storage'), tipo: v.string(), // MIME type tamanho: v.number(), // bytes criadoPor: v.id('usuarios'), criadoEm: v.number() }).index('by_ataId', ['ataId']) };