toMap method
isProto is used for server pull/push, too sensitive to keep it optional
Implementation
Map<String, dynamic> toMap({required bool isProto}) {
return {
'id': id,
'items': items.map((x) => x.toMap(isProto: isProto)).toList(),
'taxe': taxe.toMap(),
'promo': promo,
'comment': comment,
'received': received,
'date': date.toIso8601String(),
'paymentType': paymentType.toString(),
'ticketType': ticketType.toString(),
'contactId': contactId,
'status': status,
'statusUpdateDate': statusUpdateDate?.toIso8601String(),
'creationDate': creationDate.toIso8601String(),
};
}