Skip to content

SudoSOS Back-end API / transactions / Transaction

Class: Transaction ​

TypeORM entity for the transaction table. Holds the buyer-side record of one purchase at a PointOfSale. The actual product lines and seller-side credits live on the related SubTransactions, which cascade on save.

Extends ​

Extended by ​

Constructors ​

Constructor ​

ts
new Transaction(): Transaction;

Returns ​

Transaction

Inherited from ​

ts
UnstoredPdfAble(BaseEntity).constructor

Properties ​

PropertyModifierTypeDescriptionOverridesInherited from
createdAtreadonlyDate--UnstoredPdfAble(BaseEntity).createdAt
createdBypublicUser---
frompublicUser---
idreadonlynumber--UnstoredPdfAble(BaseEntity).id
pdfServicepublicTransactionPdfServiceThe service that creates the Pdf buffer. Can be either a LaTeX-based service (UnstoredPdfService) or HTML-based service (HtmlUnstoredPdfService).UnstoredPdfAble(BaseEntity).pdfService-
pointOfSalepublicPointOfSaleRevision---
subTransactionspublicSubTransaction[]---
updatedAtreadonlyDate--UnstoredPdfAble(BaseEntity).updatedAt
versionreadonlynumber--UnstoredPdfAble(BaseEntity).version

Methods ​

createPdf() ​

ts
createPdf(): Promise<Buffer<ArrayBufferLike>>;

Create the Pdf buffer. This method generates the PDF and returns it as a Buffer.

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

ts
UnstoredPdfAble(BaseEntity).createPdf

createRaw() ​

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

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

ts
UnstoredPdfAble(BaseEntity).createRaw

createTex() ​

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

Returns ​

Promise<Buffer<ArrayBufferLike>>

Deprecated ​

Use createRaw() instead

Inherited from ​

ts
UnstoredPdfAble(BaseEntity).createTex

getPdfParamHash() ​

ts
getPdfParamHash(): Promise<string>;

Returns ​

Promise<string>

Inherited from ​

ts
UnstoredPdfAble(BaseEntity).getPdfParamHash