//
//  UserDataDM.swift
//  WOKA
//
//  Created by MacBook Pro on 06/05/24.
//

import Foundation

// MARK: - UserDataDM
struct UserDataDM: Codable {
    let result: ResultData?
    

    // MARK: - Result
    struct ResultData: Codable {
        let id: Int?
        var username, fullname: String?
        var genderData: Gender?
        let birthdate, email: String?
        let avtar: String?
        let avtarURL : String?
        var userType: String?
        let languageMasterID: Int?
        let lastLogin, rememberToken: String?
        let childDetail: ChildDetail?
        let language: Language?
        let alreadyLoggedIn: Bool?
        let isDeactive : Bool?
        enum CodingKeys: String, CodingKey {
            case id, username, fullname, birthdate, email, avtar
            case avtarURL = "avtar_url"
            case genderData = "gender_data"
            case userType = "user_type"
            case languageMasterID = "language_master_id"
            case lastLogin = "last_login"
            case rememberToken = "remember_token"
            case childDetail = "child_detail"
            case language
            case alreadyLoggedIn = "already_logged_in"
            case isDeactive = "is_deactive"
        }
    }

    // MARK: - ChildDetail
    struct ChildDetail: Codable {
        let id, userID: Int?
        let interestTopic: [InterestTopic]?

        enum CodingKeys: String, CodingKey {
            case id
            case userID = "user_id"
            case interestTopic = "interest_topic"
        }
    }

    // MARK: - InterestTopic
    struct InterestTopic: Codable {
        let id: Int?
        let topicName: String?

        enum CodingKeys: String, CodingKey {
            case id
            case topicName = "topic_name"
        }
    }

    // MARK: - Gender
    struct Gender: Codable {
        var id: Int?
        var genderName: String?

        enum CodingKeys: String, CodingKey {
            case id
            case genderName = "gender_name"
        }
    }

    // MARK: - Language
    struct Language: Codable {
        let id: Int?
        let languageName: String?

        enum CodingKeys: String, CodingKey {
            case id
            case languageName = "language_name"
        }
    }
}
//// MARK: - UserDataDM
//struct UserDataDM: Codable {
//    let result: Result?
//    
//    // MARK: - Result
//    struct Result: Codable {
//        let id: Int?
//        let username, fullname: String?
//        let gender: Gender?
//        let birthdate, email: String?
//        let avtar: String?
//        let userType: String?
//        let languageMasterID: Int?
//        let isActive: String?
//        let deletedAt: String?
//        let lastLogin, rememberToken: String?
//        let childDetail: String?
//        let language: Language?
//        let alreadyLoggedIn: Bool?
//        
//        enum CodingKeys: String, CodingKey {
//            case id, username, fullname, gender, birthdate, email, avtar
//            case userType = "user_type"
//            case languageMasterID = "language_master_id"
//            case isActive = "is_active"
//            case deletedAt = "deleted_at"
//            case lastLogin = "last_login"
//            case rememberToken = "remember_token"
//            case childDetail = "child_detail"
//            case language
//            case alreadyLoggedIn = "already_logged_in"
//        }
//    }
//    
//    // MARK: - Gender
//    struct Gender: Codable {
//        let id: Int?
//        let genderName: String?
//
//        enum CodingKeys: String, CodingKey {
//            case id
//            case genderName = "gender_name"
//        }
//    }
//    
//    // MARK: - Language
//    struct Language: Codable {
//        let id: Int?
//        let languageName: String?
//
//        enum CodingKeys: String, CodingKey {
//            case id
//            case languageName = "language_name"
//        }
//    }
//}
