toPutJson method
Converts the body data model to a JSON object for a PUT request.
This method should be implemented by subclasses to convert their specific data to a JSON object. It should only include properties that need to be sent in a PUT request.
Implementation
@override
Map<String, dynamic>? toPutJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['storeId'] = storeId;
data['name'] = name;
data['logoURL'] = logoURL;
data['type'] = type;
data['calculationType'] = calculationType;
data['shipmentEstimatedDay'] = shipmentEstimatedDay;
data['showShipmentEstimatedDay'] = showShipmentEstimatedDay;
data['freeShipmentCargoLimit'] = freeShipmentCargoLimit;
data['cashOnDelivery'] = cashOnDelivery?.toPostJson();
if (prices != null) {
data["prices"] = prices!.map((e) => e.toPostJson()).toList();
}
return data;
}