Update: 2026-05-08 14:05:50

This commit is contained in:
Hamza-Ayed
2026-05-08 14:05:50 +03:00
parent cfc330e291
commit 155c2d0fc0
13 changed files with 709 additions and 22 deletions

View File

@@ -57,4 +57,27 @@ class CompaniesManagementController extends GetxController {
AppSnackbar.showError('خطأ', 'تعذر حذف الشركة');
}
}
Future<void> connectJoFotara(String id, String clientId, String secretKey, String sequence) async {
try {
isLoading.value = true;
final response = await _dio.post('companies/connect_jofotara', data: {
'id': id,
'client_id': clientId,
'secret_key': secretKey,
'income_source_sequence': sequence,
});
if (response.data['success'] == true) {
await fetchCompanies();
AppSnackbar.showSuccess('نجاح', 'تم ربط الشركة بجوفوترا بنجاح');
} else {
AppSnackbar.showError('خطأ', response.data['message'] ?? 'فشل الربط');
}
} catch (e) {
AppLogger.error('Failed to connect jofotara', e);
AppSnackbar.showError('خطأ', 'تعذر ربط جوفوترا');
} finally {
isLoading.value = false;
}
}
}