package com.ecep.contract.vm;

import com.ecep.contract.model.ContractKind;

import javafx.beans.property.SimpleStringProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class ContractKindViewModel extends IdentityViewModel<ContractKind> {
    private SimpleStringProperty code = new SimpleStringProperty();
    private SimpleStringProperty name = new SimpleStringProperty();
    private SimpleStringProperty title = new SimpleStringProperty();

    @Override
    protected void updateFrom(ContractKind v) {
        super.updateFrom(v);
        code.set(v.getCode());
        name.set(v.getName());
        title.set(v.getTitle());
    }

    @Override
    public boolean copyTo(ContractKind v) {
        boolean result = super.copyTo(v);
        v.setCode(code.get());
        v.setName(name.get());
        v.setTitle(title.get());
        return result;
    }
}