Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

ministryofjustice/case_file_editor

Repository files navigation

Case File Editor

Edit digital case files.

Current status

This is able to ingest JSON-formatted digital case files into an internal model, validate the data, and export it again in JSON format.

Most validations are implemented, with the exception of those that require knowledge of the whole case file. These are indicated with # TODO in the app/models directory.

This is based on the JSON schema Version 1.1.0 Draft 5.

An example file can be found in spec/fixtures/example_01.json.

Examples

Import

dcf = CaseImporter.new(JSON.parse(casefile_as_json)).import

Validate

RecursiveValidator.new(dcf).errors
{:defendants=>{0=>{:signed_charge_sheet=>["is not included in the list"]}},
 :multimedia_evidence=>
   {0=>
     {:relied_upon_trial=>["is not included in the list"],
      :relied_upon_sentence=>["is not included in the list"]}}}

Export

casefile_json = JSON.pretty_generate(CaseExporter.new(dcf).export)

About

An editor for digital case files.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published