This commit is contained in:
2026-11-03 11:51:44 +02:00
parent badaada043
commit e753f7a0a4
309 changed files with 14537 additions and 529 deletions
@@ -0,0 +1,27 @@
import fs from 'node:fs/promises';
import assert from 'node:assert/strict';
const source = await fs.readFile('scripts/supplier-evaluation-check.mjs', 'utf8');
const common = source.slice(source.indexOf('const base ='), source.indexOf('const author ='));
await new Function('fs', 'assert', 'return (async()=>{' + common + `
const records=[];
for(const [role,expected] of [['admin',200],['warehouse',200],['procurement',403],['finance',403]]) {
const viewer=client();await viewer.enter(role);
assert.equal((await viewer.request('/contexto','POST',{area:'procurement',option:'procurement.internal'})).status,302);
for(const [path,component] of [['/stock/ocorrencias','stock/dispositions'],['/stock/estornos','stock/reversals']]) {
const response=await viewer.request(path);assert.equal(response.status,expected);
if(expected===200) {
assert.equal(response.page.component,component);assert.equal(response.page.encryptHistory,true);assert.equal(response.page.props.records.length,0);
assert.equal(response.page.props.capabilities.prepare,false);assert.equal(response.page.props.capabilities.review,false);
assert.equal(response.page.props.capabilities.execute,role==='warehouse');
}
records.push({role,path,status:response.status});
}
const tasks=await viewer.request('/requisicoes/tarefas?module=warehouse');assert.equal(tasks.status,200);
assert.equal(tasks.page.props.tasks.data.filter(row=>row.task.startsWith('disposition_')||row.task.startsWith('reversal_')).length,0);
}
await fs.writeFile('docs/proofs/inventory-task-integration-http.json',JSON.stringify({checked_at:new Date().toISOString(),environment:base,result:'passed',records,
business_commands:false,accounts_or_grants_changed:false,sgf_installation_changed:false,visual_review:false,
coverage:'No persistent stock dispositions or reversals exist; pending decisions and physical movements tested in disposable databases only.'},null,2));
console.log('Ocorrencias, estornos e tarefas conferidos nos perfis existentes.');
` + '})()')(fs, assert);