feat: Add 'atas' (minutes/records) management feature, and implement various improvements across UI, backend logic, and authentication.
This commit is contained in:
19
packages/backend/convex/tables/atas.ts
Normal file
19
packages/backend/convex/tables/atas.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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.string()), // storage ID
|
||||
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'])
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineTable } from 'convex/server';
|
||||
import { Infer, v } from 'convex/values';
|
||||
import { type Infer, v } from 'convex/values';
|
||||
|
||||
// Status de templates de fluxo
|
||||
export const flowTemplateStatus = v.union(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineTable } from 'convex/server';
|
||||
import { Infer, v } from 'convex/values';
|
||||
import { type Infer, v } from 'convex/values';
|
||||
|
||||
export const simboloTipo = v.union(
|
||||
v.literal('cargo_comissionado'),
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { defineTable } from 'convex/server';
|
||||
import { v } from 'convex/values';
|
||||
|
||||
export const produtosTables = {
|
||||
produtos: defineTable({
|
||||
export const objetosTables = {
|
||||
objetos: defineTable({
|
||||
nome: v.string(),
|
||||
valorEstimado: v.string(),
|
||||
tipo: v.union(v.literal('servico'), v.literal('estrutura'), v.literal('insumo')),
|
||||
tipo: v.union(v.literal('material'), v.literal('servico')),
|
||||
codigoEfisco: v.string(),
|
||||
codigoCatmat: v.optional(v.string()),
|
||||
codigoCatserv: v.optional(v.string()),
|
||||
unidade: v.string(),
|
||||
criadoPor: v.id('usuarios'),
|
||||
criadoEm: v.number()
|
||||
})
|
||||
@@ -12,19 +12,25 @@ export const pedidosTables = {
|
||||
v.literal('cancelado'),
|
||||
v.literal('concluido')
|
||||
),
|
||||
acaoId: v.optional(v.id('acoes')),
|
||||
// acaoId removed
|
||||
criadoPor: v.id('usuarios'),
|
||||
criadoEm: v.number(),
|
||||
atualizadoEm: v.number()
|
||||
})
|
||||
.index('by_numeroSei', ['numeroSei'])
|
||||
.index('by_status', ['status'])
|
||||
.index('by_criadoPor', ['criadoPor'])
|
||||
.index('by_acaoId', ['acaoId']),
|
||||
.index('by_criadoPor', ['criadoPor']),
|
||||
|
||||
pedidoItems: defineTable({
|
||||
objetoItems: defineTable({
|
||||
pedidoId: v.id('pedidos'),
|
||||
produtoId: v.id('produtos'),
|
||||
objetoId: v.id('objetos'), // was produtoId
|
||||
acaoId: v.optional(v.id('acoes')), // Moved from pedidos
|
||||
modalidade: v.union(
|
||||
v.literal('dispensa'),
|
||||
v.literal('inexgibilidade'),
|
||||
v.literal('adesao'),
|
||||
v.literal('consumo')
|
||||
),
|
||||
valorEstimado: v.string(),
|
||||
valorReal: v.optional(v.string()),
|
||||
quantidade: v.number(),
|
||||
@@ -32,8 +38,9 @@ export const pedidosTables = {
|
||||
criadoEm: v.number()
|
||||
})
|
||||
.index('by_pedidoId', ['pedidoId'])
|
||||
.index('by_produtoId', ['produtoId'])
|
||||
.index('by_adicionadoPor', ['adicionadoPor']),
|
||||
.index('by_objetoId', ['objetoId'])
|
||||
.index('by_adicionadoPor', ['adicionadoPor'])
|
||||
.index('by_acaoId', ['acaoId']),
|
||||
|
||||
historicoPedidos: defineTable({
|
||||
pedidoId: v.id('pedidos'),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineTable } from 'convex/server';
|
||||
import { Infer, v } from 'convex/values';
|
||||
import { type Infer, v } from 'convex/values';
|
||||
|
||||
export const ataqueCiberneticoTipo = v.union(
|
||||
v.literal('phishing'),
|
||||
|
||||
Reference in New Issue
Block a user