Files
Kifi/kifi-app/lib/features/inventory/domain/inventory_item.dart

80 lines
2.1 KiB
Dart

class InventoryItem {
final int? id;
final int? userId;
final int? productId;
final String? tagNumber;
final String? sku;
final String? huid;
final String? purity;
final double? grossWeight;
final double? netWeight;
final double? stoneWeight;
final double? diamondWeight;
final double? fineWeight;
final double? makingCharges;
final String? makingChargeType;
final double? purchaseCost;
final double? metalCost;
final double? stoneCost;
final double? certificationCost;
final double? tax;
final int? vendorId;
final int? branchId;
final String? purchaseRef;
final String? status;
InventoryItem({
this.id,
this.userId,
this.productId,
this.tagNumber,
this.sku,
this.huid,
this.purity,
this.grossWeight,
this.netWeight,
this.stoneWeight,
this.diamondWeight,
this.fineWeight,
this.makingCharges,
this.makingChargeType,
this.purchaseCost,
this.metalCost,
this.stoneCost,
this.certificationCost,
this.tax,
this.vendorId,
this.branchId,
this.purchaseRef,
this.status,
});
factory InventoryItem.fromJson(Map<String, dynamic> json) {
return InventoryItem(
id: json['id'],
userId: json['userId'],
productId: json['productId'],
tagNumber: json['tagNumber'],
sku: json['sku'],
huid: json['huid'],
purity: json['purity'],
grossWeight: json['grossWeight']?.toDouble(),
netWeight: json['netWeight']?.toDouble(),
stoneWeight: json['stoneWeight']?.toDouble(),
diamondWeight: json['diamondWeight']?.toDouble(),
fineWeight: json['fineWeight']?.toDouble(),
makingCharges: json['makingCharges']?.toDouble(),
makingChargeType: json['makingChargeType'],
purchaseCost: json['purchaseCost']?.toDouble(),
metalCost: json['metalCost']?.toDouble(),
stoneCost: json['stoneCost']?.toDouble(),
certificationCost: json['certificationCost']?.toDouble(),
tax: json['tax']?.toDouble(),
vendorId: json['vendorId'],
branchId: json['branchId'],
purchaseRef: json['purchaseRef'],
status: json['status'],
);
}
}