31 lines
821 B
TypeScript
31 lines
821 B
TypeScript
import { validateCertificateAgainstStandard } from './services/validationEngine';
|
|
import * as fs from 'fs';
|
|
|
|
const standards = JSON.parse(fs.readFileSync('./data/standards.json', 'utf8'));
|
|
|
|
const report = {
|
|
identification: {
|
|
product: "CHAPA GROSSA DO LCG 19,00 x 2500,0 x 12000 mm"
|
|
},
|
|
compliance: {
|
|
chemical: [],
|
|
mechanical: [
|
|
{
|
|
property: "Yield Strength (Limite de Escoamento)",
|
|
certificate: "436 N/mm²"
|
|
},
|
|
{
|
|
property: "Tensile Strength (Limite de Resistência)",
|
|
certificate: "567 N/mm²"
|
|
},
|
|
{
|
|
property: "Elongation (Alongamento)",
|
|
certificate: "29 %"
|
|
}
|
|
]
|
|
}
|
|
};
|
|
|
|
const result = validateCertificateAgainstStandard(report as any, standards[0]);
|
|
console.log(JSON.stringify(result.compliance.mechanical, null, 2));
|