Update: 2026-08-03 11:32:12

This commit is contained in:
Hamza-Ayed
2026-08-03 11:32:12 +03:00
parent 2b9f696372
commit 0334f9881f
40 changed files with 86899 additions and 84841 deletions
@@ -10,6 +10,11 @@ class FinancialV2Controller extends GetxController {
Map<String, dynamic> stats = {};
List<dynamic> settlements = [];
/// ملخّص محفظة سيرو القادم من خادم المدفوعات.
/// المفاتيح: month_to_date / previous_month / all_time / growth_percent
/// / by_payment_method — ولكل نافذة: credits و debits و net و tx_count.
Map<String, dynamic> walletSummary = {};
@override
void onInit() {
super.onInit();
@@ -23,12 +28,28 @@ class FinancialV2Controller extends GetxController {
await Future.wait([
fetchStats(),
fetchSettlements(),
fetchWalletSummary(),
]);
isLoading = false;
update();
}
Future<void> fetchWalletSummary() async {
try {
var res =
await CRUD().getWallet(link: AppLink.siroWalletSummary, payload: {});
if (res != 'failure' && res != null) {
var d = res is String ? jsonDecode(res) : res;
if (d['status'] == 'success' && d['data'] is Map) {
walletSummary = Map<String, dynamic>.from(d['data']);
}
}
} catch (e) {
Log.print('Error fetching Siro wallet summary: $e');
}
}
Future<void> fetchStats() async {
try {
var res =