Skip to content

SudoSOS Back-end API / internal/pdf/invoice-pdf-service / InvoicePdfService

Class: InvoicePdfService ​

Stored PDF service. Uses BasePdfService to produce bytes then uploads and returns the Pdf entity.

Extends ​

Constructors ​

Constructor ​

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

Parameters ​

ParameterType
fileLocationstring
manager?EntityManager

Returns ​

InvoicePdfService

Inherited from ​

PdfService.constructor

Properties ​

PropertyModifierTypeDefault valueOverridesInherited from
clientpublicClientundefined-PdfService.client
fileServicepublicFileServiceundefined-PdfService.fileService
managerprotectedEntityManagerundefined-PdfService.manager
pdfConstructorpublictypeof InvoicePdfInvoicePdfPdfService.pdfConstructor-
routeConstructorpublictypeof InvoiceRouteParamsInvoiceRouteParamsPdfService.routeConstructor-
stationarypublicstring'BAC'-PdfService.stationary

Methods ​

createPdfBuffer() ​

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

Core method that generates and returns the PDF bytes.

Parameters ​

ParameterType
entityInvoice

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

PdfService.createPdfBuffer


createPdfWithEntity() ​

ts
createPdfWithEntity(entity): Promise<InvoicePdf>;

Persist the generated PDF and return the stored Pdf entity.

Parameters ​

ParameterType
entityInvoice

Returns ​

Promise<InvoicePdf>

Inherited from ​

PdfService.createPdfWithEntity


createRaw() ​

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

Create raw output such as TEX or HTML bytes for preview or debugging.

Parameters ​

ParameterType
entityInvoice

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

PdfService.createRaw


createTex() ​

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

Parameters ​

ParameterType
entityInvoice

Returns ​

Promise<Buffer<ArrayBufferLike>>

Deprecated ​

Use createRaw() instead

Inherited from ​

PdfService.createTex


generator() ​

ts
generator(routeParams): Promise<FileResponse>;

Parameters ​

ParameterType
routeParamsInvoiceRouteParams

Returns ​

Promise<FileResponse>

Overrides ​

PdfService.generator


getFileSettings() ​

ts
protected getFileSettings(fileType?): FileSettings;

Parameters ​

ParameterTypeDefault value
fileTypeReturnFileTypeReturnFileType.PDF

Returns ​

FileSettings

Inherited from ​

PdfService.getFileSettings


getParameters() ​

ts
getParameters(entity): Promise<InvoiceParameters>;

Parameters ​

ParameterType
entityInvoice

Returns ​

Promise<InvoiceParameters>

Overrides ​

PdfService.getParameters


getRouteParams() ​

ts
getRouteParams(entity, fileType?): Promise<InvoiceRouteParams>;

Parameters ​

ParameterTypeDefault value
entityInvoiceundefined
fileTypeReturnFileTypeReturnFileType.PDF

Returns ​

Promise<InvoiceRouteParams>

Inherited from ​

PdfService.getRouteParams


invoiceToPricing() ​

ts
invoiceToPricing(invoice): TotalPricing;

Parameters ​

ParameterType
invoiceInvoice

Returns ​

TotalPricing


getClient() ​

ts
static getClient(url): Client;

Parameters ​

ParameterType
urlstring

Returns ​

Client

Inherited from ​

PdfService.getClient