melhorias de tipagem

This commit is contained in:
Luiz Silva 2025-08-20 12:09:18 -03:00
parent d53450b686
commit 6480b90500
10 changed files with 54 additions and 21 deletions

View file

@ -1,4 +1,4 @@
import { type opcoesVinculosGov, ProdutoQuipo } from "./tipagem"
import { opcoesVinculosGovEnum, ProdutoQuipo } from "./tipagem"
export const produto_betha_meio_ambiente = new ProdutoQuipo({
chave_produto: "betha-meio-ambiente",
@ -8,8 +8,6 @@ export const produto_betha_meio_ambiente = new ProdutoQuipo({
url_produto: ({ inquilino, base_url, vinculo }) =>
`${base_url}/${inquilino}${
vinculo == ("anonimo" satisfies keyof typeof opcoesVinculosGov)
? ""
: `/${vinculo}#/admin`
vinculo == (opcoesVinculosGovEnum.anonimo) ? "" : `/${vinculo}#/admin`
}`,
})

View file

@ -1,4 +1,4 @@
import { type opcoesVinculosGov, ProdutoQuipo } from "./tipagem"
import { opcoesVinculosGovEnum, ProdutoQuipo } from "./tipagem"
export const produto_e_licencie_gov = new ProdutoQuipo({
chave_produto: "e-licencie-gov",
titulo: "e-licencie.gov",
@ -6,8 +6,6 @@ export const produto_e_licencie_gov = new ProdutoQuipo({
"e-licencie.gov: Software de gestão de processos e dados ambientais.",
url_produto: ({ inquilino, base_url, vinculo }) =>
`${base_url}/${inquilino}${
vinculo == ("anonimo" satisfies keyof typeof opcoesVinculosGov)
? ""
: `/${vinculo}#/admin`
vinculo == (opcoesVinculosGovEnum.anonimo) ? "" : `/${vinculo}#/admin`
}`,
})

View file

@ -7,6 +7,8 @@ import {
chaves_produto,
opcoesVinculos,
opcoesVinculosGov,
opcoesVinculosGovDescricao,
opcoesVinculosGovEnum,
Produto,
provedoresGov,
versao_usuarios,
@ -25,6 +27,8 @@ export {
Produto,
chaves_produto,
opcoesVinculosGov,
opcoesVinculosGovDescricao,
opcoesVinculosGovEnum,
opcoesVinculos,
provedoresGov,
produto_betha_meio_ambiente,

View file

@ -6,11 +6,25 @@ export enum chaves_produto {
"e-licencie" = "e-licencie",
}
export const opcoesVinculosGov = {
export enum opcoesVinculosGovEnum {
governo = "governo",
sociedade = "sociedade",
anonimo = "anonimo",
}
export const opcoesVinculosGovDescricao: {
[k in opcoesVinculosGovEnum]: string
} = {
governo: "Governo",
sociedade: "Sociedade",
anonimo: "Anônimo",
} as const
}
/**
* @deprecated Esta função será removida em futuras versões.
* opcoesVinculosGovEnum ou opcoesVinculosGovDescricao
*/
export const opcoesVinculosGov = opcoesVinculosGovDescricao
export const opcoesVinculosSuporte = {
"suporte-1": "Suporte Primário",
@ -18,12 +32,16 @@ export const opcoesVinculosSuporte = {
export const opcoesVinculos = {
[chaves_produto.suporte]: opcoesVinculosSuporte,
[chaves_produto["betha-meio-ambiente"]]: opcoesVinculosGov,
[chaves_produto["e-licencie-gov"]]: opcoesVinculosGov,
[chaves_produto["betha-meio-ambiente"]]: opcoesVinculosGovDescricao,
[chaves_produto["e-licencie-gov"]]: opcoesVinculosGovDescricao,
[chaves_produto["e-licencie"]]: {},
} as const
export const tiposAcesso = opcoesVinculosGov
/**
* @deprecated Esta função será removida em futuras versões.
* opcoesVinculosGovEnum ou opcoesVinculosGovDescricao
*/
export const tiposAcesso = opcoesVinculosGovDescricao
export const provedoresGov = {
/** Sistema de login da Beta */