package backend.resource.serialization;

import java.time.LocalDate;
import java.util.Optional;

import backend.resource.TurboMilestone;

public class SerializableMilestone {
    private int id;
    private String title;
    private Optional<LocalDate> dueDate;
    private String description;
    private boolean isOpen;
    private int openIssues;
    private int closedIssues;

    public SerializableMilestone(TurboMilestone milestone) {
        this.id = milestone.getId();
        this.title = milestone.getTitle();
        this.dueDate = milestone.getDueDate();
        this.description = milestone.getDescription();
        this.isOpen = milestone.isOpen();
        this.openIssues = milestone.getOpenIssues();
        this.closedIssues = milestone.getClosedIssues();
    }

    public int getId() {
        return id;
    }
    public String getTitle() {
        return title;
    }
    public Optional<LocalDate> getDueDate() {
        return dueDate;
    }
    public String getDescription() {
        return description;
    }
    public boolean isOpen() {
        return isOpen;
    }
    public int getOpenIssues() {
        return openIssues;
    }
    public int getClosedIssues() {
        return closedIssues;
    }
}

@@ -1226,11 +1226,662 @@
 s;%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        String formatter = %22Milestone: %7B%25n%22%0A                + %22  id: %25d%25n%22%0A                + %22  title: %25s%25n%22%0A                + %22  dueDate: %25s%25n%22%0A                + %22  description: %25s%25n%22%0A                + %22  isOpen: %25b%25n%22%0A                + %22  openIssues: %25d%25n%22%0A                + %22  closedIssues: %25d%25n%22%0A                + %22%7D%22;%0A%0A        return String.format(%0A                formatter,%0A                getId(), getTitle(),%0A                getDueDate().isPresent() ? getDueDate().get() : %22%22,%0A                getDescription(),%0A                isOpen(),%0A                getOpenIssues(), getClosedIssues());%0A    %7D
 %0A%7D%0A

Implement SerializableMilestone's toString