JobApiImportComponent
extends AbstractJobHandlerComponent
in package
uses
TraitUploadHelper, SimpleRollbackComponent
Table of Contents
Constants
- DEFAULT_CHANNEL_ID = "API"
- SUPPORTED_JOB_ACTION_LIST = [\Vatjar\Data\EntityInterface\Job::MAIN_ACTION_API => [\Vatjar\Data\EntityInterface\Job::SUB_ACTION_IMPORT]]
Properties
- $cache : mixed
- $reportUser : mixed
- $job : Job
- $jobList : array<string|int, Job>
- $helperComponent : mixed
- $lockList : FSLock[string]
- $opt : array<string|int, mixed>
Methods
- __construct() : mixed
- addCache() : self
- Set the value of cache
- addMultiUseCache() : mixed
- if something validated which and maybe need to recheck pass to this, and check this with a simple condition
- afterHandle() : JobResult
- beforeHandle() : mixed
- canBeReset() : bool
- copyToApiSpecialTables() : array<string|int, mixed>
- create() : static
- createAndHandle() : mixed
- createUploadableRow() : array<string|int, mixed>
- dateChecker() : mixed
- doRollbackToJob() : bool
- getAlreadyAdded() : mixed
- if a value already validated or used and not need to recheck
- getCache() : mixed
- Get the value of cache
- getCountryAndNumberFromVatid() : array<string|int, mixed>
- getCountryIdFromVatid() : mixed
- getHelperComponent() : ApiJobHandlerComponent|null
- Get the value of helperComponent.
- getJob() : Job
- getJobList() : array<string|int, Job>
- getJobParameters() : array<string|int, mixed>
- getLockNameListForHandle() : mixed
- getLockPrefix() : string
- getOpt() : array<string|int, mixed>
- getOptUser() : mixed
- getOptUserId() : mixed
- getOptVal() : mixed
- getOptValOr() : mixed
- getProductByRow() : mixed
- getReportUser() : Client
- Get the value of reportUser.
- getShippingPrice() : mixed
- getTypeIdFromRow() : int
- getUploadableContent() : array<string|int, mixed>
- getValidVatidByVies() : mixed
- handle() : JobResult
- handleJob() : mixed
- handleLock() : mixed
- hasOptKey() : mixed
- initCache() : mixed
- loadJobList() : mixed
- lock() : bool
- markJobResetAsFailed() : bool
- processApiOrder() : array<string|int, mixed>
- setHelperComponent() : self
- Set the value of helperComponent.
- setJob() : mixed
- setOpt() : static
- setReportUser() : self
- Set the value of reportUser.
- support() : bool
- unlock() : void
- _handle() : JobResult
- formatDecimal() : mixed
- getAmazonProductList() : array<string|int, mixed>
- getFixedVatNumber() : mixed
- getIdListBySkuList() : array<string|int, mixed>
- getIsCreditNote() : int
- getMovementTypeId() : int|null
- getPerspectiveId() : int|null
- getProductListBySkuAndHellotax() : mixed
- getUserVatList() : mixed
- getVatCountryFromRow() : mixed
- getVatTypeId() : mixed
- dateHasTime() : mixed
- getCacheName() : mixed
- getDateFromString() : mixed
Constants
DEFAULT_CHANNEL_ID
public
mixed
DEFAULT_CHANNEL_ID
= "API"
SUPPORTED_JOB_ACTION_LIST
public
mixed
SUPPORTED_JOB_ACTION_LIST
= [\Vatjar\Data\EntityInterface\Job::MAIN_ACTION_API => [\Vatjar\Data\EntityInterface\Job::SUB_ACTION_IMPORT]]
Properties
$cache
public
mixed
$cache
= []
$reportUser
public
mixed
$reportUser
$job
protected
Job
$job
$jobList
protected
array<string|int, Job>
$jobList
$helperComponent
private
mixed
$helperComponent
= null
Tags
$lockList
private
FSLock[string]
$lockList
= []
$opt
private
array<string|int, mixed>
$opt
Methods
__construct()
public
__construct([Job $job = null ][, array<string|int, mixed> $opt = null ]) : mixed
Parameters
- $job : Job = null
- $opt : array<string|int, mixed> = null
addCache()
Set the value of cache
public
addCache(mixed $name, mixed $value) : self
Parameters
- $name : mixed
- $value : mixed
Return values
selfaddMultiUseCache()
if something validated which and maybe need to recheck pass to this, and check this with a simple condition
public
addMultiUseCache(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
afterHandle()
public
afterHandle(JobResult $jobResult) : JobResult
Parameters
- $jobResult : JobResult
Return values
JobResultbeforeHandle()
public
beforeHandle() : mixed
canBeReset()
public
canBeReset(Job $job) : bool
Parameters
- $job : Job
Return values
boolcopyToApiSpecialTables()
public
copyToApiSpecialTables([array<string|int, mixed> $content = [] ]) : array<string|int, mixed>
Parameters
- $content : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>create()
public
static create([Job $job = null ][, array<string|int, mixed> $opt = null ]) : static
Parameters
- $job : Job = null
- $opt : array<string|int, mixed> = null
Return values
staticcreateAndHandle()
public
static createAndHandle([Job $job = null ][, array<string|int, mixed> $opt = null ]) : mixed
Parameters
- $job : Job = null
- $opt : array<string|int, mixed> = null
createUploadableRow()
public
createUploadableRow(mixed $apiOrder) : array<string|int, mixed>
Parameters
- $apiOrder : mixed
Return values
array<string|int, mixed>dateChecker()
public
dateChecker(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
doRollbackToJob()
public
doRollbackToJob(Job $job) : bool
Parameters
- $job : Job
Return values
boolgetAlreadyAdded()
if a value already validated or used and not need to recheck
public
getAlreadyAdded(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
getCache()
Get the value of cache
public
getCache(mixed $name) : mixed
Parameters
- $name : mixed
getCountryAndNumberFromVatid()
public
getCountryAndNumberFromVatid(mixed $vatid) : array<string|int, mixed>
Parameters
- $vatid : mixed
Return values
array<string|int, mixed>getCountryIdFromVatid()
public
getCountryIdFromVatid(mixed $vatid) : mixed
Parameters
- $vatid : mixed
getHelperComponent()
Get the value of helperComponent.
public
getHelperComponent() : ApiJobHandlerComponent|null
Return values
ApiJobHandlerComponent|nullgetJob()
public
getJob() : Job
Return values
JobgetJobList()
public
getJobList() : array<string|int, Job>
Return values
array<string|int, Job>getJobParameters()
public
getJobParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>getLockNameListForHandle()
public
getLockNameListForHandle() : mixed
getLockPrefix()
public
getLockPrefix() : string
Return values
stringgetOpt()
public
getOpt([array<string|int, mixed> $opt = null ]) : array<string|int, mixed>
Parameters
- $opt : array<string|int, mixed> = null
Return values
array<string|int, mixed>getOptUser()
public
getOptUser() : mixed
getOptUserId()
public
getOptUserId() : mixed
getOptVal()
public
getOptVal(string $key) : mixed
Parameters
- $key : string
getOptValOr()
public
getOptValOr(string $key[, mixed $or = null ]) : mixed
Parameters
- $key : string
- $or : mixed = null
getProductByRow()
public
getProductByRow(mixed $apiOrder) : mixed
Parameters
- $apiOrder : mixed
getReportUser()
Get the value of reportUser.
public
getReportUser() : Client
Return values
ClientgetShippingPrice()
public
getShippingPrice(mixed $row) : mixed
Parameters
- $row : mixed
getTypeIdFromRow()
public
getTypeIdFromRow(mixed $row) : int
Parameters
- $row : mixed
Return values
intgetUploadableContent()
public
getUploadableContent(mixed $apiOrderList) : array<string|int, mixed>
Parameters
- $apiOrderList : mixed
Return values
array<string|int, mixed>getValidVatidByVies()
public
getValidVatidByVies(string $buyerVatid[, string $countryTwo = null ]) : mixed
Parameters
- $buyerVatid : string
- $countryTwo : string = null
handle()
public
handle() : JobResult
Tags
Return values
JobResulthandleJob()
public
handleJob(Job $job[, array<string|int, mixed> $opt = null ]) : mixed
Parameters
- $job : Job
- $opt : array<string|int, mixed> = null
handleLock()
public
handleLock() : mixed
hasOptKey()
public
hasOptKey(string $key) : mixed
Parameters
- $key : string
initCache()
public
initCache(mixed $skuList, mixed $hellotaxProdList) : mixed
Parameters
- $skuList : mixed
- $hellotaxProdList : mixed
loadJobList()
public
loadJobList() : mixed
Tags
lock()
public
lock([array<string|int, mixed> $lockNameList = [] ]) : bool
Parameters
- $lockNameList : array<string|int, mixed> = []
Tags
Return values
boolmarkJobResetAsFailed()
public
markJobResetAsFailed(Job $job, int $progress) : bool
Parameters
- $job : Job
- $progress : int
Return values
boolprocessApiOrder()
public
processApiOrder(int $userId[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>
Parameters
- $userId : int
- $parameters : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>setHelperComponent()
Set the value of helperComponent.
public
setHelperComponent(mixed $helperComponent) : self
Parameters
- $helperComponent : mixed
Return values
selfsetJob()
public
setJob(Job $job) : mixed
Parameters
- $job : Job
setOpt()
public
setOpt(array<string|int, mixed> $opt) : static
Parameters
- $opt : array<string|int, mixed>
Return values
staticsetReportUser()
Set the value of reportUser.
public
setReportUser(Client $reportUser) : self
Parameters
- $reportUser : Client
Return values
selfsupport()
public
static support(Job $job) : bool
Parameters
- $job : Job
Return values
boolunlock()
public
unlock() : void
_handle()
protected
_handle() : JobResult
Return values
JobResultformatDecimal()
protected
formatDecimal(mixed $number[, mixed $decimals = 2 ]) : mixed
Parameters
- $number : mixed
- $decimals : mixed = 2
getAmazonProductList()
protected
getAmazonProductList(array<string|int, mixed> $skuList) : array<string|int, mixed>
Parameters
- $skuList : array<string|int, mixed>
Return values
array<string|int, mixed>getFixedVatNumber()
protected
getFixedVatNumber(ReportApiOrder $row, array<string|int, mixed> $searchKeyList) : mixed
Parameters
- $row : ReportApiOrder
- $searchKeyList : array<string|int, mixed>
getIdListBySkuList()
protected
getIdListBySkuList(array<string|int, mixed> $skuList) : array<string|int, mixed>
Parameters
- $skuList : array<string|int, mixed>
Return values
array<string|int, mixed>getIsCreditNote()
protected
getIsCreditNote(mixed $typeId) : int
Parameters
- $typeId : mixed
Return values
intgetMovementTypeId()
protected
getMovementTypeId(mixed $typeId) : int|null
Parameters
- $typeId : mixed
Return values
int|nullgetPerspectiveId()
protected
getPerspectiveId(mixed $typeId) : int|null
Parameters
- $typeId : mixed
Return values
int|nullgetProductListBySkuAndHellotax()
protected
getProductListBySkuAndHellotax(array<string|int, mixed> $hellotaxProdList, array<string|int, mixed> $idListBySku) : mixed
Parameters
- $hellotaxProdList : array<string|int, mixed>
- $idListBySku : array<string|int, mixed>
getUserVatList()
protected
getUserVatList([int $userId = null ]) : mixed
Parameters
- $userId : int = null
getVatCountryFromRow()
protected
getVatCountryFromRow(ReportApiOrder $row, array<string|int, mixed> $searchKeyList) : mixed
Parameters
- $row : ReportApiOrder
- $searchKeyList : array<string|int, mixed>
getVatTypeId()
protected
getVatTypeId(mixed $country, mixed $date, mixed $rate) : mixed
Parameters
- $country : mixed
- $date : mixed
- $rate : mixed
dateHasTime()
private
dateHasTime(string $date) : mixed
Parameters
- $date : string
getCacheName()
private
getCacheName(string $modelName[, mixed $indexedTo = null ]) : mixed
Parameters
- $modelName : string
- $indexedTo : mixed = null
getDateFromString()
private
getDateFromString(string $value) : mixed
Parameters
- $value : string