using Bp.Sync.Dto.Results;
using MediatR;
using System.Threading.Tasks;

namespace Bp.Sync.BackEnd.Factories
{
    public interface IUpdateFactory
    {
        Task<BaseResult> UpdateInvoiceToProductInvoice();

        Task<BaseResult> UpdateExpiryDateProductInventory();

        Task<BaseResult> UpdateProductInventory();

        Task<BaseResult> UpdateOutboundBill();

        Task<BaseResult> UpdateInboundBill();

        Task<BaseResult> UpdateInventoryBill();

        Task<BaseResult> UpdateRetailStatistic();

        Task<BaseResult> UpdateFcProductStorage();

        Task<BaseResult> UpdateExpiryDateFcProductStorage();

        Task<BaseResult> UpdateRetailStatisticCustomerPhoneNumber();

        Task<BaseResult> UpdateProductOrder();
    }

    public class UpdateFactory : IUpdateFactory
    {
        private readonly IMediator _mediator;

        public UpdateFactory(IMediator mediator)
        {
            _mediator = mediator;
        }

        public async Task<BaseResult> UpdateExpiryDateProductInventory()
        {
            return await _mediator.Send(new Application.Commands.Inventories.Products.UpdateExpiryDateProductInventoryCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateFcProductStorage()
        {
            return await _mediator.Send(new Application.Commands.FcBusinesses.Products.UpdateFcProductStorageCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateExpiryDateFcProductStorage()
        {
            return await _mediator.Send(new Application.Commands.FcBusinesses.Products.UpdateExpiryDateFcProductStorageCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateInvoiceToProductInvoice()
        {
            return await _mediator.Send(new Application.Commands.Inventories.ProductInvoices.UpdateInvoiceToProductInvoiceCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateOutboundBill()
        {
            return await _mediator.Send(new Application.Commands.Inventories.Bills.OutboundBills.UpdateOutboundBillCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateInboundBill()
        {
            return await _mediator.Send(new Application.Commands.Inventories.Bills.InboundBills.UpdateInboundBillCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateInventoryBill()
        {
            return await _mediator.Send(new Application.Commands.Inventories.Bills.InventoryBills.UpdateInventoryBillCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateRetailStatistic()
        {
            return await _mediator.Send(new Application.Commands.FcBusinesses.RetailStatistics.UpdateRetailStatisticCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateProductInventory()
        {
            return await _mediator.Send(new Application.Commands.Inventories.Products.UpdateProductInventoryCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateRetailStatisticCustomerPhoneNumber()
        {
            return await _mediator.Send(new Application.Commands.FcBusinesses.RetailStatistics.UpdateRetailStatisticCustomerPhoneNumberCommand(new System.Collections.Generic.List<long>()));
        }

        public async Task<BaseResult> UpdateProductOrder()
        {
            return await _mediator.Send(new Application.Commands.Inventories.ProductOrders.UpdateProductOrderCommand(new System.Collections.Generic.List<long>(), new System.Collections.Generic.List<long>()));
        }
    }
}