task-h.5.3
This commit is contained in:
@@ -51,9 +51,18 @@ async function main() {
|
||||
const signatures = payload.documentData.signatures as Record<string, unknown>;
|
||||
return key in signatures;
|
||||
});
|
||||
const priceTable = payload.templateInput.quotation_price_data;
|
||||
const firstPriceRow = Array.isArray(priceTable) && Array.isArray(priceTable[0]) ? priceTable[0] : null;
|
||||
const priceTableParity =
|
||||
Array.isArray(priceTable) &&
|
||||
Array.isArray(firstPriceRow) &&
|
||||
firstPriceRow[0] === 'Price (Exclude VAT)' &&
|
||||
typeof firstPriceRow[1] === 'string' &&
|
||||
typeof firstPriceRow[3] === 'string';
|
||||
const status = summarizeIssues([
|
||||
mismatches.length ? 'FAIL' : 'PASS',
|
||||
signatureParity ? 'PASS' : 'FAIL'
|
||||
signatureParity ? 'PASS' : 'FAIL',
|
||||
priceTableParity ? 'PASS' : 'FAIL'
|
||||
]);
|
||||
const report = {
|
||||
audit: 'payload-parity',
|
||||
@@ -65,7 +74,10 @@ async function main() {
|
||||
mismatches,
|
||||
comparableFieldCount: Object.keys(payload.templateInput).length,
|
||||
topicInputKeyCount: Object.keys(payload.topicInputs).length,
|
||||
signatureParity
|
||||
signatureParity,
|
||||
priceTableParity,
|
||||
priceTableRowCount: Array.isArray(priceTable) ? priceTable.length : 0,
|
||||
priceTableCurrency: Array.isArray(firstPriceRow) ? firstPriceRow[3] ?? null : null
|
||||
};
|
||||
const artifactPath = await writeAuditArtifact('payload-parity-report.json', report);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user