38 lines
1.5 KiB
PHP
38 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Libraries;
|
|
|
|
use App\Libraries\TPAClaimsImportServices\BaseTpaClaimImportService;
|
|
use App\Libraries\TPAClaimsImportServices\VidalClaimImportService;
|
|
use App\Libraries\TPAClaimsImportServices\AbhiClaimImportService;
|
|
use App\Libraries\TPAClaimsImportServices\FhplClaimImportService;
|
|
use App\Libraries\TPAClaimsImportServices\MediAssistClaimImportService;
|
|
use App\Libraries\TPAClaimsImportServices\RcareClaimImportService;
|
|
use App\Libraries\TPAClaimsImportServices\IciciClaimImportService;
|
|
use InvalidArgumentException;
|
|
|
|
class TpaClaimsImportFactory
|
|
{
|
|
/**
|
|
* Resolve TPA Import Service based on TPA ID
|
|
*
|
|
* @param int $tpaId
|
|
* @return BaseTpaClaimImportService
|
|
*/
|
|
public static function make(int $tpaId): BaseTpaClaimImportService
|
|
{
|
|
return match ($tpaId) {
|
|
|
|
(int) env('VIDAL_PRIMARY_KEY_CONSTANT') => new VidalClaimImportService(),
|
|
(int) env('ABHI_PRIMARY_KEY_CONSTANT') => new AbhiClaimImportService(),
|
|
(int) env('MEDI_ASSIST_PRIMARY_KEY_CONSTANT') => new MediAssistClaimImportService(),
|
|
(int) env('FHPL_PRIMARY_KEY_CONSTANT') => new FhplClaimImportService(),
|
|
(int) env('R_CARE_PRIMARY_KEY_CONSTANT') => new RcareClaimImportService(),
|
|
(int) env('ICICI_PRIMARY_KEY_CONSTANT') => new IciciClaimImportService(),
|
|
default => throw new InvalidArgumentException(
|
|
"Unsupported TPA ID: {$tpaId}"
|
|
),
|
|
};
|
|
}
|
|
}
|