Skip to content

Commit d8fbb04

Browse files
authored
Merge pull request #224 from AbuTuraab/Advanced-Transaction-Filters-and-Export-csv
add advanced transaction filters and export
2 parents cd34020 + dcc6149 commit d8fbb04

8 files changed

Lines changed: 1227 additions & 205 deletions

File tree

β€Žapp/backend/src/transactions/dto/transaction.dto.tsβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ export class TransactionItemDto {
6565
@ApiProperty({ example: "2026-02-21T08:00:00Z" })
6666
timestamp: string;
6767

68+
@ApiProperty({ example: "GABCD...1234", description: "Source account" })
69+
source: string;
70+
71+
@ApiProperty({ example: "GDCBA...4321", description: "Destination account" })
72+
destination: string;
73+
74+
@ApiProperty({
75+
example: "Success",
76+
description: "Transaction status (Success or Pending)",
77+
})
78+
status: "Success" | "Pending";
79+
6880
@ApiProperty({ example: "6852...a341" })
6981
txHash: string;
7082

β€Žapp/backend/src/transactions/horizon.service.tsβ€Ž

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,19 @@ export class HorizonService {
152152
assetString = `${payment.asset_code}:${payment.asset_issuer}`;
153153
}
154154

155+
const isSuccessful =
156+
'transaction_successful' in payment
157+
? Boolean(payment.transaction_successful)
158+
: true;
159+
155160
return {
156161
amount: payment.amount,
157162
asset: assetString,
158163
memo,
159164
timestamp: payment.created_at,
165+
source: payment.from,
166+
destination: payment.to,
167+
status: isSuccessful ? 'Success' : 'Pending',
160168
txHash: payment.transaction_hash,
161169
pagingToken: payment.paging_token,
162170
};
@@ -272,4 +280,4 @@ export class HorizonService {
272280
this.backoffCache.clear();
273281
this.logger.debug('Cache cleared');
274282
}
275-
}
283+
}

β€Žapp/mobile/__tests__/Transactions.test.tsxβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ jest.mock('expo-router', () => ({
99
useRouter: () => ({ back: jest.fn() }),
1010
}));
1111

12+
jest.mock('@shopify/flash-list', () => {
13+
const React = require('react');
14+
const { FlatList } = require('react-native');
15+
return {
16+
FlashList: React.forwardRef((props: unknown, ref: unknown) => (
17+
<FlatList ref={ref} {...(props as object)} />
18+
)),
19+
};
20+
});
21+
22+
jest.mock('expo-file-system', () => ({
23+
cacheDirectory: 'file://cache/',
24+
writeAsStringAsync: jest.fn(),
25+
EncodingType: { UTF8: 'utf8' },
26+
}));
27+
28+
jest.mock('expo-sharing', () => ({
29+
isAvailableAsync: jest.fn(() => Promise.resolve(false)),
30+
shareAsync: jest.fn(),
31+
}));
32+
1233
// ── Hook mock ─────────────────────────────────────────────────────────────
1334

1435
const mockUseTransactions = jest.fn();

0 commit comments

Comments
Β (0)