101 lines
2.5 KiB
Dart
101 lines
2.5 KiB
Dart
class InventoryManagementResponse {
|
|
bool? success;
|
|
int? totalProducts;
|
|
List<Products>? products;
|
|
|
|
InventoryManagementResponse(
|
|
{this.success, this.totalProducts, this.products});
|
|
|
|
InventoryManagementResponse.fromJson(Map<String, dynamic> json) {
|
|
success = json['success'];
|
|
totalProducts = json['totalProducts'];
|
|
if (json['products'] != null) {
|
|
products = <Products>[];
|
|
json['products'].forEach((v) {
|
|
products!.add(new Products.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['success'] = this.success;
|
|
data['totalProducts'] = this.totalProducts;
|
|
if (this.products != null) {
|
|
data['products'] = this.products!.map((v) => v.toJson()).toList();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Products {
|
|
String? sId;
|
|
String? sKU;
|
|
String? name;
|
|
int? price;
|
|
int? gST;
|
|
int? hSNCode;
|
|
String? description;
|
|
String? productStatus;
|
|
String? addedBy;
|
|
List<Null>? image;
|
|
String? createdAt;
|
|
String? updatedAt;
|
|
String? category;
|
|
String? brand;
|
|
int? stock;
|
|
|
|
Products(
|
|
{this.sId,
|
|
this.sKU,
|
|
this.name,
|
|
this.price,
|
|
this.gST,
|
|
this.hSNCode,
|
|
this.description,
|
|
this.productStatus,
|
|
this.addedBy,
|
|
this.image,
|
|
this.createdAt,
|
|
this.updatedAt,
|
|
this.category,
|
|
this.brand,
|
|
this.stock});
|
|
|
|
Products.fromJson(Map<String, dynamic> json) {
|
|
sId = json['_id'];
|
|
sKU = json['SKU'];
|
|
name = json['name'];
|
|
price = json['price'];
|
|
gST = json['GST'];
|
|
hSNCode = json['HSN_Code'];
|
|
description = json['description'];
|
|
productStatus = json['product_Status'];
|
|
addedBy = json['addedBy'];
|
|
createdAt = json['createdAt'];
|
|
updatedAt = json['updatedAt'];
|
|
category = json['category'];
|
|
brand = json['brand'];
|
|
stock = json['stock'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['_id'] = this.sId;
|
|
data['SKU'] = this.sKU;
|
|
data['name'] = this.name;
|
|
data['price'] = this.price;
|
|
data['GST'] = this.gST;
|
|
data['HSN_Code'] = this.hSNCode;
|
|
data['description'] = this.description;
|
|
data['product_Status'] = this.productStatus;
|
|
data['addedBy'] = this.addedBy;
|
|
data['createdAt'] = this.createdAt;
|
|
data['updatedAt'] = this.updatedAt;
|
|
data['category'] = this.category;
|
|
data['brand'] = this.brand;
|
|
data['stock'] = this.stock;
|
|
return data;
|
|
}
|
|
}
|