Swap Mautic database tables

My Mautic version is: 4.4.4 (suggestiond with 5.0+ are accepted too)

Hello, I would like to know where is located Mautic code which is responsible for importing data (Import from background option on contacts page to be specific) into leads datatable (Mautic database, leads table which is responsible for holding contacts information).

To put this simply I would like to know where should I look for code which is executed after contacts are about to be imported. (I am aware that cron job mautic:import is also taking part in this so I would like to find any related code which is executed either by this cron job or directly after import).

Final goal is to swap leads table with custom_leads table and import data into custom_leads table. But to make sure all campaigns and contacts related logic is still tied to leads table, meaning if I decide to move data from custom_leads table into leads table, only data present in leads table will be interacted with in Mautic.

@joeyk Any thoughts on this?

I guess somewhere in contact bundle.
This is giving you more clue:

Thanks for the tip.
@joeyk in this file: mautic/app/bundles/LeadBundle/Model/ImportModel.php at 4a3cfb7c16c0551490cc598508d935cc3b31969d · mautic/mautic · GitHub

I got to the line:
“”"

$event = new ImportProcessEvent($import, $eventLog, $data);

$this->dispatcher->dispatch($event, LeadEvents::IMPORT_ON_PROCESS);

“”"
So regarding this any idea which listener is responsible for continuing import logic following from this part of code?

My final goal is to locate code which is responsible for importing contacts into leads table, also in future will need same for lead_lists_leads table.

So I would like to know where import code says to import into leads table.