- Finalised Listing of CartList - Added pull to refresh and swipe to delete - Handled manual delete on icon click - Made CouponCart listing view controller - Added api to fetch the coupons - Added api to apply coupon with model - Made a coupon discount stack , will show up
52 lines
1.2 KiB
Swift
52 lines
1.2 KiB
Swift
//
|
|
// CouponListDM.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 23/07/24.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// MARK: - CouponListDM
|
|
struct CouponListDM: Codable {
|
|
let result: [ResultData]?
|
|
let totalRecords: Int?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case result
|
|
case totalRecords = "total_records"
|
|
}
|
|
|
|
// MARK: - Result
|
|
struct ResultData: Codable {
|
|
let id: Int?
|
|
let couponCode: String?
|
|
let categoryMasterID, usageLimit, discountType: Int?
|
|
let discountValue, startFrom, endDate: String?
|
|
let category: Category?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case id
|
|
case couponCode = "coupon_code"
|
|
case categoryMasterID = "category_master_id"
|
|
case usageLimit = "usage_limit"
|
|
case discountType = "discount_type"
|
|
case discountValue = "discount_value"
|
|
case startFrom = "start_from"
|
|
case endDate = "end_date"
|
|
case category
|
|
}
|
|
}
|
|
|
|
// MARK: - Category
|
|
struct Category: Codable {
|
|
let id: Int?
|
|
let categoryName: String?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case id
|
|
case categoryName = "category_name"
|
|
}
|
|
}
|
|
}
|