//
//  RolesFilterModel.swift

//
//  Created by Leon on 2025/9/13.
//

struct RolesFilterModel:Codable{
    /// 支持多选、单选
    var sex: [Sex]?
    var age: AIRoleListRequestAge?
    var roleCodeList: [String]?
    
    // 统计筛选条件数
    func filterCount() -> Int{
        var count = 0
        if let sexCount = sex?.count, sexCount > 0{
            count += sexCount
        }
        if age != nil{
            count += 1
        }
        
        count += (roleCodeList ?? []).count
        return count
    }
}
