74 lines
1.6 KiB
PHP
74 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs\Arcadia;
|
|
|
|
use App\Models\TraceaPoultry;
|
|
|
|
class XmlFluxPoultryJob extends XmlJobs
|
|
{
|
|
/**
|
|
* The xsd file path used to validate files
|
|
*
|
|
* @var string|null
|
|
*/
|
|
protected $xsdSchemaPath = 'resources/documents/traca/cavol.xsd';
|
|
|
|
/**
|
|
* Disk name from config/filesystems.php
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $disk = 'flux_poultry';
|
|
|
|
/**
|
|
* The columns to take from the XML subcolumns can be added with a dot
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $takeColumns = [
|
|
'code_art' => 'item_code',
|
|
'article' => 'article',
|
|
'lot_code_externe' => 'external_code_lot',
|
|
'code_eleveur' => 'breeder_code',
|
|
'num_commande' => 'order_num',
|
|
'lot_opa' => 'opa_lot',
|
|
'gencod_prix' => 'barcode_price',
|
|
'gencod_poids' => 'barcode_weight',
|
|
'lot_abattoir' => 'abattoir_lot',
|
|
'client_commande' => 'customer_order',
|
|
'enseigne' => ' sign',
|
|
'marque' => 'brand',
|
|
'famille' => 'family',
|
|
'date_expe' => 'exp_date',
|
|
'date_de_prep' => 'prep_date'
|
|
];
|
|
|
|
/**
|
|
* The columns allowed to be null
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $nullableFields = [
|
|
'barcode_price',
|
|
'barcode_weight'
|
|
];
|
|
|
|
/**
|
|
* Fields that are unique
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $uniqueKeyField = [
|
|
'item_code', 'order_num', 'external_code_lot'
|
|
];
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$this->parseData('HT', TraceaPoultry::class);
|
|
}
|
|
}
|