workouttest_util/lib/model/customer_membership.dart
2023-03-01 17:44:41 +01:00

23 lines
627 B
Dart

import 'package:intl/intl.dart';
class CustomerMembership {
late int membershipId;
int? customerId;
DateTime? startDate;
CustomerMembership.fromJson(Map json) {
membershipId = json['membershipId'];
customerId = json['customerId'] ?? 0;
startDate = json['startDate'] == null ? null : DateTime.parse(json['startDate']);
}
Map<String, dynamic> toJson() => {
"membershipId": membershipId,
"customerId": customerId ?? 0,
"startDate": startDate == null ? "" : DateFormat('yyyy-MM-dd HH:mm:ss').format(startDate!),
};
@override
String toString() => toJson().toString();
}