//
//  FullDamage.swift
//  kt
//
//  Created by Assylkhan Rakhatov on 17.11.16.
//  Copyright © 2016 Alexandr Zalutskiy. All rights reserved.
//

import Foundation

class FullDamage {
  var damageId: String?
  var status: String?
  var damageBittlId: String?
  var statusId: String?
  var assetNumber: String?
  var date: String?
  var complaintId: String?
  var complaintName: String?
  var applicantId: String?
  var applicantName: String?
  var townName: String?
  var comments: String?
  var deviceGroup: String?
  var endDate: String?
  var damageNumber: String?
  var cancel: String?
  var cancelDate: String?
  var markName: String?
  var markDate: String?
  
    func isCanceled() -> Bool {
        return (cancelDate?.characters.count > 0 || endDate?.characters.count > 0) ? true : false
    }

    
  init(json: JSON) {
    self.damageId = json["damage_id"].string
    self.status = json["status"].string
    self.damageBittlId = json["damage_bittl_id"].string
    self.statusId = json["status_id"].string
    self.assetNumber = json["asset_number"].string
    self.date = json["date"].string
    self.complaintId = json["complaint_id"].string
    self.complaintName = json["complaint_name"].string
    self.applicantId = json["applicant_id"].string
    self.applicantName = json["applicant_name"].string
    self.townName = json["town_name"].string
    self.comments = json["comments"].string
    self.deviceGroup = json["device_group"].string
    self.endDate = json["end_date"].string
    self.damageNumber = json["damage_number"].string
    self.cancel = json["cancel"].string
    self.cancelDate = json["cancel_date"].string
    self.markName = json["mark_name"].string
    self.markDate = json["mark_date"].string
  }
}
