Giter Site home page Giter Site logo

en10168-schemas's Introduction

EN10168-schemas

EN10168 Schema CI FOSSA Status

The EN10168.schema.json is an implementation of the European Union steel standards of the same name. This repository contains translations and templates used for HTML / PDF rendering of EN10168 certificates.

Docs

Full documentation

Tests

To run the PDF rendering tests we use pdf2image lib. Please refer to this guide to install required dependencies.

Editing a local partial

When editing a local partial such as inspection.hbs, run the script npm run set-local-paths to use the local partials for HTML rendering instead of the remote ones. The paths will be updated automatically when a release is made using the update-version script.

Testing a locally updated schema definition

When you update a schema definition locally, you will want to test it before releasing it. To do so, open the schema.json file, and change the $id value to schema.json. Then update the $ref of the updated definition with an absolute path to the updated definition, plus the following string: #/definitions/<definition name>.

For example, to test an updated Company definition, the schema.json should look like this:

{
"$id": "schema.json",
  "definitions": {
    ...
    "Company": {
      "allOf": [
        {
          "$ref": "/Users/<username>/s1seven/schema-definitions/company/company.json#/definitions/Company"
        }
      ]
    },
  }
}

After testing and the release of the schema definition, simply return the $id to its previous value and the $ref to the uri of the newly released schema definition.

If you have trouble loading the file, you can temporarily update the property loadSchema in createAjvInstance in validate.spec.js to the following to debug the filepath:

    loadSchema: (uri) => {
      if (!uri.startsWith('http')) {
        console.log(uri);
      }
      return loadExternalFile(uri, 'json');
    },

Updating the partial versions in schema.json

First, update defaultSchemaDefinitionsVersion in utils/constants.js to the latest version number.

Then run npm run update-version.

License

FOSSA Status

en10168-schemas's People

Contributors

aaa123eee avatar ca07 avatar eamon0989 avatar fossabot avatar getlarge avatar stiebitzhofer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fossabot

en10168-schemas's Issues

Validation against schema provided by URL not the local schema

In the script validate_spec.js in line 13 the local schema.json is set.

    const schemaPath = resolve(__dirname, '../schema.json');

However, the actual validation is still executed against the schema provided in RefSchemaUrl, which is not the idea I assume.

[EP] Change type of A97 to `string`

Describe the problem

A typical order number including its position in SAP looks like

20502841 000020

with

  • 20502841 as the order number
  • 000020 as the position number.

In the current design, the order position number (A97) is of type number so the result would be 20.

Specify the details

The solution is to change

        "A97": {
          "description": "A custom field for the position number in the order",
          "type": "number"
        },

to

        "A97": {
          "description": "A custom field for the position number in the order",
          "type": "string"
        },

Explain the benefits

Users will be able to read SAP position numbers according to their expectations.

[BUG] Supplementary Information C04-C09 not rendered in HTML

Describe the bug
The section SupplementaryInformation with the fields C04-C09 are not rendered in HTML.

To Reproduce
Steps to reproduce the behavior:

  1. Compare the HTML and PDF rendering of test/fixtures/valid_certificate_4.json.

Expected behavior
Supplementary information is rendered on HTML the same way as on PDF.

[EP] Adopt normative description for A06

Describe the problem

In the current implementation, the term "Purchaser" and its translations are used as section designations for the field A06. In EN 10168, appendix A normative terms are defined.

Specify the details

Substitute the value for A06 in

DE.json with Besteller/Empfänger
EN.json with Customer/consignee
FR.json with Acheteur/destinataire
PL.json with Klient/odbiorca

Explain the benefits

The section designations comply with EN 10168.

[EP] - Make `Identifiers` optional

Describe the problem

In ERPs receivers of certificates are not necessarily mapped or linked with legal entities. Therefore an identifier such as VAT or DUNS is not available by default for the generation of material certificates, only the email address is maintained.

To reduce effort and therefore friction in switching receivers to digital material certificates the email address is initially sufficient.

Specify the details

  • Switch identifiers in company.json to optional.

Explain the benefits

Issuers can switch receivers of certificates without having to add VAT and/or DUNS.

[EP] Assign A96 the value delivery date

Describe the problem

In EN 10168 there is no field assigned to the delivery date.

Specify the details

A detailed description of additions, deletions, or modifications proposed

Add to schema.json

  "A96": {
    "description": "A custom field for the delivery date",
    "type": "date"
  },

Update SupplementaryInformation with

 "SupplementaryInformation": {
  "title": "CommercialTransactionSupplementaryInformation",
  "type": "object",
  "propertyNames": {
    "pattern": "^A1[0-9]|^A[2-8][0-9]|^A[2-9][0-5]"
  },
  "patternProperties": {
    "^A1[0-9]|^A[2-8][0-9]|^A[2-9][0-5]": {
      "$ref": "#/definitions/KeyValueObject"
    }
  },
  "additionalProperties": false
},

Explain the benefits

A fixed field for the delivery date is assigned.

[EP] - Provide numeric values as defined by rounding rules of standards for Chemical Analysis

Describe the problem

Standards defines a specific number of digits after the comma for the minimum, maximum and actual value of the share of chemical elements. See https://www.astm.org/e0029-22.html and https://www.eng-tips.com/viewthread.cfm?qid=380053

The current Schema definition for ChemicalElements defines the minimum, maximum andactual value as number. By that zeros after the comma separator are skipped in the PDF and HTML rendering.

Example Maxium: 1.50 in JSON results in Maximum: 1.5 but should be Maximum: 1.50 on PDF.

Specify the details

  • Change the type for Actual, Minimum and Maximum to String.
  • Adapt rendering of numbers so that all digits after the comma are preserved and language specific conventions for commas are applied.

Explain the benefits

The data format and the rendering complies to the standards and practice of the material industries.

[EP] update FOSSA integration

Describe the problem

The FOSSA integration is currently broken and the analysis is not executed during PR and merge.
I updated the authorization for material-identity and that was the occasion to dig into their docs.
It seems like there is a more efficient way to run the analysis than by using webhooks and since the analysis was always rather slow it got my attention.
So i suggest that we integrate this new process.

Specify the details

See https://docs.fossa.com/docs/provided-builds

Explain the benefits

See https://docs.fossa.com/docs/provided-builds#pros

[EP] Make Z04 optional

Describe the problem

Companies issue certificates without having CE, which is required only from some applications such as steel construction.

Specify the details

Remove Z04 from the list of required elements of object Validation in schema.json.

Explain the benefits

The schema supports certificates without CE requirements.

[EP] Identifying Companies

Describe the problem

Instead of using "VAT_Id" as the unique identifier for companies, DUNS could be also an appropriate option.
VAT Ids does not exist internationally, e.g. there is no vat id in USA.

Specify the details

DUNS -> Data Universal Numbering System, please see also: https://en.wikipedia.org/wiki/Data_Universal_Numbering_System
DUNS is an international standard and has a very broad adoption.

Explain the benefits

Extend the us market adoption

[EP] Create a Handlebars partials map

Describe the problem

Since we changed our HTML rendering strategy to use partials inside the main template, it introduced the problem of knowing where the partials are located before compiling all the Handlebars pieces.

Specify the details

In order to help resolving the external partials consumed in template.hbs, i suggest that we create a new static resource that can be used to contain references and links to the partials.
This resource could be a JSON file containing a map {[partialName]: path} to download and would allow to easily lookup the partials before rendering the HTML .

Explain the benefits

Make HTML rendering easier for end user of the schema resources and tools.

[EP] Add script to generate readable schema

Describe the problem

The JSON Schema is split up into generic parts easying reuse. For practical reasons, having one file containing the complete JSON Schema would be handy.

Specify the details

  • Add the script https://github.com/material-identity/CoA-schemas/blob/main/utils/generate-readable-schema-cli.js to this repo.
  • Add task to package.json.

Explain the benefits

JSON Schema is easy to work with in many cases.

[EP] Update schema-tool libraries

Describe the problem

The current libraries do not support new features as support for Chinese language and PDF/A-S compatibility.

Specify the details

  • Update schema-tool libraries
  • Update other libraries too
  • Update the tests (as PDF outputs change)

Explain the benefits

Support of latest features

[EP] Change format for Z02 from 'date-time' to 'date'

Describe the problem

The element Z02 contains the issuing date of the declaration of compliance. Currently, the format definition is date-time requiring time information. As there is no time information available on certificates it is suggested to change to date removing the need to "invent" a hours and minutes.

Specify the details

Change the section in schema.json from

        "Z02": {
          "description": "Date of issue and validation",
          "type": "string",
          "format": "date-time"
        },

to

        "Z02": {
          "description": "Date of issue and validation",
          "type": "string",
          "format": "date"
        },

Explain the benefits

Simplification in creation, rendering, and processing.

[BUG] Attribute label "Description" not rendered for form "Other"

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

[EP] Improve RefSchemaUrl format

Describe the problem

Currently the RefSchemaUrl property uses the uri format, which is already a good validation, but why not going further and create a custom regexp pattern to validate it ?

Specify the details

Add (or replace the format by) a pattern property.

Explain the benefits

Since the expected pattern is clearly defined here, it could provide an extra safe guard during certificates validation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.