package org.texttechnologylab.project.gruppe_05_1.xml.speeches.Impls;

import org.texttechnologylab.project.gruppe_05_1.xml.speeches.Interfaces.AgendaItem;
import org.texttechnologylab.project.gruppe_05_1.xml.speeches.Interfaces.Session;
import org.texttechnologylab.project.gruppe_05_1.xml.speeches.enums.MongoDBEntryType;

import java.util.ArrayList;
import java.util.List;

public class Session_File_Impl implements Session {
    private final int id;
    private final String legislativePeriod;
    private final String dateTime;
    private final String endTime;
    private final List<AgendaItem> agendaItems;

    @Override
    public int getId() {
        return id;
    }

    @Override
    public String getLegislativePeriod() {
        return legislativePeriod;
    }

    @Override
    public String getDateTime() {
        return dateTime;
    }

    @Override
    public String getEndTime() {
        return endTime;
    }

    @Override
    public List<AgendaItem> getAgendaItems() {
        return agendaItems;
    }

    public Session_File_Impl(String legislativePeriod, int id, String dateTime, String endTime) {
        this.id = id;
        this.legislativePeriod = legislativePeriod;
        this.dateTime = dateTime;
        this.endTime = endTime;
        this.agendaItems = new ArrayList<>();
    }

    @Override
    public MongoDBEntryType getType() {
        return MongoDBEntryType.SESSION;
    }

    @Override
    public void addAgendaItem(AgendaItem item) {
        this.agendaItems.add(item);
    }

    @Override
    public String toHTML() {
        return "<div class='session'>"
                + "<h2>Session Details</h2>"
                + "<p><strong>ID:</strong> " + id + "</p>"
                + "<p><strong>Legislative Period:</strong> " + legislativePeriod + "</p>"
                + "<p><strong>Start Time:</strong> " + dateTime + "</p>"
                + "<p><strong>End Time:</strong> " + endTime + "</p>"
                + "</div>";
    }
}
