UHotelReservationJson.fromMap constructor

UHotelReservationJson.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory UHotelReservationJson.fromMap(Map<String, dynamic> json) => UHotelReservationJson(
  detail1: json["detail1"],
  detail2: json["detail2"],
  guestName: json["guestName"],
  guestPhone: json["guestPhone"],
  notes: json["notes"],
  nightCount: json["nightCount"] == null ? null : (json["nightCount"] as num).toInt(),
  reservationCode: json["reservationCode"],
  guests: json["guests"] == null ? <UReservationGuestJson>[] : List<UReservationGuestJson>.from(json["guests"]!.map((dynamic x) => UReservationGuestJson.fromMap(x))),
  cancelledAt: json["cancelledAt"] == null ? null : DateTime.parse(json["cancelledAt"]),
  cancelReason: json["cancelReason"],
  cancellationPenalty: json["cancellationPenalty"] == null ? null : (json["cancellationPenalty"] as num).toDouble(),
  refundAmount: json["refundAmount"] == null ? null : (json["refundAmount"] as num).toDouble(),
);