@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
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /finance/dashboard | Yes | Get finance dashboard with summary and charts |
GET | /finance/transactions | Yes | List all transactions for the tenant |
GET | /finance/transactions/:id | Yes | Get a specific transaction by ID |
Internals
Use-cases
Application operations. Each is a single-purpose class with one execute() method.
| Use-case | Signature |
|---|---|
GetFinanceAnalyticsUseCase | execute(tenantId: string, query: GetAnalyticsQueryDto): Promise<FinanceDashboardResponse> |
GetTransactionUseCase | execute(tenantId: string, id: string): Promise<TransactionResponse> |
ListTransactionsUseCase | execute(tenantId: string, query: ListTransactionsQueryDto): Promise<TransactionListResponse> |
Entities
Sequelize models owned by this module.
Transaction — table transactions
| Field | Type |
|---|---|
id | string |
tenantId | string |
tenant | Tenant |
memberId | string | null |
member | Member |
type | TransactionType |
status | TransactionStatus |
reference | string |
description | string | null |
amount | number |
fee | number |
netAmount | number |
currency | string |
channel | TransactionChannel | null |
customerEmail | string | null |
customerPhone | string | null |
customerName | string | null |
paystackReference | string | null |
paystackId | string | null |
cardLast4 | string | null |
cardBrand | string | null |
bankName | string | null |
orderId | string | null |
bookingId | string | null |
membershipSubscriptionId | string | null |
metadata | Record<string, unknown> |
paidAt | Date | null |
refundedAt | Date | null |
refundedAmount | number |
createdAt | Date |
updatedAt | Date |
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.