using Lada.Framework.Data.Domains.Finance;
using Lada.Framework.Data.Domains.Finance.Wallets;
using Lada.Framework.Data.Mappings.EntityMappings.Finance;
using Lada.Framework.Data.Mappings.EntityMappings.Finances;
using Lada.Framework.Data.Mappings.EntityMappings.Finances.Wallets;
using Microsoft.EntityFrameworkCore;

namespace Lada.Framework.Data.Mappings.DbContexts
{
    public partial class LadaDbContext
    {
        // Finance DbSets
        public virtual DbSet<Wallet> Wallets { get; set; }
        public virtual DbSet<Transaction> Transactions { get; set; }
        public virtual DbSet<TransactionOrder> TransactionOrders { get; set; }
        public virtual DbSet<CostCategory> CostCategories { get; set; }
        public virtual DbSet<Expense> Expenses { get; set; }
        public virtual DbSet<ExpenseCategory> ExpenseCategories { get; set; }
        public virtual DbSet<ExpenseHistory> ExpenseHistories { get; set; }
        public virtual DbSet<Income> Incomes { get; set; }
        public virtual DbSet<IncomeCategory> IncomeCategories { get; set; }
        public virtual DbSet<IncomeHistory> IncomeHistories { get; set; }
        public virtual DbSet<Reconciliation> Reconciliations { get; set; }
        public virtual DbSet<ReconciliationOrder> ReconciliationOrders { get; set; }
        public virtual DbSet<TransferPaymentBill> TransferPaymentBills { get; set; }
        public virtual DbSet<TransferPaymentBillOrder> TransferPaymentBillOrders { get; set; }

        // Customer Reconciliation Slip DbSets
        public virtual DbSet<CustomerReconciliationSlip> CustomerReconciliationSlips { get; set; }
        public virtual DbSet<CustomerReconciliationSlipDetail> CustomerReconciliationSlipDetails { get; set; }
        public virtual DbSet<CustomerReconciliationLog> CustomerReconciliationLogs { get; set; }
        public virtual DbSet<TaxInvoice> TaxInvoices { get; set; }

        // Bank Management DbSets
        public virtual DbSet<Bank> Banks { get; set; }
        public virtual DbSet<BankAccount> BankAccounts { get; set; }
        public virtual DbSet<BankTransaction> BankTransactions { get; set; }
        public virtual DbSet<BankStatementImport> BankStatementImports { get; set; }

        // Fuel Card (Credit Card) Management DbSets
        public virtual DbSet<FuelCard> FuelCards { get; set; }
        public virtual DbSet<FuelCardTransaction> FuelCardTransactions { get; set; }
        public virtual DbSet<FuelCardStatementImport> FuelCardStatementImports { get; set; }

        // VAT Invoice Management DbSets
        public virtual DbSet<VatInvoice> VatInvoices { get; set; }
        public virtual DbSet<VatInvoiceSyncHistory> VatInvoiceSyncHistories { get; set; }

        private void ApplyFinanceMappings(ModelBuilder builder)
        {
            builder
                .RegisterEntityMapping<Wallet, WalletMap>()
                .RegisterEntityMapping<Transaction, TransactionMap>()
                .RegisterEntityMapping<TransactionOrder, TransactionOrderMap>()
                .RegisterEntityMapping<CostCategory, CostCategoryMap>()
                .RegisterEntityMapping<Expense, ExpenseMap>()
                .RegisterEntityMapping<ExpenseCategory, ExpenseCategoryMap>()
                .RegisterEntityMapping<ExpenseHistory, ExpenseHistoryMap>()
                .RegisterEntityMapping<Income, IncomeMap>()
                .RegisterEntityMapping<IncomeCategory, IncomeCategoryMap>()
                .RegisterEntityMapping<IncomeHistory, IncomeHistoryMap>()
                .RegisterEntityMapping<Reconciliation, ReconciliationMap>()
                .RegisterEntityMapping<ReconciliationOrder, ReconciliationOrderMap>()
                .RegisterEntityMapping<TransferPaymentBill, TransferPaymentBillMap>()
                .RegisterEntityMapping<TransferPaymentBillOrder, TransferPaymentBillOrderMap>()

                // Customer Reconciliation Slip Mappings
                .RegisterEntityMapping<CustomerReconciliationSlip, CustomerReconciliationSlipMap>()
                .RegisterEntityMapping<CustomerReconciliationSlipDetail, CustomerReconciliationSlipDetailMap>()
                .RegisterEntityMapping<CustomerReconciliationLog, CustomerReconciliationLogMap>()
                .RegisterEntityMapping<TaxInvoice, TaxInvoiceMap>()

                // Bank Management Mappings
                .RegisterEntityMapping<Bank, BankMap>()
                .RegisterEntityMapping<BankAccount, BankAccountMap>()
                .RegisterEntityMapping<BankTransaction, BankTransactionMap>()
                .RegisterEntityMapping<BankStatementImport, BankStatementImportMap>()

                // Fuel Card (Credit Card) Mappings
                .RegisterEntityMapping<FuelCard, FuelCardMap>()
                .RegisterEntityMapping<FuelCardTransaction, FuelCardTransactionMap>()
                .RegisterEntityMapping<FuelCardStatementImport, FuelCardStatementImportMap>()

                // VAT Invoice Mappings
                .RegisterEntityMapping<VatInvoice, VatInvoiceMap>()
                .RegisterEntityMapping<VatInvoiceSyncHistory, VatInvoiceSyncHistoryMap>()
                ;
        }
    }

}
