56 lines
1.3 KiB
Dart
56 lines
1.3 KiB
Dart
class PaymentDetailsModel {
|
|
final int id;
|
|
final int userId;
|
|
final int type;
|
|
final int planId;
|
|
final String endDate;
|
|
final String createdDate;
|
|
final String planName;
|
|
final String price;
|
|
final int duration;
|
|
final String description;
|
|
|
|
PaymentDetailsModel({
|
|
required this.id,
|
|
required this.userId,
|
|
required this.type,
|
|
required this.planId,
|
|
required this.endDate,
|
|
required this.createdDate,
|
|
required this.planName,
|
|
required this.price,
|
|
required this.duration,
|
|
required this.description,
|
|
});
|
|
|
|
factory PaymentDetailsModel.fromJson(Map<String, dynamic> json) {
|
|
return PaymentDetailsModel(
|
|
id: json['id'] ?? 0,
|
|
userId: json['user_id'] ?? 0,
|
|
type: json['type'] ?? 0,
|
|
planId: json['plan_id'] ?? 0,
|
|
endDate: json['end_date'] ?? '',
|
|
createdDate: json['created_date'] ?? '',
|
|
planName: json['plan_name'] ?? '',
|
|
price: json['price'] ?? '',
|
|
duration: json['duration'] ?? 0,
|
|
description: json['description'] ?? '',
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'user_id': userId,
|
|
'type': type,
|
|
'plan_id': planId,
|
|
'end_date': endDate,
|
|
'created_date': createdDate,
|
|
'plan_name': planName,
|
|
'price': price,
|
|
'duration': duration,
|
|
'description': description,
|
|
};
|
|
}
|
|
}
|