Logidav Docs

TruskService
in package

Class TruskService

Table of Contents

Constants

IDF_DEPARTMENTS  = ['75', '91', '92', '93', '94', '95']

Properties

$container  : ContainerInterface
$entityManager  : EntityManagerInterface
$logService  : LogServiceInterface
$productService  : ProductService
$saleProductService  : SaleProductService|object
$mailerService  : MailerService|object
$saleService  : SaleService|object
$truskApi  : TruskApi|object

Methods

__construct()  : mixed
QueueService constructor.
afterSaleProductCanceled()  : mixed
afterSaleProductCreated()  : mixed
afterSaleProductUpdatedFromSale()  : void
checkShippingDateIsValid()  : bool
checkTruskDirectory()  : mixed
check if directory exist
connectToSftp()  : SFTP|null
Connecting to SFTP
createTruskShipmentTracking()  : void
Create or update Trusk shipment tracking records with status priority
findTruskLastAvailableDate()  : DateTime|mixed|null
getTruskDeliveryFrom()  : mixed
getTruskNextAvailableDate()  : DateTime|mixed|null
getTruskNextAvailblePreparationDates()  : array<string|int, mixed>
getTruskWorkDay()  : DateTime
isIleDeFranceOrder()  : bool
isTruskEligibleDate()  : bool
isTruskEligibleWorkDay()  : bool
onSaleProductChange()  : mixed
onSaleProductsQtyChange()  : mixed
When a sale product qty is changed
onSaleProductsTruskAppointmentFixed()  : mixed
registerSaleAsTrusk()  : void
sendToTrusk()  : bool
shouldMarkSaleAsTrusk()  : bool
truskConnect()  : SFTP
createOrUpdateShipmentTrackingStatusHistory()  : mixed
Create or update shipment tracking status history for Trusk with status priority
findOrCreateSaleProductShipment()  : mixed
Find or create SaleProductShipment for Trusk - Force SHP type
findOrCreateSaleProductShipmentTracking()  : mixed
Find or create SaleProductShipmentTracking for Trusk
processSaleProduct()  : mixed
updateShipmentStatusWithPriority()  : mixed
Update shipment status with priority logic

Constants

IDF_DEPARTMENTS

private mixed IDF_DEPARTMENTS = ['75', '91', '92', '93', '94', '95']

Properties

$entityManager

protected EntityManagerInterface $entityManager

Methods

__construct()

QueueService constructor.

public __construct(ContainerInterface $container, EntityManagerInterface $entityManager, LogServiceInterface $logService) : mixed
Parameters
$container : ContainerInterface
$entityManager : EntityManagerInterface
$logService : LogServiceInterface

checkShippingDateIsValid()

public checkShippingDateIsValid(DateTime $date) : bool
Parameters
$date : DateTime
Return values
bool

checkTruskDirectory()

check if directory exist

public checkTruskDirectory() : mixed

connectToSftp()

Connecting to SFTP

public connectToSftp() : SFTP|null
Return values
SFTP|null

createTruskShipmentTracking()

Create or update Trusk shipment tracking records with status priority

public createTruskShipmentTracking(SaleProduct $saleProduct, string $eventCode, string $comment, string $timestamp, mixed $user) : void
Parameters
$saleProduct : SaleProduct
$eventCode : string
$comment : string
$timestamp : string
$user : mixed

findTruskLastAvailableDate()

public findTruskLastAvailableDate(mixed $nbDays[, null $date = null ]) : DateTime|mixed|null
Parameters
$nbDays : mixed
$date : null = null
Return values
DateTime|mixed|null

getTruskDeliveryFrom()

public getTruskDeliveryFrom() : mixed

getTruskNextAvailableDate()

public getTruskNextAvailableDate(mixed $nbDays[, null $date = null ]) : DateTime|mixed|null
Parameters
$nbDays : mixed
$date : null = null
Return values
DateTime|mixed|null

getTruskNextAvailblePreparationDates()

public getTruskNextAvailblePreparationDates(mixed $date) : array<string|int, mixed>
Parameters
$date : mixed
Return values
array<string|int, mixed>

getTruskWorkDay()

public getTruskWorkDay(mixed $type[, mixed $now = null ]) : DateTime
Parameters
$type : mixed
$now : mixed = null
Return values
DateTime

isIleDeFranceOrder()

public isIleDeFranceOrder(Sale $sale) : bool
Parameters
$sale : Sale
Return values
bool

isTruskEligibleDate()

public isTruskEligibleDate(mixed $date, mixed $i) : bool
Parameters
$date : mixed
$i : mixed
Return values
bool

isTruskEligibleWorkDay()

public isTruskEligibleWorkDay(mixed $type[, mixed $now = null ]) : bool
Parameters
$type : mixed
$now : mixed = null
Return values
bool

onSaleProductsTruskAppointmentFixed()

public onSaleProductsTruskAppointmentFixed() : mixed

sendToTrusk()

public sendToTrusk(Sale $sale[, array<string|int, mixed> $products = [] ]) : bool
Parameters
$sale : Sale
$products : array<string|int, mixed> = []
Return values
bool

shouldMarkSaleAsTrusk()

public shouldMarkSaleAsTrusk(Sale $sale) : bool
Parameters
$sale : Sale
Return values
bool

truskConnect()

public truskConnect() : SFTP
Return values
SFTP

createOrUpdateShipmentTrackingStatusHistory()

Create or update shipment tracking status history for Trusk with status priority

private createOrUpdateShipmentTrackingStatusHistory(mixed $shipmentTracking, mixed $eventCode, mixed $comment, mixed $timestamp, mixed $now) : mixed
Parameters
$shipmentTracking : mixed
$eventCode : mixed
$comment : mixed
$timestamp : mixed
$now : mixed

findOrCreateSaleProductShipment()

Find or create SaleProductShipment for Trusk - Force SHP type

private findOrCreateSaleProductShipment(mixed $saleProduct, mixed $user, mixed $now) : mixed
Parameters
$saleProduct : mixed
$user : mixed
$now : mixed

findOrCreateSaleProductShipmentTracking()

Find or create SaleProductShipmentTracking for Trusk

private findOrCreateSaleProductShipmentTracking(mixed $shipment, mixed $saleProduct, mixed $now) : mixed
Parameters
$shipment : mixed
$saleProduct : mixed
$now : mixed

processSaleProduct()

private processSaleProduct(SaleProduct $saleProduct) : mixed
Parameters
$saleProduct : SaleProduct
Tags
throws
ORMException
throws
OptimisticLockException

updateShipmentStatusWithPriority()

Update shipment status with priority logic

private updateShipmentStatusWithPriority(mixed $shipmentTracking, mixed $newStatus) : mixed
Parameters
$shipmentTracking : mixed
$newStatus : mixed

        
On this page

Search results