@@ -147,12 +147,20 @@ assert.equal(
|
||||
configuredMulti.some((e) => e.id === 'new_request'),
|
||||
true,
|
||||
);
|
||||
const capitalReaders = ['admin', 'procurement', 'finance', 'department_head', 'warehouse'];
|
||||
assert.ok(routes.some((route) => route.uri === 'projectos-imobilizado' && route.method.split('|').includes('GET')));
|
||||
for (const role of [...capitalReaders, 'requester']) {
|
||||
const groups = procurementNavigation([role], false, undefined, false, false, false, true);
|
||||
assert.equal(groups.flatMap((group) => group.entries).some((entry) => entry.id === 'capital_register'), capitalReaders.includes(role));
|
||||
if (capitalReaders.includes(role)) assert.equal(activeProcurementEntry(groups, '/projectos-imobilizado?history=qa'), 'capital_register');
|
||||
}
|
||||
const proof = {
|
||||
checked_at: new Date().toISOString(),
|
||||
result: 'passed',
|
||||
entries: rows.size,
|
||||
roles: 6,
|
||||
configurable_permissions_and_multiple_profiles: true,
|
||||
optional_capital_register_reading_roles: capitalReaders,
|
||||
maximum_functional_groups: 6,
|
||||
source: 'procurementNavigation compared with actual Laravel GET routes',
|
||||
scope: 'Menu routing, active entry and visibility contract; not a substitute for functional or visual workflow acceptance',
|
||||
|
||||
@@ -157,7 +157,7 @@ try {
|
||||
}
|
||||
if (in_array('--operational-orders-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/OperationalOrdersTest.php', 'tests/Feature/PurchaseAwardOrderTest.php',
|
||||
'--filter=operational register|utilisation mode|request links preserve|policy versions and company department|native orders freeze their production origin|metadata authority never opens']];
|
||||
'--filter=operational register|utilisation mode|request links preserve|policy versions and company department|native orders freeze their production origin|metadata authority never opens|operational order search']];
|
||||
}
|
||||
if (in_array('--operational-orders-access-only', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/OperationalOrdersTest.php', '--filter=metadata authority never opens']];
|
||||
@@ -176,6 +176,12 @@ try {
|
||||
if (in_array('--legal-reference-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/ImportLegalReferenceDraftsTest.php', 'tests/Feature/ImportLegalRulesTest.php']];
|
||||
}
|
||||
if (in_array('--legal-ice-reference-only', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/ImportLegalReferenceDraftsTest.php', '--filter=official second supplement']];
|
||||
}
|
||||
if (in_array('--capital-search-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/CapitalRegisterTest.php', 'tests/Feature/ProcurementSearchTest.php']];
|
||||
}
|
||||
if (in_array('--requisition-cycles-import-regression', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/ImportEstimatesTest.php', 'tests/Feature/ImportLandedCostsTest.php']];
|
||||
}
|
||||
|
||||
@@ -12,10 +12,19 @@ const reviewDurationArgs = process.argv.filter(flag => flag.startsWith('--review
|
||||
const reviewDurationMinutes = reviewDurationArgs.length === 0 ? 20 : Number(reviewDurationArgs[0].slice('--review-minutes='.length));
|
||||
if (reviewDurationArgs.length > 1 || !Number.isInteger(reviewDurationMinutes) || reviewDurationMinutes < 1 || reviewDurationMinutes > 60 || (reviewDurationArgs.length > 0 && !process.argv.includes('--native-review'))) throw Error('Native review duration must be one explicit value from1to60minutes');
|
||||
if (process.argv.includes('--legal-reference-preview') && (!process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime') || !process.argv.some(flag => ['--native-review', '--native-review-http-only'].includes(flag)))) throw Error('Legal preview requires the owned native review with complete pinned private composition');
|
||||
if (process.argv.includes('--vat-reference-preview') && (!process.argv.includes('--legal-reference-preview') || !process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime'))) throw Error('VAT preview requires the guarded native legal composition');
|
||||
if (process.argv.includes('--private-audit-recovery') && (!process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime') || process.argv.some(flag => ['--recovery-only', '--race-only', '--native-review', '--native-review-http-only'].includes(flag)))) throw Error('Private audit recovery requires its own complete pinned isolated composition');
|
||||
if (process.argv.includes('--print-pagination-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime'))) throw Error('Print pagination requires the owned native preview and complete pinned composition');
|
||||
if (process.argv.includes('--native-office-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime') || process.argv.some(flag => ['--print-pagination-preview', '--legal-reference-preview'].includes(flag)))) throw Error('Office preview requires its own complete pinned native QA composition');
|
||||
if (process.argv.includes('--specific-rate-preview') && (!process.argv.includes('--legal-reference-preview') || !process.argv.includes('--native-review'))) throw Error('Specific coefficient preview requires the owned legal native review');
|
||||
if (process.argv.includes('--ice-reference-preview') && (!process.argv.includes('--legal-reference-preview') || !process.argv.includes('--native-review'))) throw Error('ICE reference preview requires the owned legal native review');
|
||||
if (process.argv.includes('--capital-search-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime'))) throw Error('Capital search preview requires the owned native review and pinned isolated composition');
|
||||
if (process.argv.includes('--import-documentary-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime'))) throw Error('Documentary import preview requires the owned native review and pinned isolated composition');
|
||||
if (process.argv.includes('--supplier-review-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime'))) throw Error('Supplier review requires the owned native preview and pinned isolated composition');
|
||||
if (process.argv.includes('--conflict-release-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime') || process.argv.includes('--native-office-preview'))) throw Error('Conflict release requires its own guarded native QA composition');
|
||||
if (process.argv.includes('--urgent-stock-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime') || process.argv.includes('--native-office-preview'))) throw Error('Urgent stock review requires its own guarded native QA composition');
|
||||
if (process.argv.includes('--order-cancellation-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime') || process.argv.includes('--native-office-preview'))) throw Error('Cancellation review requires its own guarded native QA composition');
|
||||
if (process.argv.includes('--operational-search-preview') && (!process.argv.includes('--native-review') || !process.argv.includes('--integrated-schema') || !process.argv.includes('--frozen-runtime'))) throw Error('Operational search preview requires the owned native review and pinned isolated composition');
|
||||
if (path.resolve(process.cwd()) !== workspace) throw Error('Compras workspace required');
|
||||
if (process.argv.includes('--integrated-cycles-only') && !process.argv.includes('--integrated-schema')) throw Error('Integrated cycles require the complete isolated schema composition');
|
||||
if (process.argv.includes('--integrated-orders-only') && !process.argv.includes('--integrated-schema')) throw Error('Integrated orders require the complete isolated schema composition');
|
||||
@@ -118,7 +127,16 @@ try {
|
||||
RQ01_LEDGER_INTEGRATED_SCHEMA: process.argv.includes('--integrated-schema') ? '1' : '0',
|
||||
RQ01_NATIVE_OFFICE_JOURNEY: process.argv.some(flag => ['--native-office-http-only', '--native-office-preview'].includes(flag)) ? '1' : '0',
|
||||
RQ01_QA_LEGAL_REFERENCE: process.argv.includes('--legal-reference-preview') ? '1' : '0',
|
||||
RQ01_QA_VAT_REFERENCE: process.argv.includes('--vat-reference-preview') ? '1' : '0',
|
||||
RQ01_QA_SPECIFIC_RATE: process.argv.includes('--specific-rate-preview') ? '1' : '0',
|
||||
RQ01_QA_ICE_REFERENCE: process.argv.includes('--ice-reference-preview') ? '1' : '0',
|
||||
RQ01_QA_CAPITAL_SEARCH: process.argv.includes('--capital-search-preview') ? '1' : '0',
|
||||
RQ01_QA_IMPORT_DOCUMENTARY: process.argv.includes('--import-documentary-preview') ? '1' : '0',
|
||||
RQ01_QA_SUPPLIER_REVIEW: process.argv.includes('--supplier-review-preview') ? '1' : '0',
|
||||
RQ01_QA_CONFLICT_RELEASE: process.argv.includes('--conflict-release-preview') ? '1' : '0',
|
||||
RQ01_QA_URGENT_STOCK: process.argv.includes('--urgent-stock-preview') ? '1' : '0',
|
||||
RQ01_QA_ORDER_CANCELLATION: process.argv.includes('--order-cancellation-preview') ? '1' : '0',
|
||||
RQ01_QA_OPERATIONAL_SEARCH: process.argv.includes('--operational-search-preview') ? '1' : '0',
|
||||
RQ01_QA_PRINT_PAGINATION: process.argv.includes('--print-pagination-preview') ? '1' : '0' };
|
||||
delete environment.COMMON_FINANCE_BUNDLE_ROOT;
|
||||
delete environment.COMMON_FINANCE_BUNDLE_SHA256;
|
||||
@@ -142,6 +160,27 @@ try {
|
||||
if (!frozenRuntime || !process.argv.includes('--integrated-schema') || setupOnly) throw Error('Runtime guard requires only the frozen isolated composition');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/RequisitionLedgerAccountsTest.php', '--filter=pinned private runtime refuses');
|
||||
}
|
||||
if (process.argv.includes('--order-document-only')) {
|
||||
if (!frozenRuntime || !process.argv.includes('--integrated-schema') || setupOnly) throw Error('Order document regression requires only the frozen isolated composition');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php', 'tests/Feature/OrderDocumentNavigationTest.php',
|
||||
'--filter=ordinary controlled order|distributed approved synthetic|award starts a new approval cycle|order and receipt consultations|context links do not grant|print navigation leaves');
|
||||
}
|
||||
if (process.argv.includes('--supplier-evaluation-only')) {
|
||||
if (!frozenRuntime || !process.argv.includes('--integrated-schema') || setupOnly) throw Error('Supplier evaluation regression requires the frozen isolated composition');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/SupplierEvaluationTest.php');
|
||||
}
|
||||
if (process.argv.includes('--legal-reference-only')) {
|
||||
if (!frozenRuntime || !process.argv.includes('--integrated-schema') || setupOnly) throw Error('Legal reference regression requires the frozen isolated composition');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/ImportLegalReferenceDraftsTest.php', 'tests/Feature/ImportLegalRulesTest.php');
|
||||
}
|
||||
if (process.argv.includes('--conflict-only')) {
|
||||
if (setupOnly || !frozenRuntime || !process.argv.includes('--integrated-schema')) throw Error('Conflict regression requires the complete pinned isolated composition');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/ConflictDeclarationTest.php');
|
||||
}
|
||||
if (process.argv.includes('--private-audit-only')) {
|
||||
if (setupOnly || !frozenRuntime || !process.argv.includes('--integrated-schema')) throw Error('Private audit regression requires the complete pinned isolated composition');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/PrivateAuditSourcesTest.php', 'tests/Feature/PrivateAuditAccessTest.php', 'tests/Feature/PrivateAuditExporterTest.php');
|
||||
}
|
||||
if (process.argv.includes('--independent-procurement-only')) {
|
||||
if (setupOnly) throw Error('Independent procurement is a focused native Pest regression');
|
||||
args.splice(0, args.length, 'vendor/bin/pest', '--compact', 'tests/Feature/RequisitionLedgerAccountsTest.php', '--filter=office_with_independent_procurement');
|
||||
@@ -217,14 +256,21 @@ try {
|
||||
if (seed.status !== 0) throw Error('Native review fixture failed: '+(seed.stderr || seed.stdout || '').replaceAll(password, '[private]'));
|
||||
const fixture = JSON.parse(seed.stdout);
|
||||
fs.writeFileSync(path.join(root, 'native-review.json'), JSON.stringify(fixture));
|
||||
const assets = path.join(privateParent, 'sgc-legal-specific-precision-qa-20261128');
|
||||
const assets = path.join(privateParent, 'sgc-legacy-cancellation-qa-20261129');
|
||||
const manifest = fs.readFileSync(path.join(assets, 'manifest.json'));
|
||||
const manifestHash = crypto.createHash('sha256').update(manifest).digest('hex');
|
||||
if (manifestHash !== '9d415ba790aa602b36372d310a4eaa3426670fc521f15efb4166d782e170ac8e') throw Error('Unexpected private review manifest');
|
||||
if (manifestHash !== '99b072435a0b9eccb83d98ab36faceb23f98e510509d2175691269d1958083be') throw Error('Unexpected private review manifest');
|
||||
for (const entry of Object.values(JSON.parse(manifest))) {
|
||||
if (!fs.existsSync(path.join(assets, entry.file))) throw Error('Private review asset missing');
|
||||
}
|
||||
fs.cpSync(assets, path.join(root, 'public/build'), { recursive: true });
|
||||
const staticReviewAssets = ['favicon.ico', 'favicon.svg', 'apple-touch-icon.png'].map(file => {
|
||||
const source = path.join(workspace, 'public', file);
|
||||
if (fs.lstatSync(source).isSymbolicLink()) throw Error('Private review static links refused');
|
||||
const bytes = fs.readFileSync(source);
|
||||
fs.copyFileSync(source, path.join(root, 'public', file));
|
||||
return { file, sha256: crypto.createHash('sha256').update(bytes).digest('hex') };
|
||||
});
|
||||
if (nativeAuditSchemaOnly) {
|
||||
if (!frozenRuntime || !process.argv.includes('--integrated-schema')) throw Error('Audit schema inventory requires the pinned private composition');
|
||||
const schema = spawnSync('php', ['tests/Concurrency/requisition-account-worker.php', database, 'describe-private-audit-schema'], {
|
||||
@@ -271,6 +317,14 @@ try {
|
||||
await new Promise(resolve => setTimeout(resolve, 250));
|
||||
}
|
||||
if (!ready) throw Error('Native review server unavailable: '+diagnostic.replaceAll(password, '[private]'));
|
||||
const staticChecks = await Promise.allSettled(staticReviewAssets.map(async asset => {
|
||||
const response = await fetch(`${url}/${asset.file}`, { redirect: 'manual' });
|
||||
const bytes = Buffer.from(await response.arrayBuffer());
|
||||
if (response.status !== 200 || crypto.createHash('sha256').update(bytes).digest('hex') !== asset.sha256) throw Error('Private review static asset differs: '+asset.file);
|
||||
return asset;
|
||||
}));
|
||||
for (const check of staticChecks) if (check.status === 'rejected') throw check.reason;
|
||||
console.log(JSON.stringify({ private_native_static_assets_verified: true, files: staticChecks.map(check => check.value), operational_changes: false }));
|
||||
if (nativeOfficeOnly) {
|
||||
const { verifyOfficePurchaseHttp } = await import('./requisition-office-http-check.mjs');
|
||||
const result = await verifyOfficePurchaseHttp(url, fixture, async () => {
|
||||
@@ -306,6 +360,30 @@ try {
|
||||
if (reviewServer.exitCode !== null) throw Error('Private native review stopped unexpectedly');
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
}
|
||||
if (process.argv.includes('--conflict-release-preview')) {
|
||||
const state = spawnSync('php', ['tests/Concurrency/requisition-account-worker.php', database, 'read-native-conflict-release'], {
|
||||
cwd: workspace, windowsHide: true, encoding: 'utf8', maxBuffer: 1024 * 1024,
|
||||
env: { ...environment, SGC_REQUISITION_QA_ROOT: root },
|
||||
});
|
||||
if (state.status !== 0) throw Error('Native conflict conservation failed: '+(state.stderr || state.stdout || '').replaceAll(password, '[private]'));
|
||||
console.log(JSON.stringify({ private_native_conflict_release_verified: true, ...JSON.parse(state.stdout), private_manifest_sha256: manifestHash }));
|
||||
}
|
||||
if (process.argv.includes('--urgent-stock-preview')) {
|
||||
const state = spawnSync('php', ['tests/Concurrency/requisition-account-worker.php', database, 'read-native-urgent-stock'], {
|
||||
cwd: workspace, windowsHide: true, encoding: 'utf8', maxBuffer: 1024 * 1024,
|
||||
env: { ...environment, SGC_REQUISITION_QA_ROOT: root },
|
||||
});
|
||||
if (state.status !== 0 || !state.stdout.trim().startsWith('{')) throw Error('Native urgent stock conservation failed: '+(state.stderr || state.stdout || '').replaceAll(password, '[private]'));
|
||||
console.log(JSON.stringify({ private_native_urgent_stock_verified: true, ...JSON.parse(state.stdout), private_manifest_sha256: manifestHash }));
|
||||
}
|
||||
if (process.argv.includes('--order-cancellation-preview')) {
|
||||
const state = spawnSync('php', ['tests/Concurrency/requisition-account-worker.php', database, 'read-native-cancellation'], {
|
||||
cwd: workspace, windowsHide: true, encoding: 'utf8', maxBuffer: 1024 * 1024,
|
||||
env: { ...environment, SGC_REQUISITION_QA_ROOT: root },
|
||||
});
|
||||
if (state.status !== 0 || !state.stdout.trim().startsWith('{')) throw Error('Native cancellation conservation failed: '+(state.stderr || state.stdout || '').replaceAll(password, '[private]'));
|
||||
console.log(JSON.stringify({ private_native_cancellation_verified: true, ...JSON.parse(state.stdout), private_manifest_sha256: manifestHash }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,21 @@ export async function verifyOfficePurchaseHttp(origin, fixture, readState, progr
|
||||
current = await state();
|
||||
const requestId = current.request.id;
|
||||
const lineId = current.request.items[0].id;
|
||||
let capital = null;
|
||||
if (office.capital_register) {
|
||||
await post(buyer, '/projectos-imobilizado', { operation_key: crypto.randomUUID(), record_key: null, version: 0,
|
||||
type: 'project', code: office.capital_register.code, name: 'Projecto exclusivamente sintético do percurso HTTP',
|
||||
department_id: office.capital_register.department_id, equipment_id: null, reference: 'Origem documental fictícia de ensaio',
|
||||
state: 'active', reason: 'Cadastro próprio de Compras para conferir rastreabilidade sem dados reais' });
|
||||
const register = await buyer.page('/projectos-imobilizado', 'equipment/capital-register');
|
||||
capital = register.props.records.data.find(row => row.data.code === office.capital_register.code);
|
||||
check(capital !== undefined && capital.version === 1, 'own project created through native HTTP');
|
||||
const choices = await owner.page(`/requisicoes/${requestId}/projectos-imobilizado`, 'requisitions/capital-assignments');
|
||||
check(choices.props.canWrite && choices.props.choices.data.some(row => row.id === capital.id), 'request owner sees the native capital destination');
|
||||
await post(owner, `/requisicoes/${requestId}/projectos-imobilizado`, { operation_key: crypto.randomUUID(), version: 0,
|
||||
item_id: lineId, capital_id: capital.id, reason: 'Destino explícito da linha para o projecto estritamente sintético' });
|
||||
check((await owner.request('/projectos-imobilizado')).status === 403, 'assignment visibility does not grant the requester access to the register');
|
||||
}
|
||||
const accountPage = await owner.page(`/requisicoes/${requestId}/contas`, 'requisitions/accounts');
|
||||
const account = accountPage.props.accounts.data[0];
|
||||
check(account !== undefined, 'actual common movement account available');
|
||||
@@ -135,8 +150,32 @@ export async function verifyOfficePurchaseHttp(origin, fixture, readState, progr
|
||||
current = await state();
|
||||
check(current.order.id === orderId && current.financial_fingerprint === issued, 'order replay has no financial or document effect');
|
||||
check(Number(current.order.total_minor) === 10000 && current.order.account_assignments[lineId].data.allocations[0].account.id === account.id, 'order preserves exact amount and native chart attribution');
|
||||
check(current.order.budget_checked === true, 'new order preserves the budget authority confirmation already returned at issuance');
|
||||
if (capital) check(current.order.capital_assignments[lineId].snapshot.source.record_key === capital.record_key
|
||||
&& current.order.capital_assignments[lineId].snapshot.source.version === 1, 'issued order preserves the exact native project version');
|
||||
const financialDocumentsHref = `/facturas?purchase_order_id=${orderId}#invoice-documents`;
|
||||
const financeOrder = await finance.page(`/ordens/${orderId}`, 'purchases/show');
|
||||
check(financeOrder.props.financialDocumentsHref === financialDocumentsHref
|
||||
&& financeOrder.props.relatedProcesses.some(source => source.id === requestId && source.href === `/requisicoes/${requestId}/processo`), 'order navigation preserves exact financial and process context');
|
||||
const printRoute = `/ordens/${orderId}/imprimir`;
|
||||
const printHeaders = { 'X-Inertia': 'true', ...(financeOrder.version === null ? {} : { 'X-Inertia-Version': financeOrder.version }) };
|
||||
const printNavigation = await finance.request(printRoute, { headers: printHeaders });
|
||||
check(printNavigation.status === 409 && printNavigation.headers.get('x-inertia-location') === printRoute, 'authorised print navigation requests the complete HTML document');
|
||||
const printDocument = await finance.request(printRoute);
|
||||
check(printDocument.status === 200 && (await printDocument.text()).includes('Controlo orçamental registado na emissão.'), 'native controlled print preserves the actual budget confirmation');
|
||||
const privatePrint = await owner.request(printRoute, { headers: printHeaders });
|
||||
check(privatePrint.status === 403 && !privatePrint.headers.has('x-inertia-location'), 'requester receives no print redirect without native order access');
|
||||
const buyerOrder = await buyer.page(`/ordens/${orderId}`, 'purchases/show');
|
||||
// This synthetic buyer also has Admin; use the independent Procurement-only reviewer to test redaction.
|
||||
const independentOrder = await procurementReviewer.page(`/ordens/${orderId}`, 'purchases/show');
|
||||
check(buyerOrder.props.financialDocumentsHref === financialDocumentsHref && independentOrder.props.financialDocumentsHref === null,
|
||||
'order financial link follows native Admin/Finance access without Procurement inheritance');
|
||||
|
||||
stage('receipt_and_invoice');
|
||||
const financeReceipt = await finance.page(`/ordens/${orderId}/recepcoes`, 'receipts/order');
|
||||
const warehouseReceipt = await warehouse.page(`/ordens/${orderId}/recepcoes`, 'receipts/order');
|
||||
check(financeReceipt.props.financialDocumentsHref === financialDocumentsHref && warehouseReceipt.props.financialDocumentsHref === null,
|
||||
'receipt navigation exposes financial context only to the native reader');
|
||||
await post(warehouse, '/stock/artigos', { code: 'HTTP-OFFICE-QA', name: 'Material de escritório HTTP QA', unit: 'un' });
|
||||
current = await state();
|
||||
const receipt = { idempotency_key: crypto.randomUUID(), delivery_note: 'HTTP-OFFICE-DELIVERY-QA', received_on: date(0),
|
||||
@@ -145,6 +184,14 @@ export async function verifyOfficePurchaseHttp(origin, fixture, readState, progr
|
||||
await post(warehouse, `/ordens/${orderId}/recepcoes`, receipt, 201);
|
||||
current = await state();
|
||||
const received = current.financial_fingerprint;
|
||||
const confirmedReceiptId = current.order.receipts[0].id;
|
||||
const financialReceiptDetail = await finance.page(`/recepcoes/${confirmedReceiptId}`, 'receipts/show');
|
||||
const warehouseReceiptDetail = await warehouse.page(`/recepcoes/${confirmedReceiptId}`, 'receipts/show');
|
||||
check(financialReceiptDetail.props.financialDocumentsHref === financialDocumentsHref
|
||||
&& warehouseReceiptDetail.props.financialDocumentsHref === null,
|
||||
'confirmed receipt detail offers the exact financial context only to its native reader');
|
||||
current = await state();
|
||||
check(current.financial_fingerprint === received, 'receipt detail consultation preserves financial and stock sources');
|
||||
await post(warehouse, `/ordens/${orderId}/recepcoes`, receipt, 200);
|
||||
current = await state();
|
||||
check(current.financial_fingerprint === received && current.order.receipts.length === 1 && current.stock.movements === 1 && current.stock.quantity_milli === 1000, 'receipt replay preserves one physical movement');
|
||||
@@ -221,15 +268,27 @@ export async function verifyOfficePurchaseHttp(origin, fixture, readState, progr
|
||||
const report = await process.json();
|
||||
check(report.props.stages[7].state === 'restricted' && report.props.stages[8].state === 'restricted'
|
||||
&& !Object.hasOwn(report.props, 'invoices') && !Object.hasOwn(report.props, 'payments') && !Object.hasOwn(report.props, 'bank_snapshot'), 'requester process does not disclose financial or bank records');
|
||||
if (capital) {
|
||||
stage('project_trace');
|
||||
const beforeTrace = current.financial_fingerprint;
|
||||
const trace = await finance.page(`/projectos-imobilizado?history=${capital.record_key}`, 'equipment/capital-register');
|
||||
check(trace.props.trace.orders.data.some(row => row.order_id === orderId), 'project trace reaches its actual issued order');
|
||||
check(trace.props.trace.receipts.data.some(row => row.order_id === orderId), 'project trace reaches its actual physical receipt');
|
||||
check(trace.props.history.data[0].record_key === capital.record_key && trace.props.history.data[0].version === 1, 'project history remains its native version');
|
||||
current = await state();
|
||||
check(current.financial_fingerprint === beforeTrace, 'project trace consultation changes no financial or stock source');
|
||||
}
|
||||
for (const client of Object.values(clients)) await client.logout();
|
||||
return { checks, native_post_requests: commands, fortify_sessions: Object.keys(clients).length,
|
||||
request_id: requestId, order_id: orderId, invoice_id: invoiceId, payment_ids: current.payments.map(p => p.id),
|
||||
request_total_minor: current.request.total_minor, order_total_minor: current.order.total_minor, invoice_total_minor: current.invoice.total_minor,
|
||||
confirmed_payments_minor: current.payments.map(p => p.amount_minor), outstanding_minor: current.invoice.outstanding_minor,
|
||||
budget_consumed_minor: current.budget.balance.consumed_minor, budget_available_minor: current.budget.balance.available_minor,
|
||||
order_budget_checked: current.order.budget_checked,
|
||||
stock_quantity_milli: current.stock.quantity_milli, stock_movements: current.stock.movements, journals: current.journals,
|
||||
explicit_finance_category_total_minor: current.analytics.category_attribution.groups.data[0].amount_minor,
|
||||
all_business_mutations_via_native_http: true, assertions_use_readonly_transactions: true, budget_balance_via_native_http: true,
|
||||
selector_self_final_approval_refused: selectorRefused, synthetic_only: true,
|
||||
project_trace: capital ? { record_key: capital.record_key, code: capital.data.code, version: capital.version, order_id: orderId } : null,
|
||||
real_bank_or_sgf_operations: false, browser_visual_acceptance: false };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user