IdfRebuildShipmentHistoryCommand
extends ContainerAwareCommand
in package
Table of Contents
Properties
- $defaultName : mixed
Methods
- configure() : mixed
- execute() : mixed
- extractCommentFromSegments() : string|null
- Extrait le commentaire "best effort" en retirant les segments de type preuve / fichier.
- fetchIdfLogs() : array<string|int, mixed>
- Récupère les logs IDF (livré / absent / refusé) triés chronologiquement.
- findSaleProductBySku() : SaleProduct|null
- Trouve le SaleProduct par SKU dans la vente.
- historyAlreadyExistsForTrackingReference() : bool
- parseIdfLogMessage() : array<string|int, mixed>|null
- Parse un message de log IDF et retourne: [ 'status' => 'ABSENT'|'REFUSED'|'LIV', 'sku' => 'ABC123', 'comment' => '...' ]
- resolveOrCreateIdfTracking() : SaleProductShipmentTracking
- Récupère/crée le Shipment IDF + Tracking pour un SaleProduct.
- toDateTime() : DateTime|null
- Convertit la date DB (string|DateTime) en DateTime.
Properties
$defaultName
protected
static mixed
$defaultName
= 'menzzo:idf:rebuild-shipping-history'
Methods
configure()
protected
configure() : mixed
execute()
protected
execute(InputInterface $input, OutputInterface $output) : mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
extractCommentFromSegments()
Extrait le commentaire "best effort" en retirant les segments de type preuve / fichier.
private
extractCommentFromSegments(array<string|int, mixed> $segments) : string|null
Parameters
- $segments : array<string|int, mixed>
Return values
string|nullfetchIdfLogs()
Récupère les logs IDF (livré / absent / refusé) triés chronologiquement.
private
fetchIdfLogs(Connection $conn[, int|null $limit = null ][, int $months = 6 ]) : array<string|int, mixed>
⚠️ Vérifier le nom de table: mz_sale_log vs mz_sale_logs selon votre projet.
Parameters
- $conn : Connection
- $limit : int|null = null
- $months : int = 6
Return values
array<string|int, mixed>findSaleProductBySku()
Trouve le SaleProduct par SKU dans la vente.
private
findSaleProductBySku(Sale $sale, string $sku) : SaleProduct|null
Si SKU dupliqué dans la vente, on prend le premier match (à adapter si besoin métier).
Parameters
- $sale : Sale
- $sku : string
Return values
SaleProduct|nullhistoryAlreadyExistsForTrackingReference()
private
historyAlreadyExistsForTrackingReference(Connection $conn, string $carrier, string $trackingReference) : bool
Parameters
- $conn : Connection
- $carrier : string
- $trackingReference : string
Return values
boolparseIdfLogMessage()
Parse un message de log IDF et retourne: [ 'status' => 'ABSENT'|'REFUSED'|'LIV', 'sku' => 'ABC123', 'comment' => '...' ]
private
parseIdfLogMessage(string $message) : array<string|int, mixed>|null
Parameters
- $message : string
Return values
array<string|int, mixed>|nullresolveOrCreateIdfTracking()
Récupère/crée le Shipment IDF + Tracking pour un SaleProduct.
private
resolveOrCreateIdfTracking(EntityManagerInterface $em, SaleProduct $saleProduct, DateTimeInterface $eventAt) : SaleProductShipmentTracking
Parameters
- $em : EntityManagerInterface
- $saleProduct : SaleProduct
- $eventAt : DateTimeInterface
Return values
SaleProductShipmentTrackingtoDateTime()
Convertit la date DB (string|DateTime) en DateTime.
private
toDateTime(mixed $value) : DateTime|null
Parameters
- $value : mixed