package org.nmdp.hmlfhirconverter.domain;

/**
 * Created by abrown3 on 12/21/16.
 */

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@Document(collection = "Hml.TypingTestNames")
public class TypingTestName implements Serializable {

    @XmlAttribute
    @Id
    private String id;

    @XmlAttribute
    private String name;

    @XmlAttribute
    private String description;

    @XmlAttribute
    private Boolean active;

    @XmlAttribute
    private Date dateCreated;

    public TypingTestName() {

    }

    public TypingTestName(io.swagger.model.TypingTestName typingTestName) {
        this.name = typingTestName.getName();
        this.description = typingTestName.getDescription();
        this.id = typingTestName.getId();
        this.active = typingTestName.getActive();
        this.dateCreated = typingTestName.getDateCreated();
    }

    public TypingTestName(String name, String description) {
        this.name = name;
        this.description = description;
    }

    public TypingTestName(String id, String name, String description) {
        this.id = id;
        this.name = name;
        this.description = description;
    }

    public TypingTestNameDto toDto() {
        TypingTestNameDto dto = new TypingTestNameDto();

        dto.setName(this.name);
        dto.setId(this.id);
        dto.setDescription(this.description);

        return dto;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public Boolean getActive() { return active; }

    public Date getDateCreated() { return dateCreated; }

    @Override
    public String toString() {
        return "TypingTestName {" +
                " id = " + id +
                " name = " + name +
                " description = " + description +
                " }";
    }
}

@@ -1718,25 +1718,24 @@
 ption);%0A
-%0A
         
 return d
@@ -1730,316 +1730,106 @@
     
-return dto;%0A    %7D%0A%0A    public String getId() %7B%0A        return id;%0A    %7D%0A%0A    public String getName() %7B%0A        return name
+dto.setActive(this.active)
 ;%0A    
-%7D%0A%0A
     
-public String getDescription() %7B%0A        return description;%0A    %7D%0A%0A    public Boolean getActive() %7B return active; %7D%0A%0A    public Date getDateCreated() %7B return dateCreated;
+dto.setDateCreated(this.dateCreated);%0A%0A        return dto;%0A   
  %7D%0A%0A

Add methods to carry date and activity to typing test names.