SudoSOS Back-end API / internal/pdf/seller-payout-pdf-service / SellerPayoutPdfService
Class: SellerPayoutPdfService ​
HTML-to-PDF service for entities that store PDFs. Similar to PdfService but uses HTML templates instead of LaTeX.
Extends ​
Constructors ​
Constructor ​
new SellerPayoutPdfService(fileLocation, manager?): SellerPayoutPdfService;Parameters ​
| Parameter | Type |
|---|---|
fileLocation | string |
manager? | EntityManager |
Returns ​
SellerPayoutPdfService
Inherited from ​
Properties ​
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
|---|---|---|---|---|---|---|
client | protected | Client | undefined | - | - | HtmlPdfService.client |
fileService | public | FileService | undefined | - | - | HtmlPdfService.fileService |
htmlGenerator | public | (options) => string | createSellerPayoutPdf | The function that generates the HTML. This function should take a data object and return the complete HTML string. | HtmlPdfService.htmlGenerator | - |
htmlPdfGenUrl | protected | string | undefined | - | - | HtmlPdfService.htmlPdfGenUrl |
manager | protected | EntityManager | undefined | - | - | HtmlPdfService.manager |
pdfConstructor | public | typeof SellerPayoutPdf | SellerPayoutPdf | - | HtmlPdfService.pdfConstructor | - |
Methods ​
compileHtml() ​
protected compileHtml(html): Promise<Buffer<ArrayBufferLike>>;Compile HTML to PDF using the external service.
Parameters ​
| Parameter | Type |
|---|---|
html | string |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
configureLogger() ​
protected configureLogger(logger): void;Parameters ​
| Parameter | Type |
|---|---|
logger | Logger |
Returns ​
void
Inherited from ​
HtmlPdfService.configureLogger
createPdfBuffer() ​
createPdfBuffer(entity): Promise<Buffer<ArrayBufferLike>>;Create a PDF and return bytes.
Parameters ​
| Parameter | Type |
|---|---|
entity | SellerPayout |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
HtmlPdfService.createPdfBuffer
createPdfWithEntity() ​
createPdfWithEntity(entity): Promise<SellerPayoutPdf>;Persist the generated PDF and return the stored Pdf entity.
Parameters ​
| Parameter | Type |
|---|---|
entity | SellerPayout |
Returns ​
Promise<SellerPayoutPdf>
Inherited from ​
HtmlPdfService.createPdfWithEntity
createRaw() ​
createRaw(entity): Promise<Buffer<ArrayBufferLike>>;Create raw HTML output (for debugging or preview).
Parameters ​
| Parameter | Type |
|---|---|
entity | SellerPayout |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
getHtml() ​
protected getHtml(entity): Promise<string>;Apply parameters to the template and return the complete HTML.
Parameters ​
| Parameter | Type |
|---|---|
entity | SellerPayout |
Returns ​
Promise<string>
Inherited from ​
getParameters() ​
getParameters(entity): Promise<ISellerPayoutPdf>;Get the data object to use with the HTML template.
Parameters ​
| Parameter | Type |
|---|---|
entity | SellerPayout |
Returns ​
Promise<ISellerPayoutPdf>