product recommendations api integration - pending
This commit is contained in:
199
lib/model/ProductsModel/call_recommendations_model.dart
Normal file
199
lib/model/ProductsModel/call_recommendations_model.dart
Normal file
@@ -0,0 +1,199 @@
|
||||
class CallRecommendationsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
CallRecommendationsModel(
|
||||
{this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
CallRecommendationsModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
List<ActiveCalls>? activeCalls;
|
||||
List<ActiveCalls>? exitedCalls;
|
||||
|
||||
Data({this.activeCalls, this.exitedCalls});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
if (json['active_calls'] != null) {
|
||||
activeCalls = <ActiveCalls>[];
|
||||
json['active_calls'].forEach((v) {
|
||||
activeCalls!.add(ActiveCalls.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['exited_calls'] != null) {
|
||||
exitedCalls = <ActiveCalls>[];
|
||||
json['exited_calls'].forEach((v) {
|
||||
exitedCalls!.add(ActiveCalls.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (activeCalls != null) {
|
||||
data['active_calls'] = activeCalls!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (exitedCalls != null) {
|
||||
data['exited_calls'] = exitedCalls!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ActiveCalls {
|
||||
int? id;
|
||||
int? manageProductXid;
|
||||
int? recommendationActionsXid;
|
||||
String? stockName;
|
||||
String? instrumentKey;
|
||||
String? stockImage;
|
||||
String? qty;
|
||||
String? duration;
|
||||
int? currentPrice;
|
||||
int? buyPrice;
|
||||
int? targetPrice;
|
||||
int? stopLoss;
|
||||
int? isSendRecommendationNow;
|
||||
Null? scheduleDateTime;
|
||||
String? createdAt;
|
||||
ProductData? productData;
|
||||
ActionData? actionData;
|
||||
|
||||
ActiveCalls(
|
||||
{this.id,
|
||||
this.manageProductXid,
|
||||
this.recommendationActionsXid,
|
||||
this.stockName,
|
||||
this.instrumentKey,
|
||||
this.stockImage,
|
||||
this.qty,
|
||||
this.duration,
|
||||
this.currentPrice,
|
||||
this.buyPrice,
|
||||
this.targetPrice,
|
||||
this.stopLoss,
|
||||
this.isSendRecommendationNow,
|
||||
this.scheduleDateTime,
|
||||
this.createdAt,
|
||||
this.productData,
|
||||
this.actionData});
|
||||
|
||||
ActiveCalls.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
manageProductXid = json['manage_product_xid'];
|
||||
recommendationActionsXid = json['recommendation_actions_xid'];
|
||||
stockName = json['stock_name'];
|
||||
instrumentKey = json['instrument_key'];
|
||||
stockImage = json['stock_image'];
|
||||
qty = json['qty'];
|
||||
duration = json['duration'];
|
||||
currentPrice = json['current_price'];
|
||||
buyPrice = json['buy_price'];
|
||||
targetPrice = json['target_price'];
|
||||
stopLoss = json['stop_loss'];
|
||||
isSendRecommendationNow = json['is_send_recommendation_now'];
|
||||
scheduleDateTime = json['schedule_date_time'];
|
||||
createdAt = json['created_at'];
|
||||
productData = json['product_data'] != null
|
||||
? ProductData.fromJson(json['product_data'])
|
||||
: null;
|
||||
actionData = json['action_data'] != null
|
||||
? ActionData.fromJson(json['action_data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['manage_product_xid'] = manageProductXid;
|
||||
data['recommendation_actions_xid'] = recommendationActionsXid;
|
||||
data['stock_name'] = stockName;
|
||||
data['instrument_key'] = instrumentKey;
|
||||
data['stock_image'] = stockImage;
|
||||
data['qty'] = qty;
|
||||
data['duration'] = duration;
|
||||
data['current_price'] = currentPrice;
|
||||
data['buy_price'] = buyPrice;
|
||||
data['target_price'] = targetPrice;
|
||||
data['stop_loss'] = stopLoss;
|
||||
data['is_send_recommendation_now'] = isSendRecommendationNow;
|
||||
data['schedule_date_time'] = scheduleDateTime;
|
||||
data['created_at'] = createdAt;
|
||||
if (productData != null) {
|
||||
data['product_data'] = productData!.toJson();
|
||||
}
|
||||
if (actionData != null) {
|
||||
data['action_data'] = actionData!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ProductData {
|
||||
int? id;
|
||||
String? productName;
|
||||
int? isActive;
|
||||
String? createdAt;
|
||||
|
||||
ProductData({this.id, this.productName, this.isActive, this.createdAt});
|
||||
|
||||
ProductData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
productName = json['product_name'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['product_name'] = productName;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ActionData {
|
||||
int? id;
|
||||
String? name;
|
||||
int? isActive;
|
||||
Null? createdAt;
|
||||
|
||||
ActionData({this.id, this.name, this.isActive, this.createdAt});
|
||||
|
||||
ActionData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
140
lib/model/ProductsModel/list_of_products_model.dart
Normal file
140
lib/model/ProductsModel/list_of_products_model.dart
Normal file
@@ -0,0 +1,140 @@
|
||||
class ListOfProductsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
ListOfProductsModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
ListOfProductsModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? title;
|
||||
List<ProductsData>? productsData;
|
||||
|
||||
Data({this.id, this.title, this.productsData});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
if (json['products_data'] != null) {
|
||||
productsData = <ProductsData>[];
|
||||
json['products_data'].forEach((v) {
|
||||
productsData!.add(ProductsData.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['title'] = title;
|
||||
|
||||
if (productsData != null) {
|
||||
data['products_data'] = productsData!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ProductsData {
|
||||
int? id;
|
||||
int? productTypeXid;
|
||||
int? productTierXid;
|
||||
String? productName;
|
||||
String? productDescription;
|
||||
String? productPrice;
|
||||
String? productImage;
|
||||
int? isActive;
|
||||
String? createdAt;
|
||||
ProductTier? productTier;
|
||||
|
||||
ProductsData(
|
||||
{this.id,
|
||||
this.productTypeXid,
|
||||
this.productTierXid,
|
||||
this.productName,
|
||||
this.productDescription,
|
||||
this.productPrice,
|
||||
this.productImage,
|
||||
this.isActive,
|
||||
this.createdAt,
|
||||
this.productTier});
|
||||
|
||||
ProductsData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
productTypeXid = json['product_type_xid'];
|
||||
productTierXid = json['product_tier_xid'];
|
||||
productName = json['product_name'];
|
||||
productDescription = json['product_description'];
|
||||
productPrice = json['product_price'];
|
||||
productImage = json['product_image'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
productTier = json['product_tier'] != null
|
||||
? ProductTier.fromJson(json['product_tier'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['product_type_xid'] = productTypeXid;
|
||||
data['product_tier_xid'] = productTierXid;
|
||||
data['product_name'] = productName;
|
||||
data['product_description'] = productDescription;
|
||||
data['product_price'] = productPrice;
|
||||
data['product_image'] = productImage;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
if (productTier != null) {
|
||||
data['product_tier'] = productTier!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ProductTier {
|
||||
int? id;
|
||||
String? name;
|
||||
String? createdAt;
|
||||
|
||||
ProductTier({this.id, this.name, this.createdAt});
|
||||
|
||||
ProductTier.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user