Merge pull request 'feat: add new module consulta de produtos' (#1) from feature/new-modules into develop

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-02-27 15:10:48 +00:00
4 changed files with 197 additions and 111 deletions
+39 -29
View File
@@ -9,20 +9,21 @@
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@davinti/jeff": "git+https://git.davinti.com.br/davinTI/jeff.git#v1.0.3" "@davinti/jeff": "git+https://git.davinti.com.br/davinTI/jeff.git#v1.0.5"
}, },
"devDependencies": { "devDependencies": {
"tsx": "^4.21.0" "tsx": "^4.21.0"
} }
}, },
"node_modules/@davinti/jeff": { "node_modules/@davinti/jeff": {
"version": "1.0.3", "version": "1.0.5",
"resolved": "git+https://git.davinti.com.br/davinTI/jeff.git#e695ec9c6e817e10df95708cf8427df3e03db2df", "resolved": "git+https://git.davinti.com.br/davinTI/jeff.git#de72040736f1459809722c87d602185ae470fb76",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@types/glob": "^8.1.0", "@types/glob": "^8.1.0",
"commander": "^14.0.3", "commander": "^14.0.3",
"glob": "^13.0.2", "glob": "^13.0.2",
"jiti": "^2.6.1",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"zod": "^4.3.6" "zod": "^4.3.6"
}, },
@@ -489,33 +490,33 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "25.3.0", "version": "25.3.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.2.tgz",
"integrity": "sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A==", "integrity": "sha512-RpV6r/ij22zRRdyBPcxDeKAzH43phWVKEjL2iksqo1Vz3CuBUrgmPpPhALKiRfU7OMCmeeO9vECBMsV0hMTG8Q==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~7.18.0" "undici-types": "~7.18.0"
} }
}, },
"node_modules/balanced-match": { "node_modules/balanced-match": {
"version": "4.0.3", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.3.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==", "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": "20 || >=22" "node": "18 || 20 || >=22"
} }
}, },
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "5.0.2", "version": "5.0.4",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz",
"integrity": "sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==", "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"balanced-match": "^4.0.2" "balanced-match": "^4.0.2"
}, },
"engines": { "engines": {
"node": "20 || >=22" "node": "18 || 20 || >=22"
} }
}, },
"node_modules/commander": { "node_modules/commander": {
@@ -598,22 +599,31 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "13.0.5", "version": "13.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.5.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
"integrity": "sha512-BzXxZg24Ibra1pbQ/zE7Kys4Ua1ks7Bn6pKLkVPZ9FZe4JQS6/Q7ef3LG1H+k7lUf5l4T3PLSyYyYJVYUvfgTw==", "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"minimatch": "^10.2.1", "minimatch": "^10.2.2",
"minipass": "^7.1.2", "minipass": "^7.1.3",
"path-scurry": "^2.0.0" "path-scurry": "^2.0.2"
}, },
"engines": { "engines": {
"node": "20 || >=22" "node": "18 || 20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/jiti": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz",
"integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==",
"license": "MIT",
"bin": {
"jiti": "lib/jiti-cli.mjs"
}
},
"node_modules/lru-cache": { "node_modules/lru-cache": {
"version": "11.2.6", "version": "11.2.6",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.6.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.6.tgz",
@@ -624,15 +634,15 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "10.2.1", "version": "10.2.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.1.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
"integrity": "sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==", "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"brace-expansion": "^5.0.2" "brace-expansion": "^5.0.2"
}, },
"engines": { "engines": {
"node": "20 || >=22" "node": "18 || 20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -648,16 +658,16 @@
} }
}, },
"node_modules/path-scurry": { "node_modules/path-scurry": {
"version": "2.0.1", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
"integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==", "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"lru-cache": "^11.0.0", "lru-cache": "^11.0.0",
"minipass": "^7.1.2" "minipass": "^7.1.2"
}, },
"engines": { "engines": {
"node": "20 || >=22" "node": "18 || 20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
+5 -5
View File
@@ -3,16 +3,16 @@
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"generate": "tsx ./node_modules/.bin/jeff generate -i \"src/**/*.module.ts\"", "generate": "jeff generate -i \"src/**/*.module.ts\"",
"generate:output": "tsx ./node_modules/.bin/jeff generate -i \"src/**/*.module.ts\" -o dist/manifest.json", "generate:output": "jeff generate -i \"src/**/*.module.ts\" -o dist/manifest.json",
"vet": "tsx ./node_modules/.bin/jeff vet -i \"src/**/*.module.ts\"", "vet": "jeff vet -i \"src/**/*.module.ts\"",
"jeff": "tsx ./node_modules/.bin/jeff" "jeff": "jeff"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"description": "", "description": "",
"dependencies": { "dependencies": {
"@davinti/jeff": "git+https://git.davinti.com.br/davinTI/jeff.git#v1.0.3" "@davinti/jeff": "git+https://git.davinti.com.br/davinTI/jeff.git#v1.0.5"
}, },
"devDependencies": { "devDependencies": {
"tsx": "^4.21.0" "tsx": "^4.21.0"
+11 -8
View File
@@ -2,12 +2,14 @@ import { createModuleFactory } from "@davinti/jeff";
const moduleFactory = createModuleFactory(["C5"]); const moduleFactory = createModuleFactory(["C5"]);
export default moduleFactory.createModule({ export default moduleFactory
.createModule({
id: "flash-de-vendas", id: "flash-de-vendas",
description: "Flash de Vendas", description: "Flash de Vendas",
label: "Flash de Vendas", label: "Flash de Vendas",
icon: "bar-chart",
queries: { queries: {
"flash": { flash: {
name: "Flash de Vendas", name: "Flash de Vendas",
display: { display: {
type: "flash", type: "flash",
@@ -66,10 +68,11 @@ export default moduleFactory.createModule({
], ],
}, },
params: ["data_venda"], params: ["data_venda"],
} },
}, },
entrypoint: "flash", entrypoint: "flash",
}).withImplementations({ })
.withImplementations({
C5: { C5: {
flash: (args) => { flash: (args) => {
return { return {
@@ -97,8 +100,8 @@ where 1=1
and tvf.vlrvendaacumulada > 0 and tvf.vlrvendaacumulada > 0
and tvf.dtavda = TO_DATE(${args.data_venda}, 'YYYY-MM-DD') and tvf.dtavda = TO_DATE(${args.data_venda}, 'YYYY-MM-DD')
group by rollup(canalapp, nomeempresaapp) group by rollup(canalapp, nomeempresaapp)
order by grouping(canalapp) desc, grouping(nomeempresaapp) desc` order by grouping(canalapp) desc, grouping(nomeempresaapp) desc`,
}; };
} },
} },
}) });
+73
View File
@@ -0,0 +1,73 @@
import { createModuleFactory } from "@davinti/jeff";
const moduleFactory = createModuleFactory(["C5"]);
export default moduleFactory
.createModule({
id: "consulta-de-produto",
description: "Consulta de Produtos",
label: "Consulta de Produtos",
icon: "search",
queries: {
consulta: {
name: "Consulta de Produtos",
display: {
type: "list",
search_bar: {
placeholder: "Digite o nome do produto",
},
rows: {
title: "title",
code: "code",
},
},
params: ["nome_produto"],
},
},
entrypoint: "consulta",
})
.withImplementations({
C5: {
consulta: (args) => {
return {
sql: /*sql*/ `
select --mpc.codacesso as code,
pro.seqproduto,
Upper(NVL(PRODIMAG.DESCRICAO,PRO.DESCCOMPLETA)) title,
Upper(pro.desccompleta) Pesquisa,
coalesce(mapi.urlecommerceimg, '') IMAGEMURL,
NVL(cpa.seqcategoria,0) CATEGORIAID,
NVL(cpa.categoria,'SEM CATEGORIA') CATEGORIADESC
from map_produto pro
/* inner join map_prodcodigo mpc
on mpc.seqfamilia = pro.seqfamilia
and mpc.seqproduto = pro.seqproduto
AND mpc.tipcodigo = 'E'
and mpc.indutilvenda = 'S'*/
left join map_produtoimagem mapi
on mapi.seqproduto = pro.seqproduto
and mapi.indpricipal = 'S'
LEFT JOIN CONSINCO.GMGB_VW_MOBILE_PRODIMAGE PRODIMAG
ON PRODIMAG.ID = PRO.SEQPRODUTO
left join (select fdc.seqfamilia, fdc.seqcategoria, c.categoria
from map_famdivcateg fdc
inner join consinco.map_categoria c
on fdc.seqcategoria = c.seqcategoria
and fdc.nrodivisao = c.nrodivisao
where c.nrodivisao = 2
and c.categoria not in (' A CLASSIFICAR','ATIVO FIXO','ALMOXARIFADO','LANCHONETE','SERVI OS')
and c.nivelhierarquia = 1
and c.statuscategor = 'A'
and c.tipcategoria = 'M'
and fdc.status = 'A'
and title = ${args.nome_produto}
) cpa
on cpa.seqfamilia = pro.seqfamilia`,
};
},
},
});