.
This commit is contained in:
parent
d8a5a12387
commit
b799294b0e
24 changed files with 90 additions and 70 deletions
|
|
@ -26,7 +26,7 @@ export const zp_produto_conta = z.object({
|
|||
conta: z.string(),
|
||||
})
|
||||
|
||||
export const tiposColunas = z.enum([
|
||||
export const tiposColunasBasedados = z.enum([
|
||||
"texto",
|
||||
"numero",
|
||||
"confirmacao",
|
||||
|
|
@ -34,6 +34,8 @@ export const tiposColunas = z.enum([
|
|||
"lista_numero",
|
||||
])
|
||||
|
||||
export const tiposSeriesAgregacoes = z.enum(["contagem", "somatoria"])
|
||||
|
||||
export const validarColuna = {
|
||||
texto: z.string().nullable(),
|
||||
numero: z.number().nullable(),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
import type { tipoResposta } from "p-respostas"
|
||||
import { respostaComuns } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
import { PREFIXO, type zp_produto_conta } from "./_variaveis"
|
||||
import {
|
||||
PREFIXO,
|
||||
tiposSeriesAgregacoes,
|
||||
type zp_produto_conta,
|
||||
} from "./_variaveis"
|
||||
import type { zp_registrar_serie } from "./registrar_serie"
|
||||
|
||||
//consultar compilação
|
||||
|
|
@ -33,7 +37,9 @@ export const consultar_serie = ({
|
|||
emDesenvolvimento
|
||||
? "http://127.0.0.1:5080"
|
||||
: "https://carro-de-boi.idz.one"
|
||||
}${`${PREFIXO}/consultar-serie/${produto}/${conta}`}`,
|
||||
}${`${PREFIXO}/${
|
||||
tiposSeriesAgregacoes.enum.contagem
|
||||
}/${produto}/${conta}`}`,
|
||||
)
|
||||
|
||||
const resp = await fetch(url.toString(), {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { tiposColunas, validarZ, zp_produto_conta } from "./_variaveis"
|
||||
import { tiposSeriesAgregacoes, validarZ, zp_produto_conta } from "./_variaveis"
|
||||
import { consultar_serie, zp_consultar_serie } from "./consultar_serie"
|
||||
import { enviar_registros, zp_enviar_registros } from "./enviar_registros"
|
||||
import {
|
||||
|
|
@ -7,7 +7,7 @@ import {
|
|||
} from "./registrar_base_dados"
|
||||
import { registrar_serie, zp_registrar_serie } from "./registrar_serie"
|
||||
|
||||
export { tiposColunas }
|
||||
export { tiposSeriesAgregacoes }
|
||||
|
||||
export const pPilao = {
|
||||
registrar_base_dados,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
import type { tipoResposta } from "p-respostas"
|
||||
import { respostaComuns } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
import { PREFIXO, tiposColunas, type zp_produto_conta } from "./_variaveis"
|
||||
import {
|
||||
PREFIXO,
|
||||
tiposSeriesAgregacoes,
|
||||
type zp_produto_conta,
|
||||
} from "./_variaveis"
|
||||
|
||||
/** Faz o registro de uma nova base de dados configurado a estrutura de colunas */
|
||||
|
||||
|
|
@ -10,7 +14,7 @@ export const zp_registrar_base_dados = z.object({
|
|||
colunas: z.array(
|
||||
z.object({
|
||||
coluna: z.string(),
|
||||
tipo: tiposColunas,
|
||||
tipo: tiposSeriesAgregacoes,
|
||||
}),
|
||||
),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
|
||||
import { PREFIXO, type zp_produto_conta } from "./_variaveis"
|
||||
import {
|
||||
PREFIXO,
|
||||
tiposSeriesAgregacoes,
|
||||
type zp_produto_conta,
|
||||
} from "./_variaveis"
|
||||
|
||||
//registrar serie
|
||||
|
||||
|
|
@ -10,7 +14,7 @@ export const zp_registrar_serie = z.object({
|
|||
identificador: z.string(),
|
||||
colanuEixoX: z.string(),
|
||||
colunaAgrupamento: z.string(),
|
||||
agregacao: z.enum(["contagem"]),
|
||||
agregacao: tiposSeriesAgregacoes,
|
||||
})
|
||||
|
||||
export const registrar_serie = async ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue