Skip to content

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 ​

ts
new SellerPayoutPdfService(fileLocation, manager?): SellerPayoutPdfService;

Parameters ​

ParameterType
fileLocationstring
manager?EntityManager

Returns ​

SellerPayoutPdfService

Inherited from ​

HtmlPdfService.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionOverridesInherited from
clientprotectedClientundefined--HtmlPdfService.client
fileServicepublicFileServiceundefined--HtmlPdfService.fileService
htmlGeneratorpublic(options) => stringcreateSellerPayoutPdfThe function that generates the HTML. This function should take a data object and return the complete HTML string.HtmlPdfService.htmlGenerator-
htmlPdfGenUrlprotectedstringundefined--HtmlPdfService.htmlPdfGenUrl
managerprotectedEntityManagerundefined--HtmlPdfService.manager
pdfConstructorpublictypeof SellerPayoutPdfSellerPayoutPdf-HtmlPdfService.pdfConstructor-

Methods ​

compileHtml() ​

ts
protected compileHtml(html): Promise<Buffer<ArrayBufferLike>>;

Compile HTML to PDF using the external service.

Parameters ​

ParameterType
htmlstring

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

HtmlPdfService.compileHtml


configureLogger() ​

ts
protected configureLogger(logger): void;

Parameters ​

ParameterType
loggerLogger

Returns ​

void

Inherited from ​

HtmlPdfService.configureLogger


createPdfBuffer() ​

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

Create a PDF and return bytes.

Parameters ​

ParameterType
entitySellerPayout

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

HtmlPdfService.createPdfBuffer


createPdfWithEntity() ​

ts
createPdfWithEntity(entity): Promise<SellerPayoutPdf>;

Persist the generated PDF and return the stored Pdf entity.

Parameters ​

ParameterType
entitySellerPayout

Returns ​

Promise<SellerPayoutPdf>

Inherited from ​

HtmlPdfService.createPdfWithEntity


createRaw() ​

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

Create raw HTML output (for debugging or preview).

Parameters ​

ParameterType
entitySellerPayout

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

HtmlPdfService.createRaw


getHtml() ​

ts
protected getHtml(entity): Promise<string>;

Apply parameters to the template and return the complete HTML.

Parameters ​

ParameterType
entitySellerPayout

Returns ​

Promise<string>

Inherited from ​

HtmlPdfService.getHtml


getParameters() ​

ts
getParameters(entity): Promise<ISellerPayoutPdf>;

Get the data object to use with the HTML template.

Parameters ​

ParameterType
entitySellerPayout

Returns ​

Promise<ISellerPayoutPdf>

Overrides ​

HtmlPdfService.getParameters