step 31 : total history, change password, resize image from camera, update versi 1.2.0

This commit is contained in:
sindhu
2024-01-22 10:25:31 +07:00
parent c67f771d25
commit 4e3d251169
15 changed files with 864 additions and 12 deletions

View File

@@ -95,4 +95,32 @@ class AuthRepository extends BaseRepository {
return resp['message'];
}
}
Future<String> changePassword({
required String userID,
required String token,
required String tokenx,
required String oldPassword,
required String newPassword,
required String confirmPassword,
}) async {
final param = {
"tokenx": tokenx,
"token": token,
"M_UserID": userID,
"old_password": oldPassword,
"new_password": newPassword,
"confirm_password": confirmPassword
};
final service = "${Constant.baseUrlDevone}auth/change_password";
final resp = await post(param: param, service: service, token: token);
if (resp["status"] == "OK") {
return resp['message'];
} else {
return resp['message'];
}
}
}

View File

@@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:app_petty_cash/model/list_type_model.dart';
import '../app/constant.dart';
import '../model/history_total_model.dart';
import '../model/history_transaksi_model.dart';
import '../model/list_category_model.dart';
import 'base_repository.dart';
@@ -216,4 +217,33 @@ class TransaksiRepository extends BaseRepository {
return resp['status'];
}
// total by category di history
Future<HistoryTotalModel> getHistoryTotal(
String companyid,
String tglAwal,
String tglAkhir,
String categoryid,
) async {
final service =
"${Constant.baseUrlDevone}history/list_total/?companyid=$companyid&startdate=$tglAwal&enddate=$tglAkhir&kategoriid=$categoryid";
final resp = await get(
// param: {
// "": "",
// },
service: service,
);
print("url total History Transaksi : $service");
HistoryTotalModel result = HistoryTotalModel(
totalAll: "0",
);
// print(resp['data']);
final model = HistoryTotalModel.fromJson(resp['data']);
result = model;
return result;
}
}