Skip to content

SudoSOS Back-end API / write-offs / WriteOff

Class: WriteOff ​

Extends ​

Constructors ​

Constructor ​

ts
new WriteOff(): WriteOff;

Returns ​

WriteOff

Inherited from ​

ts
PdfAble(BaseEntity).constructor

Properties ​

PropertyModifierTypeDescriptionOverridesInherited from
amountpublicDinero---
createdAtreadonlyDate--PdfAble(BaseEntity).createdAt
idreadonlynumber--PdfAble(BaseEntity).id
pdf?publicWriteOffPdfThe Pdf file.PdfAble(BaseEntity).pdf-
pdfId?publicnumberThe id of the Pdf file.PdfAble(BaseEntity).pdfId-
pdfServicepublicWriteOffPdfServiceThe service that creates the Pdf file. Can be either a byte-producing service plus optionally a stored-entity service.PdfAble(BaseEntity).pdfService-
topublicUser---
transfer?publicTransfer---
updatedAtreadonlyDate--PdfAble(BaseEntity).updatedAt
versionreadonlynumber--PdfAble(BaseEntity).version

Methods ​

createPdf() ​

ts
createPdf(): Promise<Pdf>;

Create and persist the Pdf file, returning the Pdf entity. The configured pdfService must implement createPdfWithEntity, otherwise this throws.

Returns ​

Promise<Pdf>

Inherited from ​

ts
PdfAble(BaseEntity).createPdf

getOrCreatePdf() ​

ts
getOrCreatePdf(force?): Promise<Pdf>;

Get the Pdf file. If the Pdf file is not current, create it.

Parameters ​

ParameterTypeDefault valueDescription
forcebooleanfalseIf true, always create the Pdf file.

Returns ​

Promise<Pdf>

Inherited from ​

ts
PdfAble(BaseEntity).getOrCreatePdf

getOwner() ​

ts
getOwner(): Promise<User>;

Get the owner of the Pdf file.

Returns ​

Promise<User>

Overrides ​

ts
PdfAble(BaseEntity).getOwner

getPdfParamHash() ​

ts
getPdfParamHash(): Promise<string>;

Get the hash of the parameters of the Pdf file.

Returns ​

Promise<string>

Inherited from ​

ts
PdfAble(BaseEntity).getPdfParamHash

validatePdfHash() ​

ts
validatePdfHash(): Promise<boolean>;

Validates if the Pdf matches the stored hash.

Returns ​

Promise<boolean>

Inherited from ​

ts
PdfAble(BaseEntity).validatePdfHash