The Companies house Document Generator for generating documents
In order to build document-generator locally you will need the following:
- Run make
- Run ./start.sh
The supported environmental variables have been categorised by use case and are as follows.
Name | Description | Mandatory | Default | Example |
---|---|---|---|---|
DOCUMENT_RENDER_SERVICE_HOST | Render service host | ✓ | localhost:valid_port_number | |
DOCUMENT_BUCKET_NAME | Bucket name to store the document | ✓ | dev-pdf-bucket/name_of_file | |
API_URL | Api url to go through eric | ✓ | api.orctel.internal:$ERIC_PORT | |
CHS_API_KEY | Chs api key encoded and used to make APi calls | ✓ | valid Api key |
The following are the modules that exist within document generator.
The document-generator-api module is a sub module within document-generator, it holds the api controller which is called passing resourceUri and mimeType to uri /private/documents/generate. The api deals with requesting the data to be rendered through the document-generator-interface, as well as making the call to the render service to generate a document. The details of the api request and response can be seen within document-generator-api/swagger-2.0/models
The document-generator-interface module is a sub module within document-generator, it holds the interface DocumentInfoService that contains the methods to getDocumentInfo in order to return the DocumentInfo model. Which will contain String data, String templateName, String assetId, String path, String descriptionIdentifier and a Map<String, String> description Values.
The document-generator-accounts module is a sub module within document-generator, it holds the accounts specific implementation of the DocumentInfoService that contains the method getDocumentInfo. Which returns the DocumentInfo model which will contain String data, String templateName, String assetId, String path, String descriptionIdentifier and a Map<String, String> description Values.
The document-generator-prosecution module is a sub module within document-generator, which is the prosecution implementation of the DocumentInfoService that contains the method getDocumentInfo. Which returns the DocumentInfo model which will contain String data, String templateName, String assetId, String path, String descriptionIdentifier and a Map<String, String> description Values for Ultimatum and SJP letters.