//
//  StoreDayCloses.swift
//  iPOS
//
//  Created by bbc on 11/10/2017.
//  Copyright © 2017 BBC. All rights reserved.
//

import Foundation
import ObjectMapper

class  StoreDayClosesRequest: Mappable{
    var storeDayCloseId: UUID?
    var userId: UUID
    var startDate: Date!
    var endDate: Date!
    var storeId: Int!
    var cashRegister: Int!
    var cashDifference: Double!
    var notes: String!
    var vat0Value: Double = 0
    var vat1Value: Double = 0
    var vat2Value: Double = 0
    var vat3Value: Double = 0
    var vat4Value: Double = 0
    
    init() {
        userId = UUID.init()
    }
    
    required init?(map: Map){
        storeDayCloseId = UUID.init()
        userId = UUID.init()
    }
    
    func mapping(map: Map) {
        storeDayCloseId <- (map["StoreDayCloseId"], Util.CustomUuidTransform())
        userId <- (map["UserId"], Util.CustomUuidTransform())
        startDate <- map["StartDate"]
        endDate <- map["EndDate"]
        storeId <- map["StoreId"]
        cashRegister <- map["CashRegister"]
        cashDifference <- map["CashDifference"]
        notes <- map["Notes"]
        vat0Value <- map["vat0Value"]
        vat1Value <- map["vat1Value"]
        vat2Value <- map["vat2Value"]
        vat3Value <- map["vat3Value"]
        vat4Value <- map["vat4Value"]
    }
}

class  StoreDayClosesResponse: Mappable{
    var storeDayCloseId: UUID?
    var notes: String?
    var moneyMovements: [StoreDayClosesFiscalDayMoneyMovements]?
    var vats: [StoreDayClosesFiscalDayVats]?
    
    required init?(map: Map){
    }
    
    func mapping(map: Map) {
        notes <- map["notes"]
        storeDayCloseId <- (map["storeDayCloseId"], Util.CustomUuidTransform())
        moneyMovements <- map["moneyMovements"]
        vats <- map["vats"]
    }
}
