//
//  GenerateWelcomeVoucher.swift
//  iPOS
//
//  Created by Daniel Ciuciu on 2/17/21.
//  Copyright © 2021 BBC. All rights reserved.
//

import Foundation
import ObjectMapper

class WelcomeVoucherRequest: Mappable {
    var storeId: Int!
    var cashRegister: Int!
    var userId: String = ""
    var contactId: String = ""
    
    func mapping(map: Map) {
        storeId <- map["StoreId"]
        cashRegister <- map["CashRegister"]
        userId <- map["UserId"]
        contactId <- map["ContactId"]
    }
    
    required init?(map: Map) {
        self.storeId = Int(settings.StoreId)!
        self.cashRegister = Int(settings.CashRegister)!
        self.userId = settings.LoggedInUserId!
    }
    
    init() {
        self.storeId = Int(settings.StoreId)!
        self.cashRegister = Int(settings.CashRegister)!
        self.userId = settings.LoggedInUserId!
    }
}

class WelcomeVoucherResponse: Mappable {
    var isContactValid: Bool = false
    var shouldGenerateVoucher: Bool = false
    var voucherCode: String? = nil
    var isEmailSent: Bool = false
    var isSMSSent: Bool = false
    
    func mapping(map: Map) {
        isContactValid <- map["IsContactValid"]
        shouldGenerateVoucher <- map["ShouldGenerateVoucher"]
        voucherCode <- map["VoucherCode"]
        isEmailSent <- map["IsEmailSent"]
        isSMSSent <- map["IsSMSSent"]
    }
    
    required init?(map: Map) {
    }
    
    init() {
    }
}
