using FruitBank.Common;
using FruitBank.Common.Dtos;
using FruitBank.Common.Entities;
using Mango.Nop.Core.Dtos;
using Mango.Nop.Core.Entities;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Common;
using Nop.Core.Domain.Orders;
using Nop.Data.Mapping;
using Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer;

namespace Nop.Plugin.Misc.FruitBankPlugin.Mapping;

public partial class NameCompatibility : INameCompatibility
{
    /// <summary>
    /// Gets table name for mapping with the type
    /// </summary>
    public Dictionary<Type, string> TableNames => new Dictionary<Type, string>
    {
        { typeof(GenericAttributeDto), nameof(GenericAttribute)},

        { typeof(Files), FruitBankConstClient.FilesDbTableName},
        { typeof(Pallet), FruitBankConstClient.PalletDbTableName},
        { typeof(Partner), FruitBankConstClient.PartnerDbTableName },
        { typeof(ProductDto), nameof(Product)},

        { typeof(OrderDto), nameof(Order)},
        { typeof(OrderItemDto), nameof(OrderItem)},
        { typeof(OrderItemPallet), FruitBankConstClient.OrderItemPalletDbTableName},

        { typeof(Shipping), FruitBankConstClient.ShippingDbTableName },
        { typeof(ShippingDocument), FruitBankConstClient.ShippingDocumentDbTableName },
        { typeof(ShippingItem), FruitBankConstClient.ShippingItemDbTableName},
        { typeof(ShippingItemPallet), FruitBankConstClient.ShippingItemPalletDbTableName},
        
        { typeof(ShippingDocumentToFiles), FruitBankConstClient.ShippingDocumentToFilesDbTableName},

        { typeof(StockQuantityHistoryDto), nameof(StockQuantityHistory)},        
        { typeof(StockQuantityHistoryExt), FruitBankConstClient.StockQuantityHistoryExtDbTableName},

        { typeof(StockTaking), FruitBankConstClient.StockTakingDbTableName},
        { typeof(StockTakingItem), FruitBankConstClient.StockTakingItemDbTableName},
        { typeof(StockTakingItemPallet), FruitBankConstClient.StockTakingItemPalletDbTableName},

        { typeof(CustomerCredit), FruitBankConstClient.CustomerCreditDbTableName},
        { typeof(PreOrder), FruitBankConstClient.PreOrderDbTableName},
        { typeof(PreOrderItem), FruitBankConstClient.PreOrderItemDbTableName},

        { typeof(CargoPartner), FruitBankConstClient.CargoPartnerDbTableName},
        { typeof(CargoTruck), FruitBankConstClient.CargoTruckDbTableName},

        { typeof(PartnerDepot), FruitBankConstClient.PartnerDepotDbTableName},
        { typeof(EkaerHistory), FruitBankConstClient.EkaerHistoryDbTableName},
        { typeof(EkaerHistoryMapping), FruitBankConstClient.EkaerHistoryMappingDbTableName},
    };


    /// <summary>
    ///  Gets column name for mapping with the entity's property and type
    /// </summary>
    public Dictionary<(Type, string), string> ColumnName => new();
}