couponApply

This commit is contained in:
2025-02-10 02:37:06 +05:30
parent 630a918307
commit b6ef70cfb6
21 changed files with 3308 additions and 1181 deletions

View File

@@ -0,0 +1,69 @@
// To parse this JSON data, do
//
// final couponResponse = couponResponseFromJson(jsonString);
import 'dart:convert';
CouponResponse couponResponseFromJson(String str) => CouponResponse.fromJson(json.decode(str));
String couponResponseToJson(CouponResponse data) => json.encode(data.toJson());
class CouponResponse {
bool? isValid;
String? originalPrice;
int? discountAmount;
int? finalPrice;
String? message;
CouponDetails? couponDetails;
CouponResponse({
this.isValid,
this.originalPrice,
this.discountAmount,
this.finalPrice,
this.message,
this.couponDetails,
});
factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
isValid: json["isValid"],
originalPrice: json["originalPrice"],
discountAmount: json["discountAmount"],
finalPrice: json["finalPrice"],
message: json["message"],
couponDetails: CouponDetails.fromJson(json["couponDetails"]),
);
Map<String, dynamic> toJson() => {
"isValid": isValid,
"originalPrice": originalPrice,
"discountAmount": discountAmount,
"finalPrice": finalPrice,
"message": message,
"couponDetails": couponDetails!.toJson(),
};
}
class CouponDetails {
String? code;
String? type;
String? discountValue;
CouponDetails({
this.code,
this.type,
this.discountValue,
});
factory CouponDetails.fromJson(Map<String, dynamic> json) => CouponDetails(
code: json["code"],
type: json["type"],
discountValue: json["discountValue"],
);
Map<String, dynamic> toJson() => {
"code": code,
"type": type,
"discountValue": discountValue,
};
}