@withpotter/transaction — module reference

HTTP routes this module mounts, plus its internal use-cases, entities, and repositories. The exhaustive request/response contract is the engine’s OpenAPI document at /docs; the layered structure below follows the package internal architecture.

HTTP routes

Finance /finance

MethodPathAuthDescription
GET/finance/dashboardYesGet finance dashboard with summary and charts
GET/finance/transactionsYesList all transactions for the tenant
GET/finance/transactions/:idYesGet a specific transaction by ID

Internals

Use-cases

Application operations. Each is a single-purpose class with one execute() method.

Use-caseSignature
GetFinanceAnalyticsUseCaseexecute(tenantId: string, query: GetAnalyticsQueryDto): Promise<FinanceDashboardResponse>
GetTransactionUseCaseexecute(tenantId: string, id: string): Promise<TransactionResponse>
ListTransactionsUseCaseexecute(tenantId: string, query: ListTransactionsQueryDto): Promise<TransactionListResponse>

Entities

Sequelize models owned by this module.

Transaction — table transactions

FieldType
idstring
tenantIdstring
tenantTenant
memberIdstring | null
memberMember
typeTransactionType
statusTransactionStatus
referencestring
descriptionstring | null
amountnumber
feenumber
netAmountnumber
currencystring
channelTransactionChannel | null
customerEmailstring | null
customerPhonestring | null
customerNamestring | null
paystackReferencestring | null
paystackIdstring | null
cardLast4string | null
cardBrandstring | null
bankNamestring | null
orderIdstring | null
bookingIdstring | null
membershipSubscriptionIdstring | null
metadataRecord<string, unknown>
paidAtDate | null
refundedAtDate | null
refundedAmountnumber
createdAtDate
updatedAtDate

Repositories

Data-access classes wrapping the entities.

TransactionRepository

create · findById · findByReference · findByPaystackReference · findSuccessfulByOrderId · findSuccessfulByBookingId · update · updateByReference · listByTenant · getSummary · getRevenueByType · getRevenueByDay · getRecentTransactions

Generated from the module’s source. Routes are relative to the engine root (default http://localhost:3001). For full request/response schemas use the live OpenAPI document.