Language Changes

This commit is contained in:
Nilanjan Chakrabarti
2025-07-09 12:46:51 +05:30
commit 5e72baf1d3
458 changed files with 52259 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
class PaymentResponse {
final bool isSuccess;
final DateTime? date;
final String? creditedAccount;
final String? amount;
final String? currency;
final String? errorMessage;
final String? errorCode;
PaymentResponse({
required this.isSuccess,
this.date,
this.creditedAccount,
this.amount,
this.currency,
this.errorMessage,
this.errorCode,
});
}

View File

@@ -0,0 +1,28 @@
class Transaction {
final String? id;
final String? name;
final String? date;
final String? amount;
final String? type;
Transaction({this.id, this.name, this.date, this.amount, this.type});
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'date': date,
'amount': amount,
'type': type,
};
}
factory Transaction.fromJson(Map<String, dynamic> json) {
return Transaction(
id: json['id'] as String?,
name: json['name'] as String?,
date: json['date'] as String?,
amount: json['amount'] as String?,
type: json['type'] as String?,
);
}
}

View File

@@ -0,0 +1,45 @@
class Transfer {
final String fromAccount;
final String toAccount;
final String toAccountType;
final String amount;
String? tpin;
Transfer({
required this.fromAccount,
required this.toAccount,
required this.toAccountType,
required this.amount,
this.tpin,
});
Map<String, dynamic> toJson() {
return {
'fromAccount': fromAccount,
'toAccount': toAccount,
'toAccountType': toAccountType,
'amount': amount,
'tpin': tpin,
};
}
}
class TransferResponse {
final String? status;
final String? message;
final String? error;
TransferResponse({
required this.status,
required this.message,
required this.error,
});
factory TransferResponse.fromJson(Map<String, dynamic> json) {
return TransferResponse(
status: json['status'] as String?,
message: json['message'] as String?,
error: json['error'] as String?,
);
}
}

113
lib/data/models/user.dart Normal file
View File

@@ -0,0 +1,113 @@
import 'package:equatable/equatable.dart';
import 'package:kmobile/data/models/transaction.dart';
class User extends Equatable {
final String? accountNo;
final String? accountType;
final String? bookingNumber;
final String? branchId;
final String? currency;
final String? productType;
final String? approvedAmount;
final String? availableBalance;
final String? currentBalance;
final String? name;
final String? mobileNo;
final String? address;
final String? picode;
final int? activeAccounts;
final String? cifNumber;
final String? primaryId;
final String? dateOfBirth;
final List<Transaction>? transactions;
const User({
required this.accountNo,
required this.accountType,
this.bookingNumber,
required this.branchId,
required this.currency,
this.productType,
this.approvedAmount,
required this.availableBalance,
required this.currentBalance,
required this.name,
required this.mobileNo,
required this.address,
required this.picode,
this.transactions,
this.activeAccounts,
this.cifNumber,
this.primaryId,
this.dateOfBirth,
});
Map<String, dynamic> toJson() {
return {
'stAccountNo': accountNo,
'stAccountType': accountType,
'stBookingNumber': bookingNumber,
'stBranchId': branchId,
'stCurrency': currency,
'stProductType': productType,
'stApprovedAmount': approvedAmount,
'stAvailableBalance': availableBalance,
'stCurrentBalance': currentBalance,
'custname': name,
'mobileno': mobileNo,
'custaddress': address,
'picode': picode,
'transactions': transactions?.map((tx) => tx.toJson()).toList(),
'activeAccounts': activeAccounts,
'cifNumber': cifNumber,
'primaryId': primaryId,
'dateOfBirth': dateOfBirth,
};
}
factory User.fromJson(Map<String, dynamic> json) {
return User(
accountNo: json['stAccountNo'],
accountType: json['stAccountType'],
bookingNumber: json['stBookingNumber'],
branchId: json['stBranchNo'],
currency: json['stCurrency'],
productType: json['stProductType'],
approvedAmount: json['stApprovedAmount'],
availableBalance: json['stAvailableBalance'],
currentBalance: json['stCurrentBalance'],
name: json['custname'],
mobileNo: json['mobileno'],
address: json['custaddress'],
picode: json['picode'],
cifNumber: json['cifNumber'],
primaryId: json['id'],
activeAccounts: json['activeAccounts'] as int?,
dateOfBirth: json['custdob'],
transactions: (json['transactions'] as List<dynamic>?)
?.map((tx) => Transaction.fromJson(tx))
.toList(),
);
}
@override
List<Object?> get props => [
accountNo,
accountType,
bookingNumber,
branchId,
currency,
productType,
approvedAmount,
availableBalance,
currentBalance,
name,
mobileNo,
address,
picode,
transactions,
activeAccounts,
cifNumber,
primaryId,
];
}