//
//  YHEducationInfo.swift
//  galaxy
//
//  Created by edy on 2024/2/20.
//  Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//

import UIKit
import SmartCodable

class YHEducationListInfo: SmartCodable {
    var eduList: [YHEducationInfo]?
    var eduCount: Int = 0
    var quaList: [YHQualificationInfo]?
    var quaCount: Int = 0
    var qualification: Int = 0
    var graduate: Int = 0
    var married: Int = 0

    enum CodingKeys: String, CodingKey {
        case eduList = "edu_list"
        case eduCount = "edu_count"
        case quaList = "qua_list"
        case quaCount = "qua_count"
        case qualification = "qualification"
        case graduate = "graduate"
        case married = "married"
    }

    required init() {
        
    }
}

class YHEducationInfo: SmartCodable {
    var id: Int = 0
    var orderId: Int = 0
    var college: String?
    var background: String?
    var professional: String?
    var admissionTime: String?
    var graduateTime: String?
    var vacantNum: Int = 0

    enum CodingKeys: String, CodingKey {
        case id = "id"
        case orderId = "order_id"
        case college = "college"
        case background = "background"
        case professional = "professional"
        case admissionTime = "admission_time"
        case graduateTime = "graduate_time"
        case vacantNum = "vacant_num"
    }
    
    required init() {
        
    }
}

class YHQualificationInfo: SmartCodable {
    var id: Int = 0
    var orderId: Int = 0
    var qualification: String?
    var vacantNum: Int = 0

    enum CodingKeys: String, CodingKey {
        case id = "id"
        case orderId = "order_id"
        case qualification = "qualification"
        case vacantNum = "vacant_num"
    }

    required init() {
        
    }
}


class YHEducationDetailInfo: SmartCodable {
    
    var id: Int = 0
    var orderId: Int = 0
    var college: String = ""
    var isTop: Int = 0
    var type: String = ""
    var admissionTime: String = ""
    var graduateTime: String = ""
    var background: String = ""
    var professional: String = ""
    var degreeType: String = ""
    var remark: String = ""
    var average: String = ""
    var schoolAddress: YHCollegeAddress = YHCollegeAddress()
    var schoolAddressAboard: Int = 0
    var oldId: Int = 0
    var createdAt: String = ""
    var updatedAt: String = ""
    var deletedAt: String = ""
    var isShow: Int = 0
    var operatorName: String = ""
    var operatorEnglishName: String = ""
    var operatorId: Int = 0
    var matchListing: Int = 0
    var createFromAppid: Int = 0
    var updateFromAppid: Int = 0
    var customerCenterId: Int = 0
    
    enum CodingKeys: String, CodingKey {
        case id = "id"
        case orderId = "order_id"
        case college = "college"
        case isTop = "is_top"
        case type = "type"
        case admissionTime = "admission_time"
        case graduateTime = "graduate_time"
        case background = "background"
        case professional = "professional"
        case degreeType = "degree_type"
        case remark = "remark"
        case average = "average"
        case schoolAddress = "school_address"
        case schoolAddressAboard = "school_address_aboard"
        case oldId = "old_id"
        case createdAt = "created_at"
        case updatedAt = "updated_at"
        case deletedAt = "deleted_at"
        case isShow = "is_show"
        case operatorName = "operator_name"
        case operatorEnglishName = "operator_english_name"
        case operatorId = "operator_id"
        case matchListing = "match_listing"
        case createFromAppid = "create_from_appid"
        case updateFromAppid = "update_from_appid"
        case customerCenterId = "customer_center_id"
    }
    
    required init() {
        
    }
    // 学校是否在国外 默认是在国内
    func isSchoolInAboard() -> Bool {
        if schoolAddress.country.isEmpty { return false }
        if schoolAddress.country.contains("中国") {
            return false
        }
        return true
    }
}

class YHCollegeAddress: Codable {
   
    var area: [String] = []
    var country: String = ""
    var details: String = ""
    var foreign: String = ""

    enum CodingKeys: String, CodingKey {
        case area = "area"
        case country = "country"
        case details = "details"
        case foreign = "foreign"
    }

    required init() {
    
    }
}

class YHQualificationDetailInfo: SmartCodable {
    var id: String = ""
    var orderId: String = ""
    var college: String = ""
    var collegeAddress: YHCollegeAddress = YHCollegeAddress()
    var collegeAddressAboard: Int = 0
    var promulgation: String = ""
    var qualification: String = ""
    var remark: String = ""
    var oldId: Int = 0
    var createdAt: String = ""
    var updatedAt: String = ""
    var deletedAt: String = ""
    var operatorName: String = ""
    var operatorEnglishName: String = ""
    var operatorId: Int = 0
    var matchListing: Int = 0
    var createFromAppid: Int = 0
    var updateFromAppid: Int = 0
    var customerCenterId: Int = 0

    enum CodingKeys: String, CodingKey {
        case id = "id"
        case orderId = "order_id"
        case college = "college"
        case collegeAddress = "college_address"
        case collegeAddressAboard = "college_address_aboard"
        case promulgation = "promulgation"
        case qualification = "qualification"
        case remark = "remark"
        case oldId = "old_id"
        case createdAt = "created_at"
        case updatedAt = "updated_at"
        case deletedAt = "deleted_at"
        case operatorName = "operator_name"
        case operatorEnglishName = "operator_english_name"
        case operatorId = "operator_id"
        case matchListing = "match_listing"
        case createFromAppid = "create_from_appid"
        case updateFromAppid = "update_from_appid"
        case customerCenterId = "customer_center_id"
    }
    
    // 学校是否在国外 默认是在国内
    func isCollegeInAboard() -> Bool {
        if collegeAddress.country.isEmpty { return false }
        if collegeAddress.country.contains("中国") {
            return false
        }
        return true
    }

    required init() {
        
    }
}



