using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GreenTree.Nachtragsmanagement.Core.Domain.Deviation;

namespace GreenTree.Nachtragsmanagement.Services.Deviation
{
    public interface IDeviationService
    {
        #region Deviation

        /// <summary>
        /// Gets all deviations
        /// </summary>
        IList<Core.Domain.Deviation.Deviation> GetAllDeviations();

        /// <summary>
        /// Gets all deviations where the user is assigned to the corresponding site if the current role only allows assigned sites
        /// </summary>
        IList<Core.Domain.Deviation.Deviation> GetAllUserAssignedDeviations(Core.Domain.User.User user);

        /// <summary>
        /// Gets a deviation by specified Id
        /// </summary>
        /// <param name="id">Deviation identifier.</param>
        Core.Domain.Deviation.Deviation GetDeviationById(int id);

        /// <summary>
        /// Gets all deviations to the specified ids
        /// </summary>
        IList<Core.Domain.Deviation.Deviation> GetDeviationsByIds(int[] ids);

        /// <summary>
        /// Gets a deviation by specified customer number
        /// </summary>
        /// <param name="customNumber">Customer number.</param>
        Core.Domain.Deviation.Deviation GetDeviationByCustomNumber(string customNumber);

        /// <summary>
        /// Insert a deviation
        /// </summary>
        /// <param name="deviation">Deviation.</param>
        void InsertDeviation(Core.Domain.Deviation.Deviation deviation);

        /// <summary>
        /// Update a deviation
        /// </summary>
        /// <param name="deviation">Deviation.</param>
        void UpdateDeviation(Core.Domain.Deviation.Deviation deviation);

        /// <summary>
        /// Delete a deviation
        /// </summary>
        /// <param name="deviation">Deviation.</param>
        void DeleteDeviation(Core.Domain.Deviation.Deviation deviation);

        #endregion

        #region Disturbance

        /// <summary>
        /// Gets all disturbances
        /// </summary>
        IList<Disturbance> GetAllDisturbances();

        /// <summary>
        /// Gets a disturbance by specified Id
        /// </summary>
        /// <param name="id">Disturbance identifier.</param>
        Disturbance GetDisturbanceById(int id);

        /// <summary>
        /// Gets all disturbances to the specified ids
        /// </summary>
        IList<Disturbance> GetDisturbancesByIds(int[] ids);

        /// <summary>
        /// Insert a disturbance
        /// </summary>
        /// <param name="disturbance">Disturbance.</param>
        void InsertDisturbance(Disturbance disturbance);

        /// <summary>
        /// Update a disturbance
        /// </summary>
        /// <param name="disturbance">Disturbance.</param>
        void UpdateDisturbance(Disturbance disturbance);

        /// <summary>
        /// Delete a disturbance
        /// </summary>
        /// <param name="disturbance">Disturbance.</param>
        void DeleteDisturbance(Disturbance disturbance);

        #endregion

        #region Kind

        /// <summary>
        /// Gets all kinds
        /// </summary>
        IList<Kind> GetAllKinds();

        /// <summary>
        /// Gets a kind by specified Id
        /// </summary>
        /// <param name="id">Kind identifier.</param>
        Kind GetKindById(int id);

        /// <summary>
        /// Gets all kinds to the specified ids
        /// </summary>
        IList<Kind> GetKindsByIds(int[] ids);

        /// <summary>
        /// Gets all deviations to the specified with the specified kind id
        /// </summary>
        /// <param name="id">Kind identifier.</param>
        IList<Core.Domain.Deviation.Deviation> GetDeviationsByKind(int id);

        /// <summary>
        /// Gets the kind which is defaultly selected
        /// </summary>
        Kind GetDefaultKind();

        /// <summary>
        /// Insert a kind
        /// </summary>
        /// <param name="kind">Kind.</param>
        void InsertKind(Kind kind);

        /// <summary>
        /// Update a kind
        /// </summary>
        /// <param name="kind">Kind.</param>
        void UpdateKind(Kind kind);

        /// <summary>
        /// Delete a kind
        /// </summary>
        /// <param name="kind">Kind.</param>
        void DeleteKind(Kind kind);

        #endregion

        #region Status

        /// <summary>
        /// Gets all statuses
        /// </summary>
        IList<Status> GetAllStatuses();

        /// <summary>
        /// Gets a status by specified Id
        /// </summary>
        /// <param name="id">Status identifier.</param>
        Status GetStatusById(int id);

        /// <summary>
        /// Gets all statuses to the specified ids
        /// </summary>
        IList<Status> GetStatusesByIds(int[] ids);

        /// <summary>
        /// Gets all deviations to the specified with the specified status id
        /// </summary>
        /// <param name="id">Status identifier.</param>
        IList<Core.Domain.Deviation.Deviation> GetDeviationsByStatus(int id);

        /// <summary>
        /// Gets the status which is defaultly selected
        /// </summary>
        Status GetDefaultStatus();

        /// <summary>
        /// Insert a status
        /// </summary>
        /// <param name="status">Status.</param>
        void InsertStatus(Status status);

        /// <summary>
        /// Update a status
        /// </summary>
        /// <param name="status">Status.</param>
        void UpdateStatus(Status status);

        /// <summary>
        /// Delete a status
        /// </summary>
        /// <param name="status">Status.</param>
        void DeleteStatus(Status status);

        #endregion
    }
}
