AfterSalesCouponDto.fromJson constructor

AfterSalesCouponDto.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory AfterSalesCouponDto.fromJson(Map<String, dynamic> json) {
  return AfterSalesCouponDto(
    id: json["id"] as String,
    title: json["title"] as String?,
    description: json["description"] as String?,
    codeType: decodeAfterSalesCouponCodeType(
        AfterSalesCouponCodeTypeEnumMap, json["codeType"] as String),
    code: json["code"] as String?,
    redeemStartDate: json["redeemStartDate"] == null
        ? null
        : DateTime.parse(json["redeemStartDate"] as String),
    redeemEndDate: json["redeemEndDate"] == null
        ? null
        : DateTime.parse(json["redeemEndDate"] as String),
  );
}