toJson method
Implementation
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'description': description,
'unitPriceCents': unitPriceCents,
'vatRate': vatRate,
'unit': unit,
'number': number,
'ean': ean,
'internalCode': internalCode,
'groupId': groupId,
'revenueGroupId': revenueGroupId,
'stockTracked': stockTracked,
'stockKind': stockKind,
'stockLocationIds': [...stockLocationIds],
'minStock': minStock,
'minStockByLocation': {...minStockByLocation},
'active': active,
if (externalIds != null) 'externalIds': {...externalIds!},
if (metadata != null) 'metadata': {...metadata!},
if (variantGroupId != null) 'variantGroupId': variantGroupId,
if (variantAttributes != null) 'variantAttributes': {...variantAttributes!},
'createdAt': createdAt,
'updatedAt': updatedAt,
if (hasPurchasePriceMicros) 'purchasePriceMicros': purchasePriceMicros,
};