package com.arrebol.taxiservicios.wrapper;

import com.arrebol.taxiservicios.model.stocktaking.ServiceOrderNotification;
import java.io.Serializable;
import java.util.Objects;

/**
 *
 * @author Carlos Janitzio Zavala Lopez
 */
public final class NotificationWrapper implements Serializable {

    private static final long serialVersionUID = -8758426352514717310L;

    private String id;
    private String title;
    private String message;
    private String icon;
    private String outcome;

    public NotificationWrapper() {
    }

    /**
     *
     * @param id
     */
    public NotificationWrapper(String id) {
        this.id = id;
    }

    /**
     *
     * @param notification
     */
    public NotificationWrapper(ServiceOrderNotification notification) {
        setId(notification.getId());
        setTitle(notification.getTitle());
        setMessage(notification.getMessage());

        switch (notification.getActionType()) {
            case CREATED:
                setIcon("fiber_new");
                setOutcome("/app/stocktaking/service/order/management/list");
                break;
            case APPROVED:
                setIcon("done");
                setOutcome("/app/stocktaking/service/order/garage/list");
                break;
            case REJECTED:
                setIcon("delete_sweep");
                setOutcome("/app/stocktaking/service/order/garage/list");
                break;
            default:
                setTitle("Tablero");
                setMessage("Tablero");
                setIcon("dashboard");
                setOutcome("/dashboard");
        }

    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getOutcome() {
        return outcome;
    }

    public void setOutcome(String outcome) {
        this.outcome = outcome;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final NotificationWrapper other = (NotificationWrapper) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

}
