TransactionToGbAfterBrexitExportHandler
extends AbstractExportHandler
in package
Table of Contents
Constants
- ACTIVE_HANDLERS = [\Vatjar\Export\Component\TransactionVolumeExportHandler::class, \Vatjar\Export\Component\VatReportSummaryExportHandler::class, \Vatjar\Export\Component\MovementMissingCountryExportHandler::class, \Vatjar\Export\Component\StorageDetectionExportHandler::class, \Vatjar\Export\Component\TransactionToGbAfterBrexitExportHandler::class, \Vatjar\Export\Component\GermanYearlyFilingExportHandler::class, \Vatjar\Export\Component\ArrangedUserExportHandler::class, \Vatjar\Export\Component\YearlyTransactionCountExportHandler::class, \Vatjar\Export\Component\ItalianYearlyFilingExportHandler::class]
- START_DATE = '2021-01-01'
- STATUS_CODES = [1 => 'OK_EXPORT', 2 => 'OK_MARKETPLACE_PORT', 3 => 'OK_VOEC_PORT', 10 => 'OK_B2B_DOMESTIC_SAME_COUNTRY', 11 => 'OK_B2B_DISTANCE', 13 => 'OK_B2B_DOMESTIC_DOMREV', 14 => 'OK_B2B_DEEMED_RESELLER', 15 => 'OK_B2B_INTRA_COMMUNITY_TRIANGULATION', 16 => 'OK_B2B_EXPORT', 20 => 'OK_B2C_DOMESTIC_SAME_COUNTRY', 21 => 'OK_B2C_DISTANCE', 22 => 'OK_B2C_DOMESTIC_NO_DISTANCE_VATID', 23 => 'OK_B2C_FORCED_DEPARTURE', 24 => 'OK_B2C_VOEC_DOMESTIC', 25 => 'OK_B2C_DISTANCE_OSS', 26 => 'OK_B2C_DST_GB_POST_BREXIT_UNDER_THRESHOLD', 27 => 'OK_B2C_DST_GB_POST_BREXIT_OVER_THRESHOLD', 30 => 'OK_PURCHASE_IMPORT', 31 => 'OK_B2B_POSTPONED_IMPORT_VAT', 35 => 'OK_PURCHASE_DOMV', 36 => 'OK_PURCHASE_DISTANCE', 40 => 'OK_ASSET_MOVEMENT_DOMESTIC', 41 => 'OK_ASSET_MOVEMENT_DISTANCE']
- not going to create the missing entity mapping and repository right now, so I will just paste this here
Properties
- $fileComponent : mixed
- $batchSize : int
- $clientRepository : ClientRepository
- $countryRepository : CountryRepository
- $currencyRateRepository : CurrencyRateRepository
- $currencyRates : array<int, CurrencyRate>
- $euCountryIds : array<string|int, int>
- $movementCreditRepository : MovementCreditRepository
- $period : DatePeriod
- $startDate : DateTimeImmutable
- $subscriptionsRepository : SubscriptionsRepository
- $subscriptionStatusRepository : SubscriptionStatusRepository
- $userModuleRepository : UserModuleRepository
Methods
- __construct() : mixed
- createJob() : mixed
- filterParams() : array<string|int, mixed>
- getAllowedFilters() : array<string|int, mixed>
- getBucketName() : string
- getExportTypes() : array<string|int, mixed>
- getFileComponent() : AbstractExportFile
- getHeaders() : array<string|int, mixed>
- getLastRowsNumber() : array<string|int, mixed>
- getLine() : mixed
- Get the value of line
- getLines() : Generator<string|int, array<string|int, string>>
- getType() : string
- handle() : mixed
- markAsInProgress() : mixed
- validateParams() : void
- validatePositiveInteger() : mixed
- cloudPath() : mixed
- createFile() : resource
- filename() : string|null
- generateFile() : void
- getCloudStorageComponent() : mixed
- localPath() : mixed
- markAsDone() : mixed
- registerShutdownFunction() : mixed
- remoteUri() : mixed
- removeFile() : mixed
- saveError() : mixed
- saveToCloud() : mixed
- validateBool() : bool
- validateDate() : bool
- validateRequired() : bool
- validateString() : bool
- getFromCountries() : array<string|int, int>
- getMovementCredits() : Generator<int, MovementCredit>
- log() : mixed
Constants
ACTIVE_HANDLERS
public
mixed
ACTIVE_HANDLERS
= [\Vatjar\Export\Component\TransactionVolumeExportHandler::class, \Vatjar\Export\Component\VatReportSummaryExportHandler::class, \Vatjar\Export\Component\MovementMissingCountryExportHandler::class, \Vatjar\Export\Component\StorageDetectionExportHandler::class, \Vatjar\Export\Component\TransactionToGbAfterBrexitExportHandler::class, \Vatjar\Export\Component\GermanYearlyFilingExportHandler::class, \Vatjar\Export\Component\ArrangedUserExportHandler::class, \Vatjar\Export\Component\YearlyTransactionCountExportHandler::class, \Vatjar\Export\Component\ItalianYearlyFilingExportHandler::class]
START_DATE
private
mixed
START_DATE
= '2021-01-01'
STATUS_CODES
not going to create the missing entity mapping and repository right now, so I will just paste this here
private
mixed
STATUS_CODES
= [1 => 'OK_EXPORT', 2 => 'OK_MARKETPLACE_PORT', 3 => 'OK_VOEC_PORT', 10 => 'OK_B2B_DOMESTIC_SAME_COUNTRY', 11 => 'OK_B2B_DISTANCE', 13 => 'OK_B2B_DOMESTIC_DOMREV', 14 => 'OK_B2B_DEEMED_RESELLER', 15 => 'OK_B2B_INTRA_COMMUNITY_TRIANGULATION', 16 => 'OK_B2B_EXPORT', 20 => 'OK_B2C_DOMESTIC_SAME_COUNTRY', 21 => 'OK_B2C_DISTANCE', 22 => 'OK_B2C_DOMESTIC_NO_DISTANCE_VATID', 23 => 'OK_B2C_FORCED_DEPARTURE', 24 => 'OK_B2C_VOEC_DOMESTIC', 25 => 'OK_B2C_DISTANCE_OSS', 26 => 'OK_B2C_DST_GB_POST_BREXIT_UNDER_THRESHOLD', 27 => 'OK_B2C_DST_GB_POST_BREXIT_OVER_THRESHOLD', 30 => 'OK_PURCHASE_IMPORT', 31 => 'OK_B2B_POSTPONED_IMPORT_VAT', 35 => 'OK_PURCHASE_DOMV', 36 => 'OK_PURCHASE_DISTANCE', 40 => 'OK_ASSET_MOVEMENT_DOMESTIC', 41 => 'OK_ASSET_MOVEMENT_DISTANCE']
Properties
$fileComponent
protected
mixed
$fileComponent
$batchSize
private
int
$batchSize
$clientRepository
private
ClientRepository
$clientRepository
$countryRepository
private
CountryRepository
$countryRepository
$currencyRateRepository
private
CurrencyRateRepository
$currencyRateRepository
$currencyRates
private
array<int, CurrencyRate>
$currencyRates
$euCountryIds
private
array<string|int, int>
$euCountryIds
$movementCreditRepository
private
MovementCreditRepository
$movementCreditRepository
$period
private
DatePeriod
$period
$startDate
private
DateTimeImmutable
$startDate
$subscriptionsRepository
private
SubscriptionsRepository
$subscriptionsRepository
$subscriptionStatusRepository
private
SubscriptionStatusRepository
$subscriptionStatusRepository
$userModuleRepository
private
UserModuleRepository
$userModuleRepository
Methods
__construct()
public
__construct(ClientRepository $clientRepository, CountryRepository $countryRepository, SubscriptionsRepository $subscriptionsRepository, SubscriptionStatusRepository $subscriptionStatusRepository, MovementCreditRepository $movementCreditRepository, UserModuleRepository $userModuleRepository, CurrencyRateRepository $currencyRateRepository) : mixed
Parameters
- $clientRepository : ClientRepository
- $countryRepository : CountryRepository
- $subscriptionsRepository : SubscriptionsRepository
- $subscriptionStatusRepository : SubscriptionStatusRepository
- $movementCreditRepository : MovementCreditRepository
- $userModuleRepository : UserModuleRepository
- $currencyRateRepository : CurrencyRateRepository
createJob()
public
final static createJob(Export $export) : mixed
Parameters
- $export : Export
Tags
filterParams()
public
static filterParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>getAllowedFilters()
public
getAllowedFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>getBucketName()
public
getBucketName() : string
Return values
stringgetExportTypes()
public
static getExportTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>getFileComponent()
public
getFileComponent() : AbstractExportFile
Return values
AbstractExportFilegetHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getLastRowsNumber()
public
getLastRowsNumber() : array<string|int, mixed>
Return values
array<string|int, mixed>getLine()
Get the value of line
public
getLine() : mixed
getLines()
public
getLines(array<string|int, mixed> $parameters) : Generator<string|int, array<string|int, string>>
Parameters
- $parameters : array<string|int, mixed>
Tags
Return values
Generator<string|int, array<string|int, string>>getType()
public
static getType() : string
Return values
stringhandle()
public
final handle(Export &$export) : mixed
Parameters
- $export : Export
Tags
markAsInProgress()
public
markAsInProgress(Export &$export) : mixed
Parameters
- $export : Export
validateParams()
public
static validateParams(array<string|int, mixed> $params) : void
Parameters
- $params : array<string|int, mixed>
validatePositiveInteger()
public
static validatePositiveInteger(mixed $value) : mixed
Parameters
- $value : mixed
cloudPath()
protected
cloudPath(Export $export) : mixed
Parameters
- $export : Export
createFile()
protected
createFile() : resource
Tags
Return values
resourcefilename()
protected
filename(Export $export) : string|null
Parameters
- $export : Export
Return values
string|nullgenerateFile()
protected
generateFile(resource $file, array<string|int, mixed> $parameters) : void
Parameters
- $file : resource
- $parameters : array<string|int, mixed>
Tags
getCloudStorageComponent()
protected
getCloudStorageComponent(string $bucket) : mixed
Parameters
- $bucket : string
localPath()
protected
localPath(resource $file) : mixed
Parameters
- $file : resource
markAsDone()
protected
markAsDone(resource $file, Export &$export) : mixed
Parameters
- $file : resource
- $export : Export
registerShutdownFunction()
protected
registerShutdownFunction(Export &$export, mixed &$file) : mixed
Parameters
- $export : Export
- $file : mixed
remoteUri()
protected
remoteUri(Export $export) : mixed
Parameters
- $export : Export
removeFile()
protected
removeFile(resource $file) : mixed
Parameters
- $file : resource
saveError()
protected
saveError(Export $export, Throwable $e) : mixed
Parameters
- $export : Export
- $e : Throwable
saveToCloud()
protected
saveToCloud(resource $file, Export $export) : mixed
Parameters
- $file : resource
- $export : Export
validateBool()
protected
static validateBool(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateDate()
protected
static validateDate(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateRequired()
protected
static validateRequired(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolvalidateString()
protected
static validateString(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolgetFromCountries()
private
getFromCountries(Client $client, DateTimeInterface $month, array<int, Subscriptions> $subscriptions) : array<string|int, int>
Parameters
- $client : Client
- $month : DateTimeInterface
- $subscriptions : array<int, Subscriptions>
Return values
array<string|int, int>getMovementCredits()
private
getMovementCredits(Client $client, array<string|int, mixed> $subscriptions) : Generator<int, MovementCredit>
Parameters
- $client : Client
- $subscriptions : array<string|int, mixed>
Return values
Generator<int, MovementCredit>log()
private
log(string $message) : mixed
Parameters
- $message : string