18 lines
674 B
TypeScript
18 lines
674 B
TypeScript
import fs from 'fs';
|
|
import { validateCertificateAgainstStandard } from './services/validationEngine';
|
|
|
|
const std = JSON.parse(fs.readFileSync('./data/standards.json', 'utf8'))[0];
|
|
const report: any = {
|
|
identification: { product: "PERFIL I", standards: "ASTM A572 GR50" },
|
|
compliance: {
|
|
mechanical: [
|
|
{ property: "Yield Strength (Limite de Escoamento)", certificate: "415 MPa", status: "OK" },
|
|
{ property: "Tensile Strength (Limite de Resistência)", certificate: "547 MPa", status: "OK" }
|
|
],
|
|
chemical: []
|
|
}
|
|
};
|
|
|
|
const result = validateCertificateAgainstStandard(report, std);
|
|
console.log(JSON.stringify(result.compliance.mechanical, null, 2));
|