//
//  ParametersList.swift
//  OrderScheduling
//
//  Created by 中道 on 2023/8/7.
//

import Foundation

enum OrderTypeEnum : Int, Encodable {
    case TO_ACCEPT_DISPATCH = 1
    case TO_DISPATCH_VEHICLE = 3
    case TO_RESCUE = 5
    case TO_AUDIT_FAILED = 7
    case UNCLOSED_ORDER = 9
    case WITHIN_30_DAYS = 11
    case WITHIN_3_MONTHS = 12
}

public struct LoginCodeParameters : Encodable {
    var phone : String
}

public struct LoginParameters : Encodable {
    var app_login_json : String
    var client_id : Bool

    public init(app_login_json: String,client_id: Bool) {
        self.app_login_json = app_login_json
        self.client_id = client_id
    }
}

public struct LogoutParameters : Encodable {
    var  deviceId : Int
}

public struct OrderListParameters : Encodable {
    var pageNum : Int
    var pageSize : Int  = 12
    var queryType : OrderTypeEnum
}

public struct AcceptDispatchParameters : Encodable {
    var userOrderId : Int
    var taskOrderId : Int
}

public struct RefuseDispatchParameters : Encodable {
    public enum RefuseReasonItemEnum : String, Encodable {
        case time = "时间长"
        case disatance = "距离远"
        case cannotDispatch = "无法安排"
    }
    var userOrderId : Int
    var taskOrderId : Int
    var remarkId : String?
    var refuseReasonItem : String?
    var refuseReasonDesc : String?
}

public struct OrderReportParameters : Encodable {
    var queryType : OrderTypeEnum
    var userOrderId : Int
    var orderCode : Int
    var reportingItem : String?
    var reportingDesc : String?
}

public struct DispatchVehicleListParameters : Encodable {
    enum DispatchVehicleListTypeEnum: Int, Encodable {
        case online = 1
        case offline = 2
    }
    var type : DispatchVehicleListTypeEnum
    var userOrderId : Int
    var taskOrderId : Int
    var driverId : Int?
    var vehicleId : Int?
}

public struct DispatchVehicleParameters : Encodable {
    var type : DispatchVehicleTypeEnum
    var userOrderId : Int
    var taskOrderId : Int
    var driverId : Int?
    var vehicleId : Int?
    var driverName : String?
    var driverPhone : String?
    var plateNumber : String?
    enum DispatchVehicleTypeEnum : Int,Encodable {
        case online = 1
        case offline = 2
    }
}

public struct RtspChannelParameters : Encodable {
    var vehicleId : Int
    var external : Int = 1
}

public struct OrderPhotoList : Encodable {
    var userOrderId : Int
    var orderCode : String
    var taskOrderId : Int
}

public struct SupplementOrderPhoto : Encodable {
    var userOrderId : Int
    var orderCode : String
    var taskOrderId : Int
    
    var taskStatus : Int
    var tag : String
    var file : Data
}
