refactoring
This commit is contained in:
@@ -1,14 +1,17 @@
|
|||||||
class PdfCreator {
|
class PdfCreator {
|
||||||
|
|
||||||
static createPdf({ symptom, vaccine, heading, valueName }) {
|
static createPdf(pdf) {
|
||||||
const documentDefinition = {
|
return pdfMake.createPdf(PdfCreator.#createDocumentDefinition(pdf));
|
||||||
|
}
|
||||||
|
|
||||||
|
static #createDocumentDefinition({ symptom, vaccine, heading, valueName }) {
|
||||||
|
return {
|
||||||
content: [
|
content: [
|
||||||
PdfCreator.#getPageHeading(heading),
|
PdfCreator.#getPageHeading(heading),
|
||||||
...PdfCreator.#getWorstDrugsSection(symptom, valueName),
|
...PdfCreator.#getWorstDrugsSection(symptom, valueName),
|
||||||
...PdfCreator.#getStrongestSymptomsSection(vaccine)
|
...PdfCreator.#getStrongestSymptomsSection(vaccine)
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
return pdfMake.createPdf(documentDefinition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static #getPageHeading(heading) {
|
static #getPageHeading(heading) {
|
||||||
|
|||||||
Reference in New Issue
Block a user