This commit is contained in:
bossanyit
2023-05-08 19:42:08 +02:00
parent 16603f00bd
commit 928396112a
3 changed files with 6 additions and 3 deletions
+3
View File
@@ -4,17 +4,20 @@ class CustomerMembership {
late int membershipId;
int? customerId;
DateTime? startDate;
DateTime? endDate;
CustomerMembership.fromJson(Map json) {
membershipId = json['membershipId'];
customerId = json['customerId'] ?? 0;
startDate = json['startDate'] == null ? null : DateTime.parse(json['startDate']);
endDate = json['endDate'] == null ? null : DateTime.parse(json['endDate']);
}
Map<String, dynamic> toJson() => {
"membershipId": membershipId,
"customerId": customerId ?? 0,
"startDate": startDate == null ? "" : DateFormat('yyyy-MM-dd HH:mm:ss').format(startDate!),
"endDate": startDate == null ? "" : DateFormat('yyyy-MM-dd HH:mm:ss').format(endDate!),
};
@override