Skip to content

Feature/transaction details domain data#78

Open
yousef-osama11 wants to merge 5 commits intodevfrom
feature/transaction_details_domain_data
Open

Feature/transaction details domain data#78
yousef-osama11 wants to merge 5 commits intodevfrom
feature/transaction_details_domain_data

Conversation

@yousef-osama11
Copy link
Collaborator

No description provided.

@yousef-osama11 yousef-osama11 self-assigned this Feb 9, 2026
@override
Future<Transaction> getTransactionDetails(int id) async {
throw UnimplementedError('getTransactionDetails not implemented');
Future<Transaction> getTransactionDetails(String id) async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using our Result class we created for error handling, you can find an example for its usage in LoginCubit, to unify our work for error handling

final client = await service.getClient();

final response = await client.rpc(
'delete_transaction',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider extracting rpc functions names to constants, since it might be used in another functin

'delete_transaction',
params: {'p_id': id},
);
print("respinse of deleting is : $response");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the print statement

cubit.deleteTransaction().then((success) {
if (success) {
MSnackBar.success(
message: "Transaction deleted successfully",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use localization

return Transaction(
id: 0,
amount: (data['amount'] as num).toDouble(),
currency: await _getCurrencyAbbreviation(data['currency_id'] as int),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use join on backend to retrive what you need

);
}

Future<String> _getCurrencyAbbreviation(int currencyId) async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this function

return response['abbreviation'] as String;
}

Future<String> _getCategoryName(String categoryId) async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same , use join delegate all of this to the backend

@mohamedshemees
Copy link
Collaborator

great work yousef i please consider my notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants