Commit 5037c228 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

Few pay fixes

parents db93d1c9 30024bcb
......@@ -32,7 +32,7 @@ android {
applicationId = "in.webgrid.genrentals"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23
minSdk = flutter.minSdkVersion
targetSdk = 36
versionCode = flutter.versionCode
versionName = flutter.versionName
......
class RentalPaymentDetailsResponse {
List<Bill>? bill;
int? error;
String? message;
RentalPaymentDetailsResponse({this.bill, this.error, this.message});
RentalPaymentDetailsResponse.fromJson(Map<String, dynamic> json) {
if (json['bill'] != null) {
bill = <Bill>[];
json['bill'].forEach((v) {
bill!.add(new Bill.fromJson(v));
});
}
error = json['error'];
message = json['message'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.bill != null) {
data['bill'] = this.bill!.map((v) => v.toJson()).toList();
}
data['error'] = this.error;
data['message'] = this.message;
return data;
}
}
class Bill {
String? narration;
String? amount;
String? mode;
String? ref;
String? datetime;
Bill({this.narration, this.amount, this.mode, this.ref, this.datetime});
Bill.fromJson(Map<String, dynamic> json) {
narration = json['narration'];
amount = json['amount'];
mode = json['mode'];
ref = json['ref'];
datetime = json['datetime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['narration'] = this.narration;
data['amount'] = this.amount;
data['mode'] = this.mode;
data['ref'] = this.ref;
data['datetime'] = this.datetime;
return data;
}
}
class BillProductResponse {
List<Bp>? bp;
int? error;
String? message;
BillProductResponse({this.bp, this.error, this.message});
BillProductResponse.fromJson(Map<String, dynamic> json) {
if (json['bp'] != null) {
bp = <Bp>[];
json['bp'].forEach((v) {
bp!.add(new Bp.fromJson(v));
});
}
error = json['error'];
message = json['message'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.bp != null) {
data['bp'] = this.bp!.map((v) => v.toJson()).toList();
}
data['error'] = this.error;
data['message'] = this.message;
return data;
}
}
class Bp {
String? pname;
String? qty;
String? totalAmount;
Bp({this.pname, this.qty, this.totalAmount});
Bp.fromJson(Map<String, dynamic> json) {
pname = json['pname'];
qty = json['qty'];
totalAmount = json['total_amount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['pname'] = this.pname;
data['qty'] = this.qty;
data['total_amount'] = this.totalAmount;
return data;
}
}
class OrderDetailsBillResponse {
List<Bill>? bill;
int? error;
String? message;
OrderDetailsBillResponse({this.bill, this.error, this.message});
OrderDetailsBillResponse.fromJson(Map<String, dynamic> json) {
if (json['bill'] != null) {
bill = <Bill>[];
json['bill'].forEach((v) {
bill!.add(new Bill.fromJson(v));
});
}
error = json['error'];
message = json['message'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.bill != null) {
data['bill'] = this.bill!.map((v) => v.toJson()).toList();
}
data['error'] = this.error;
data['message'] = this.message;
return data;
}
}
class Bill {
String? totalAmount;
String? datetime;
String? billNarration;
String? billId;
Bill({this.totalAmount, this.datetime, this.billNarration, this.billId});
Bill.fromJson(Map<String, dynamic> json) {
totalAmount = json['total_amount'];
datetime = json['datetime'];
billNarration = json['bill_narration'];
billId = json['bill_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['total_amount'] = this.totalAmount;
data['datetime'] = this.datetime;
data['bill_narration'] = this.billNarration;
data['bill_id'] = this.billId;
return data;
}
}
class OrderDetailsMainResponse {
List<Bill>? bill;
int? error;
String? message;
OrderDetailsMainResponse({this.bill, this.error, this.message});
OrderDetailsMainResponse.fromJson(Map<String, dynamic> json) {
if (json['bill'] != null) {
bill = <Bill>[];
json['bill'].forEach((v) {
bill!.add(new Bill.fromJson(v));
});
}
error = json['error'];
message = json['message'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.bill != null) {
data['bill'] = this.bill!.map((v) => v.toJson()).toList();
}
data['error'] = this.error;
data['message'] = this.message;
return data;
}
}
class Bill {
String? dispAddress;
String? tenure;
Bill({this.dispAddress, this.tenure});
Bill.fromJson(Map<String, dynamic> json) {
dispAddress = json['disp_address'];
tenure = json['tenure'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['disp_address'] = this.dispAddress;
data['tenure'] = this.tenure;
return data;
}
}
class OrderDetailsProductResponse {
List<Products>? products;
int? error;
String? message;
OrderDetailsProductResponse({this.products, this.error, this.message});
OrderDetailsProductResponse.fromJson(Map<String, dynamic> json) {
if (json['products'] != null) {
products = <Products>[];
json['products'].forEach((v) {
products!.add(new Products.fromJson(v));
});
}
error = json['error'];
message = json['message'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.products != null) {
data['products'] = this.products!.map((v) => v.toJson()).toList();
}
data['error'] = this.error;
data['message'] = this.message;
return data;
}
}
class Products {
String? pname;
String? qty;
String? totalAmount;
String? type;
Products({this.pname, this.qty, this.totalAmount, this.type});
Products.fromJson(Map<String, dynamic> json) {
pname = json['pname'];
qty = json['qty'];
totalAmount = json['total_amount'];
type = json['type'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['pname'] = this.pname;
data['qty'] = this.qty;
data['total_amount'] = this.totalAmount;
data['type'] = this.type;
return data;
}
}
class RentalAccountResponse {
List<Account>? account;
int? error;
String? message;
RentalAccountResponse({this.account, this.error, this.message});
RentalAccountResponse.fromJson(Map<String, dynamic> json) {
if (json['account'] != null) {
account = <Account>[];
json['account'].forEach((v) {
account!.add(new Account.fromJson(v));
});
}
error = json['error'];
message = json['message'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.account != null) {
data['account'] = this.account!.map((v) => v.toJson()).toList();
}
data['error'] = this.error;
data['message'] = this.message;
return data;
}
}
class Account {
String? id;
String? name;
String? address;
Account({this.id, this.name, this.address});
Account.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
address = json['address'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['address'] = this.address;
return data;
}
}
class RentalContactResponse {
int? error;
String? message;
int? exist;
String? city;
String? raname;
String? mob;
String? mail;
String? address;
String? state;
String? accId;
int? otp;
RentalContactResponse(
{this.error,
this.message,
this.exist,
this.city,
this.raname,
this.mob,
this.mail,
this.address,
this.state,
this.accId,
this.otp});
RentalContactResponse.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
exist = json['exist'];
city = json['city'];
raname = json['raname'];
mob = json['mob'];
mail = json['mail'];
address = json['address'];
state = json['state'];
accId = json['acc_id'];
otp = json['otp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['exist'] = this.exist;
data['city'] = this.city;
data['raname'] = this.raname;
data['mob'] = this.mob;
data['mail'] = this.mail;
data['address'] = this.address;
data['state'] = this.state;
data['acc_id'] = this.accId;
data['otp'] = this.otp;
return data;
}
}
......@@ -1067,7 +1067,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: Row(
children: [
SizedBox(width: screenWidth * 0.02),
Icon(Icons.info_outline, color: Colors.red, size: getResponsiveIconSize(context, 15)),
Icon(Icons.error_outline, color: Colors.red, size: getResponsiveIconSize(context, 15)),
SizedBox(width: screenWidth * 0.01),
Expanded(
child: Text(
......
......@@ -2,13 +2,9 @@
const baseUrl = "https://erp.gengroup.in/ci/app/Rental/Rental_Home/";
const baseUrl2 = "https://erp.gengroup.in/ci/app/Rental/";
/// tokens url
const addFcmTokenUrl = "${baseUrl}add_fcm_token";
/// payments and bills
const addPaymentUrl = "${baseUrl}add_payment";
const transactionsUrl = "${baseUrl}transactions";
const balanceUrl = "${baseUrl}balance";
const billDetailsUrl = "${baseUrl}bill_details";
const billListUrl = "${baseUrl}bill_list";
const downloadBillUrl = "${baseUrl}download_bill";
......@@ -17,17 +13,10 @@ const downloadReceiptUrl = "${baseUrl}download_receipt";
const payAmountUrl = "${baseUrl}pay_amount";
const getPaymentStatusUrl = "${baseUrl}get_payment_status";
/// info
const checkInOutSubmitUrl = "${baseUrl}check_in_out_submit";
const rentalContactUrl = "${baseUrl}rental_contact";
const getRentalAccInfoUrl = "${baseUrl}get_rental_acc_info";
/// order
const orderDetailsBillUrl = "${baseUrl}order_details_bill";
const orderDetailsMainUrl = "${baseUrl}order_details_main";
const orderDetailsProductUrl = "${baseUrl}order_details_product";
const subsOrderDetails = "${baseUrl}subs_order_details";
const tagOrderUrl = "${baseUrl}tag_order";
/// tickets
const addEnquiryUrl = "${baseUrl}add_enquiry";
......
......@@ -6,19 +6,14 @@ import 'package:gen_rentals/Models/HelpAndEnquiryModels/TicketChatDisplayRespons
import 'package:gen_rentals/Models/BillsModels/billListResponse.dart';
import 'package:gen_rentals/Models/ProfileResponse.dart';
import 'package:gen_rentals/Models/TransactionModels/PaymentReceiptDetailsResponse.dart';
import 'package:gen_rentals/Models/billProductResponse.dart';
import 'package:gen_rentals/Models/orderDetailsMainResponse.dart';
import 'package:gen_rentals/Models/orderDetailsProductResponse.dart';
import 'package:gen_rentals/Models/SubscribeOrderDetailsResponse.dart';
import 'package:gen_rentals/Models/HelpAndEnquiryModels/ticketListResponse.dart';
import '../Models/BillsModels/BillDetailsResponse.dart';
import '../Models/DashboardResponse.dart';
import '../Models/RentalPaymentDetailsResponse.dart';
import '../Models/TransactionModels/PayAmountResponse.dart';
import '../Models/TransactionModels/TransactionsResponse.dart';
import '../Models/orderDetailsBillResponse.dart';
import '../Models/rentalAccountResponse.dart';
import '../Models/rentalContactResponse.dart';
import '../Notifier/PayAmountProvider.dart';
import '../Notifier/RentalContactProvider .dart';
import 'api_URLs.dart';
......@@ -121,7 +116,7 @@ class ApiCalling {
};
final res = await post(data, payAmountUrl, {});
debugPrint("PayAmount Response ${res?.body}");
// debugPrint("PayAmount Response ${res?.body}");
if (res != null) {
return PayAmountResponse.fromJson(jsonDecode(res.body));
......@@ -204,7 +199,7 @@ class ApiCalling {
final res = await post(data, billDetailsUrl, {});
debugPrint("Bill Details Response ${res?.body}");
// debugPrint("Bill Details Response ${res?.body}");
if (res != null) {
return BillDetailsResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -260,7 +255,7 @@ class ApiCalling {
};
final res = await post(data, paymentReceiptDetailsUrl, {});
debugPrint("TR Response ${res?.body}");
// debugPrint("TR Response ${res?.body}");
if (res != null) {
return PaymentReceiptDetailsResponse.fromJson(jsonDecode(res.body));
......@@ -288,7 +283,7 @@ class ApiCalling {
};
final res = await post(data, downloadReceiptUrl, {});
debugPrint("DownloadApi Response${res}");
// debugPrint("DownloadApi Response${res}");
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
......@@ -317,7 +312,7 @@ class ApiCalling {
};
final res = await post(data, subsOrderDetails, {});
debugPrint("Subscribe order details Response: ${res?.body}");
// debugPrint("Subscribe order details Response: ${res?.body}");
if (res != null) {
return SubscribeOrderDetailsResponse.fromJson(jsonDecode(res.body));
......@@ -333,34 +328,6 @@ class ApiCalling {
/// Fetch Order Details Main
static Future<OrderDetailsMainResponse?> fetchOrderDetailMainApi(
String sessionId,
String empId,
String orderId,
) async {
try {
Map<String, String> data = {
"session_id": sessionId,
"emp_id": empId,
"ord_id": orderId,
};
final res = await post(data, orderDetailsMainUrl, {});
if (res != null) {
return OrderDetailsMainResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ API Error (fetchOrderDetailMain): $e");
return null;
}
}
/// Fetch Rental Transaction
static Future<TransactionsResponse?> fetchRentalsTransactionsApi(
String sessionId,
......@@ -426,8 +393,8 @@ class ApiCalling {
};
final res = await post(data, ticketChatDetailsUrl, {});
// debugPrint("🟢 Raw API Response:\n${res?.body}");
// debugPrint("🟢 Response Type: ${res?.body.runtimeType}");
// debugPrint(" Raw API Response:\n${res?.body}");
// debugPrint(" Response Type: ${res?.body.runtimeType}");
if (res != null) {
return TicketChatDisplayResponse.fromJson(jsonDecode(res.body));
......@@ -440,33 +407,6 @@ class ApiCalling {
return null;
}
}
//
// static Future<addTicketResponse?> addTicketAPI(
// type, description, List<http.MultipartFile> newList) async {
// if (await CheckHeaderValidity()) {
// try {
// Map<String, String> data = {
// 'type': type.toString(),
// 'description': description.toString(),
// //ticket_image
// };
// // print("Add ticket ${data}");
// final header = await HeaderValues();
// final res = await PostMultipleImagesNew(
// data, addTicketsUrl, header, newList);
// if (res != null) {
// return addTicketResponse.fromJson(jsonDecode(res));
// } else {
// return null;
// }
// } catch (e) {
// debugPrint('hello bev=bug $e ');
// return null;
// }
// } else {
// return addTicketResponse(error: "401");
// }
// }
/// Send Message Chat Api
......@@ -559,31 +499,6 @@ class ApiCalling {
/// Fetch Tag Order
static Future<CommonResponse?> fetchTagOrderApi(
String sessionId,
String empId,
) async {
try {
Map<String, String> data = {
"session_id": sessionId,
"emp_id": empId,
};
final res = await post(data, tagOrderUrl, {});
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ API Error (fetchTagOrder): $e");
return null;
}
}
/// Submit Enquiry Api
static Future<CommonResponse?> submitEnquiryApi(
......@@ -621,117 +536,8 @@ class ApiCalling {
}
}
/// Fetch CheckInOut Submit
static Future<CommonResponse?> fetchCheckInOutSubmitApi(
String sessionId,
String empId,
) async {
try {
Map<String, String> data = {
"session_id": sessionId,
"emp_id": empId,
};
final res = await post(data, checkInOutSubmitUrl, {});
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ API Error (CheckInOutSubmit): $e");
return null;
}
}
/// Fetch Balance
static Future<CommonResponse?> fetchBalanceApi(
String sessionId,
String empId,
String accId,
) async {
try {
Map<String, String> data = {
"session_id": sessionId,
"emp_id": empId,
"acc_id": accId,
};
final res = await post(data, balanceUrl, {});
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ API Error (fetch Balance): $e");
return null;
}
}
/// Add Payment
static Future<CommonResponse?> fetchAddPaymentApi(
String sessionId,
String empId,
String amount,
String orderId,
) async {
try {
Map<String, String> data = {
"session_id": sessionId,
"emp_id": empId,
"amount": amount,
"order_id": orderId,
};
final res = await post(data, addPaymentUrl, {});
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ API Error (AddPaymentApi): $e");
return null;
}
}
/// Add Fcm Token
static Future<CommonResponse?> fetchAddFcmTokenApi(
String sessionId,
String empId,
String amount,
String orderId,
) async {
try {
Map<String, String> data = {
"session_id": sessionId,
"emp_id": empId,
"amount": amount,
"order_id": orderId,
};
final res = await post(data, addFcmTokenUrl, {});
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint("❌ API Error (fetch Add Payment Api): $e");
return null;
}
}
/// Fetch Dashboard
static Future<DashboardResponse?> fetchDashboardApi(
......
......@@ -165,10 +165,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
ffi:
dependency: transitive
description:
......@@ -412,26 +412,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
......@@ -865,10 +865,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "0.7.6"
typed_data:
dependency: transitive
description:
......@@ -913,10 +913,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
......@@ -966,5 +966,5 @@ packages:
source: hosted
version: "6.5.0"
sdks:
dart: ">=3.7.2 <4.0.0"
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.29.0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment