SudoSOS Back-end API / write-offs / WriteOff
Class: WriteOff ​
Extends ​
PdfAbleClass<typeofBaseEntity,this> &BaseEntity<this>
Constructors ​
Constructor ​
ts
new WriteOff(): WriteOff;Returns ​
WriteOff
Inherited from ​
ts
PdfAble(BaseEntity).constructorProperties ​
| Property | Modifier | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|---|
amount | public | Dinero | - | - | - |
createdAt | readonly | Date | - | - | PdfAble(BaseEntity).createdAt |
id | readonly | number | - | - | PdfAble(BaseEntity).id |
pdf? | public | WriteOffPdf | The Pdf file. | PdfAble(BaseEntity).pdf | - |
pdfId? | public | number | The id of the Pdf file. | PdfAble(BaseEntity).pdfId | - |
pdfService | public | WriteOffPdfService | The service that creates the Pdf file. Can be either a byte-producing service plus optionally a stored-entity service. | PdfAble(BaseEntity).pdfService | - |
to | public | User | - | - | - |
transfer? | public | Transfer | - | - | - |
updatedAt | readonly | Date | - | - | PdfAble(BaseEntity).updatedAt |
version | readonly | number | - | - | 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).createPdfgetOrCreatePdf() ​
ts
getOrCreatePdf(force?): Promise<Pdf>;Get the Pdf file. If the Pdf file is not current, create it.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
force | boolean | false | If true, always create the Pdf file. |
Returns ​
Promise<Pdf>
Inherited from ​
ts
PdfAble(BaseEntity).getOrCreatePdfgetOwner() ​
ts
getOwner(): Promise<User>;Get the owner of the Pdf file.
Returns ​
Promise<User>
Overrides ​
ts
PdfAble(BaseEntity).getOwnergetPdfParamHash() ​
ts
getPdfParamHash(): Promise<string>;Get the hash of the parameters of the Pdf file.
Returns ​
Promise<string>
Inherited from ​
ts
PdfAble(BaseEntity).getPdfParamHashvalidatePdfHash() ​
ts
validatePdfHash(): Promise<boolean>;Validates if the Pdf matches the stored hash.
Returns ​
Promise<boolean>
Inherited from ​
ts
PdfAble(BaseEntity).validatePdfHash