completed migrating data scope from user to workspace

This commit is contained in:
2026-06-22 22:10:38 +02:00
parent 62c7f53de0
commit ae2705363a
37 changed files with 918 additions and 221 deletions

View File

@@ -38,14 +38,17 @@ class AccountProvider extends ChangeNotifier {
super.dispose();
}
Future<ApiResponse<AccountModel>> fetchAccount(String phoneNumber) async {
Future<ApiResponse<AccountModel>> fetchAccount(
String? workspaceId,
String currency,
) async {
_isLoadingAccount = true;
_accountError = null;
notifyListeners();
try {
Map<String, dynamic> response = await http.get(
'/accounts/phone/$phoneNumber',
'/accounts/$workspaceId/balance/$currency',
);
_account = AccountModel.fromJson(response);
@@ -69,7 +72,8 @@ class AccountProvider extends ChangeNotifier {
}
Future<ApiResponse<StatementModel>> fetchStatement({
required String phoneNumber,
required String workspaceId,
required String currency,
required String startDate,
required String endDate,
}) async {
@@ -79,7 +83,7 @@ class AccountProvider extends ChangeNotifier {
try {
Map<String, dynamic> response = await http.get(
'/accounts/phone/$phoneNumber/statement'
'/accounts/$workspaceId/statement/$currency'
'?startDate=$startDate&endDate=$endDate',
);