package com.armstrongconsulting.acprotasks;

import java.util.Date;

import javax.swing.*;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import com.armstrongconsulting.acprotasks.client.model.Item;
import com.intellij.tasks.Comment;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskType;

import icons.TasksIcons;

public class AcproTask extends Task
{
    private String id;
    private String summary;
    private String description;

    public AcproTask(Item item)
    {
        this.id = String.valueOf(item.getId());
        this.summary = item.getTitle();
        this.description = item.getDescription();
    }

    @Override
    public @NotNull String getId()
    {
        return id;
    }

    @Override
    public @NotNull String getSummary()
    {
        return summary;
    }

    @Override
    public @Nullable String getDescription()
    {
        return description;
    }

    @Override
    public @NotNull Comment[] getComments()
    {
        return new Comment[0];
    }

    @Override
    public @NotNull Icon getIcon()
    {
        return TasksIcons.Bug;
    }

    @Override
    public @NotNull TaskType getType()
    {
        return TaskType.BUG;
    }

    @Override
    public @Nullable Date getUpdated()
    {
        return null;
    }

    @Override
    public @Nullable Date getCreated()
    {
        return null;
    }

    @Override
    public boolean isClosed()
    {
        return false;
    }

    @Override
    public boolean isIssue()
    {
        return false;
    }

    @Override
    public @Nullable String getIssueUrl()
    {
        return "https://www.acpro.at/item/" + id;
    }
}
