//
//  VoucherGenerators.swift
//  iPOS
//
//  Created by Zoran Albu on 4/10/19.
//  Copyright © 2019 BBC. All rights reserved.
//

import Foundation
import ObjectMapper

class VoucherGenerators: Mappable{
    var voucherGeneratorId: Int = 0
    var code: String?
    var name: String = ""
    var styleId: Int?
    var voucherType: String = ""
    var isGiftCard: Bool?
    var isolationLevel: Bool?
    var validityDays: Int = 0
    var validityStartDate: Date?
    var isPlasticGift: Bool?
    var message: String = ""
    var minValue: Double = 0
    var maxValue: Double = 0
    var isRefundable: Bool?
    var assignExistingCode: Bool?
    var maxUseCount: Int = 0
    var cumulative: Bool?
    var isScalable: Bool?
    var isPOSVisible: Bool?
    var printBarcode: Bool?
    var repositoryType: String?
    var repositoryWSAddress: String?
    var allowReuse: Bool?
    var categoryCode: String = ""
    var isRedeemedByPromotion: Bool?
    var cumulativeCount: Int?
    var codeAssignmentMode: String = ""
    var posPaymentTypeId: Int?
    var discountCauseId: Int?
    var prefix: String?
    
    required init?(map: Map) {
    }
    
    init(barcode: String){
        
    }
    
    func mapping(map: Map) {
        voucherGeneratorId <- map["VoucherGeneratorId"]
        code <- map["Code"]
        name <- map["Name"]
        styleId <- map["StyleId"]
        voucherType <- map["VoucherType"]
        isGiftCard <- map["IsGiftCard"]
        isolationLevel <- map["IsolationLevel"]
        validityDays <- map["ValidityDays"]
        validityStartDate <- map["ValidityStartDate"]
        isPlasticGift <- map["IsPlasticGift"]
        message <- map["Message"]
        minValue <- map["MinValue"]
        maxValue <- map["MaxValue"]
        isRefundable <- map["IsRefundable"]
        assignExistingCode <- map["AssignExistingCode"]
        maxUseCount <- map["MaxUseCount"]
        cumulative <- map["Cumulative"]
        isScalable <- map["IsScalable"]
        isPOSVisible <- map["IsPOSVisible"]
        printBarcode <- map["PrintBarcode"]
        repositoryType <- map["RepositoryType"]
        repositoryWSAddress <- map["RepositoryWSAddress"]
        allowReuse <- map["AllowReuse"]
        categoryCode <- map["CategoryCode"]
        isRedeemedByPromotion <- map["IsRedeemedByPromotion"]
        cumulativeCount <- map["CumulativeCount"]
        codeAssignmentMode <- map["CodeAssignmentMode"]
        posPaymentTypeId <- map["PosPaymentTypeId"]
        discountCauseId <- map["DiscountCauseId"]
        prefix <- map["Prefix"]
    }
}
class VoucherGeneratorsResponse: Mappable {
    var odataMetadata: String?
    var value: [VoucherGenerators]?
    
    required init?(map: Map){
        
    }
    
    func mapping(map: Map) {
        odataMetadata <- map["odata.metadata"]
        value <- map["value"]
    }
}
