package com.repository;

import com.entity.Sprint;
import org.springframework.stereotype.Repository;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * Interface repository for the sprints.
 *
 * @author Laurentiu Marcut
 */
@Repository
public interface SprintsRepository {

    /**
     *
     * Select sprint by id.
     *
     * @param project
     * @param id
     * @return sprint
     * @throws SQLException
     */
    Sprint select(String project, int id) throws SQLException;

    /**
     *
     * Select all sprints.
     *
     * @param project
     * @return sprints
     * @throws SQLException
     */
    List<Sprint> selectAll(String project) throws SQLException;

    /**
     *
     * Select all ids.
     *
     * @param project
     * @return ids
     * @throws SQLException
     */
    List<Integer> selectAllIds(String project) throws SQLException;

    /**
     *
     * Select total sprints.
     *
     * @param project
     * @return total sprints.
     * @throws SQLException
     */
    int selectTotalSprints(String project) throws SQLException;

    /**
     *
     * Insert sprint.
     *
     * @param id
     * @param project
     * @throws SQLException
     */
    void insert(int id, String project) throws SQLException;

    /**
     *
     * Delete sprint.
     *
     * @param id
     * @param project
     * @throws SQLException
     */
    void delete(int id, String project) throws SQLException;

    /**
     *
     * Update start date.
     *
     * @param id
     * @param project
     * @param startDate
     * @throws SQLException
     */
    void updateStartDate(int id, String project, Date startDate) throws SQLException;

    /**
     *
     * Update end date.
     *
     * @param id
     * @param project
     * @param endDate
     * @throws SQLException
     */
    void updateEndDate(int id, String project, Date endDate) throws SQLException;

    /**
     *
     * Update total capacity.
     *
     * @param id
     * @param project
     * @param totalCapacity
     * @throws SQLException
     */
    void updateTotalCapacity(int id, String project, int totalCapacity) throws SQLException;

    /**
     *
     * Update members.
     *
     * @param id
     * @param project
     * @param members
     * @throws SQLException
     */
    void updateMembers(int id, String project, int members) throws SQLException;

    /**
     *
     * Update state.
     *
     * @param project
     * @param id
     * @param state
     * @throws SQLException
     */
    void updateState(String project, int id,  String state) throws SQLException;
}
