using SolarPower.Models;
using SolarPower.Models.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SolarPower.Repository.Interface
{
    public interface IUserRepository : IRepositoryBase<User>
    {
        /// <summary>
        /// 透過Account，取得單一筆資料
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        Task<User> GetOneByAccountAsync(string account);

        /// <summary>
        /// 透過Email，取得單一筆資料
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        Task<User> GetOneByEmailAsync(string email);

        /// <summary>
        /// 更換密碼
        /// </summary>
        /// <param name="password"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        Task ChangePassword(string password, int id);

        /// <summary>
        /// 透過Account，取得當前登入使用者資訊
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        MyUser GetMyUserInfoByAccount(string account);

        /// <summary>
        /// 取得單一使用者
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<SimpleUser> GetOneSimpleUser(int id);

        /// <summary>
        /// 修改個人資料
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="properties"></param>
        /// <returns></returns>
        Task UpdatePersonInfo(UpdateUser entity, List<string> properties);

        /// <summary>
        /// 更新密碼
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="properties"></param>
        /// <returns></returns>
        Task UpdatePassword(UpdatePassword entity, List<string> properties);

        /// <summary>
        /// 透過搜尋條件，查詢過濾後的使用者
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        Task<List<UserDateTable>> GetAllByFilterAsync(PostUserFilter filter);

        /// <summary>
        /// 透過公司，查詢使用者列表,0為全部公司的所有人
        /// </summary>
        /// <param name="CompanyId"></param>
        /// <returns></returns>
        Task<List<UserSelectItemList>> GetUserSelectOptionListAsync(int CompanyId);

        /// <summary>
        /// 透過使用者Id，取得該使用者所有管理的電站
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<UserPowerStation>> GetUserPowerStationAsync(int userId);

        /// <summary>
        /// 透過Id，取得該使用者單一管理的電站
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<UserPowerStation> GetOneUserPowerStationAsync(int id);

        /// <summary>
        /// 透過Id，刪除該使用者所管理的電站
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteOneUserPowerStationAsync(int id);

        /// <summary>
        /// 透過公司編號，取得該公司的電站
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<UserPowerStation>> GetCompanyPowerStationAsync(int companyId, int userId);
    }
}
