| Nº | Contrato | Secretaria | Empresa | Processo | Valor | Início | Vencimento | Dias a Vencer | Status | Ações |
|---|
| Contrato | Secretaria | Descrição | Marca | Unid. | Qtd. Contratada | Valor Unit. | Valor Total | Qtd. Utilizada | Valor Utilizado | Saldo Qtd. | Saldo Valor | % Util. | Ações |
|---|
CREATE TABLE ordens ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), numero TEXT NOT NULL UNIQUE, tipo TEXT DEFAULT 'Ordem de Fornecimento', contrato_numero TEXT NOT NULL, secretaria TEXT DEFAULT '', solicitante TEXT DEFAULT '', data_ordem DATE DEFAULT CURRENT_DATE, obs TEXT DEFAULT '', itens JSONB DEFAULT '[]', status TEXT DEFAULT 'Emitida', created_at TIMESTAMPTZ DEFAULT now(), updated_at TIMESTAMPTZ DEFAULT now() );
| Nº Ordem | Tipo | Contrato | Secretaria | Solicitante | Data | Itens | Valor Total | Status | Ações |
|---|
| Nº Processo | Secretaria | Objeto | Modalidade | Fase Atual | Última Atualização | Data Sessão | Ações |
|---|
| Nº | Secretaria | Objeto | Hipótese Legal | Valor (R$) | Fornecedor | Fase | PNCP | Ações |
|---|
| Nº | Secretaria | Objeto | Hipótese (Art. 74) | Valor (R$) | Fornecedor/Contratado | Fase | PNCP | Ações |
|---|
| Nº Aditivo | Contrato | Secretaria | Tipo | Acréscimo / Supressão | Nova Vigência | Assinatura | PNCP | Ações |
|---|
-- Tabela de Audit Log CREATE TABLE IF NOT EXISTS audit_log ( id uuid DEFAULT gen_random_uuid() PRIMARY KEY, user_email text NOT NULL, user_id uuid, action text NOT NULL, modulo text NOT NULL, entidade text NOT NULL, detalhe text DEFAULT '', created_at timestamptz DEFAULT now() ); ALTER TABLE audit_log ENABLE ROW LEVEL SECURITY; CREATE POLICY "Enable all for authenticated" ON audit_log FOR ALL TO authenticated USING (true) WITH CHECK (true); CREATE INDEX idx_audit_log_created ON audit_log(created_at DESC); -- Tabela de Presença (usuários online) CREATE TABLE IF NOT EXISTS user_presence ( id uuid DEFAULT gen_random_uuid() PRIMARY KEY, user_id uuid NOT NULL, email text NOT NULL, last_seen timestamptz DEFAULT now(), UNIQUE(user_id) ); ALTER TABLE user_presence ENABLE ROW LEVEL SECURITY; CREATE POLICY "Enable all for authenticated" ON user_presence FOR ALL TO authenticated USING (true) WITH CHECK (true);
ALTER TABLE user_permissions ADD COLUMN IF NOT EXISTS secretaria TEXT DEFAULT NULL; -- Opcional: índice para busca rápida CREATE INDEX IF NOT EXISTS idx_user_perm_secretaria ON user_permissions(secretaria);
| Usuário | Perfil | Secretaria | Módulos com Acesso | Ações |
|---|---|---|---|---|
| Carregando usuários... | ||||