Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions components/ui/button.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export declare class AddTransactionsIndexes1710000000001 implements MigrationInterface {
name: string;
up(queryRunner: QueryRunner): Promise<void>;
down(queryRunner: QueryRunner): Promise<void>;
}
21 changes: 21 additions & 0 deletions dist/src/migrations/1710000000001-add-transactions-indexes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/src/transactions/transactions.controller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ export declare class TransactionsController {
module: string;
status: string;
};
sync(req: any, publicKey: string): Promise<import("./transactions.service").SyncResult>;
spendingByCategory(req: any, asset: string, since: string): Promise<import("./transactions.service").SpendingByCategoryRow[]>;
getHistory(req: any, page?: string, limit?: string, category?: string, asset?: string): Promise<import("./transactions.service").PaginatedHistory>;
categorize(req: any, id: string, category: string): Promise<import("./entities/transaction.entity").TransactionEntity>;
}
72 changes: 71 additions & 1 deletion dist/src/transactions/transactions.controller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/transactions/transactions.controller.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion dist/src/transactions/transactions.module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/transactions/transactions.module.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions dist/src/transactions/transactions.service.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,52 @@
import { Repository } from 'typeorm';
import { TransactionEntity } from './entities/transaction.entity';
export interface SyncResult {
synced: number;
}
export interface PaginatedHistory {
data: TransactionEntity[];
total: number;
}
export interface SpendingByCategoryRow {
category: string;
total: string;
}
/** Provides the transactions application capability. */
export declare class TransactionsService {
private readonly transactionsRepository;
private readonly horizon;
constructor(transactionsRepository: Repository<TransactionEntity>);
/** Returns a stable service health payload for this capability. */
status(): {
module: string;
status: string;
};
/**
* Fetches the last 200 operations for `publicKey` from Horizon, normalizes
* payment-type operations into TransactionEntity rows, and inserts them
* with ON CONFLICT (hash) DO NOTHING. Returns the count of rows actually
* inserted (duplicates are silently skipped, not counted).
*/
syncTransactions(userId: string, publicKey: string): Promise<SyncResult>;
/**
* Paginated transaction history for a user, with optional category/asset
* filters, ordered newest-first.
*/
getHistory(userId: string, options: {
page: number;
limit: number;
category?: string;
asset?: string;
}): Promise<PaginatedHistory>;
/**
* Updates the category on a single transaction. Throws NotFoundException
* if the row doesn't exist, ForbiddenException if it belongs to a
* different user.
*/
categorize(userId: string, transactionId: string, category: string): Promise<TransactionEntity>;
/**
* Aggregates total spend per category for a user, filtered by asset and
* a minimum created_at date.
*/
getSpendingByCategory(userId: string, asset: string, since: Date): Promise<SpendingByCategoryRow[]>;
}
Loading
Loading