//
//  InvoiceResponse.swift
//  iPOS
//
//  Created by BBC on 20/03/17.
//  Copyright © 2017 BBC. All rights reserved.
//

import Foundation
import ObjectMapper

class InvoiceResponse: Mappable {
    var resultCode: Int?
    var resultMessage: String?
    
    required init?(map: Map){
    }
    
    func mapping(map: Map) {
        resultCode <- map["ResultCode"]
        resultMessage <- map["ResultMessage"]
    }
}

class LoadedInvoice: Mappable{
    var invoiceNumber: String = ""
    var contact: Contact = Contact()
    var pdfDocument: String = ""
    
    required init?(map: Map){
        
    }
    
    func mapping(map: Map) {
        invoiceNumber <- map["InvoiceNumber"]
        contact <- map["Contacts"]
        pdfDocument <- map["PdfDocument"]
    }
}

class LoadInvoiceResponse: Mappable {
    var odataMetadata: String?
    var value: [LoadedInvoice]?
    
    required init?(map: Map){
        
    }
    
    func mapping(map: Map) {
        odataMetadata <- map["odata.metadata"]
        value <- map["value"]
    }
}
