//
//  KaraokeListingDM.swift
//  WOKA
//
//  Created by Bilal on 05/07/2024.
//

import Foundation

// MARK: - KaraokeListingDM
struct KaraokeListingDM: Codable {
    let karaokeData: [KaraokeDatum]?
    let totalRecords: Int?

    enum CodingKeys: String, CodingKey {
        case karaokeData = "karaoke_data"
        case totalRecords = "total_records"
    }
    
    // MARK: - KaraokeDatum
    struct KaraokeDatum: Codable {
        let id: Int?
        let title, description: String?
        let videoURL: String?
        let thumbnailPath: String?
        let releaseDate: String?
        let duration, categoryMasterID, ageRangeMasterID, genderMasterID: String?
        let languageMasterID: Int?
        let contentMoreDetails: [ContentMoreDetail]?
//        let categoryData, ageRangeData, genderData: [JSONAny]?
        var markAsFavourite, isLiked: Bool?
        var viewsCount, likesCount, bookmarkCount: Int?

        enum CodingKeys: String, CodingKey {
            case id, title, description
            case videoURL = "video_url"
            case thumbnailPath = "thumbnail_path"
            case releaseDate = "release_date"
            case duration
            case categoryMasterID = "category_master_id"
            case ageRangeMasterID = "age_range_master_id"
            case genderMasterID = "gender_master_id"
            case languageMasterID = "language_master_id"
            case contentMoreDetails = "content_more_details"
//            case categoryData = "category_data"
//            case ageRangeData = "age_range_data"
//            case genderData = "gender_data"
            case markAsFavourite = "mark_as_favourite"
            case isLiked = "is_liked"
            case viewsCount = "views_count"
            case likesCount = "likes_count"
            case bookmarkCount = "bookmark_count"
        }
    }

    // MARK: - ContentMoreDetail
    struct ContentMoreDetail: Codable {
        let id, contentID, postType, languageMasterID: Int?
        let title, description: String?
        let url: String?
        let tagsKeywords: String?
        let videoUrlHd : String?
        
        enum CodingKeys: String, CodingKey {
            case id
            case contentID = "content_id"
            case postType = "post_type"
            case languageMasterID = "language_master_id"
            case title, description, url
            case tagsKeywords = "tags_keywords"
            case videoUrlHd = "video_url_hd"
        }
    }
}

