Skip to content

SudoSOS Back-end API / internal/pdf/write-off-pdf-service / WriteOffPdfService

Class: WriteOffPdfService ​

A PdfService whose output is a record we send to people. Once stored, the PDF is frozen (#141): it is returned as-is, and only re-rendered when force is set or its hash was cleared to mark it stale.

Extends ​

Constructors ​

Constructor ​

ts
new WriteOffPdfService(manager?): WriteOffPdfService;

Parameters ​

ParameterType
manager?EntityManager

Returns ​

WriteOffPdfService

Inherited from ​

StoredPdfService.constructor

Properties ​

PropertyModifierTypeDefault valueOverridesInherited from
locationreadonly"./data/write_offs"WRITE_OFF_PDF_LOCATIONStoredPdfService.location-
managerprotectedEntityManagerundefined-StoredPdfService.manager
pdfConstructorreadonlytypeof WriteOffPdfWriteOffPdfStoredPdfService.pdfConstructor-
renderpublic(options) => stringcreateWriteOffPdfStoredPdfService.render-

Methods ​

compile() ​

ts
protected compile(params): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
paramsIWriteOffPdf

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

StoredPdfService.compile


configureLogger() ​

ts
protected configureLogger(logger): void;

Parameters ​

ParameterType
loggerLogger

Returns ​

void

Inherited from ​

StoredPdfService.configureLogger


getOrCreate() ​

ts
getOrCreate(entity, force?): Promise<WriteOffPdf>;

Parameters ​

ParameterTypeDefault value
entityWriteOffundefined
forcebooleanfalse

Returns ​

Promise<WriteOffPdf>

Inherited from ​

StoredPdfService.getOrCreate


getOwner() ​

ts
getOwner(entity): User;

Parameters ​

ParameterType
entityWriteOff

Returns ​

User

Overrides ​

StoredPdfService.getOwner


getParameters() ​

ts
getParameters(entity): Promise<IWriteOffPdf>;

Parameters ​

ParameterType
entityWriteOff

Returns ​

Promise<IWriteOffPdf>

Overrides ​

StoredPdfService.getParameters


html() ​

ts
html(entity): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityWriteOff

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

StoredPdfService.html


output() ​

ts
output(entity, fileType): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityWriteOff
fileTypeReturnFileType

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

StoredPdfService.output


pdf() ​

ts
pdf(entity): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityWriteOff

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

StoredPdfService.pdf