- CorrelationId VO pour le tracing inter-BC - IdempotencyStore (interface + InMemory) pour garde d'idempotence - correlationId ajouté aux contrats Published Language (retro-compatible par défaut) - Consumers Invoicing et LegacyFulfillment idempotents avec logging - MessengerSalesEventPublisher propage les correlationIds - Tests unitaires idempotence + tests d'intégration consommateurs idempotents
25 lines
627 B
PHP
25 lines
627 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MiniShop\Contracts\Sales\V1\Event;
|
|
|
|
/**
|
|
* Published Language — sales.v1.OrderConfirmed
|
|
* Contrat immutable et versionne. Ne jamais modifier les champs existants.
|
|
*/
|
|
final readonly class OrderConfirmed
|
|
{
|
|
/**
|
|
* @param list<array{productName: string, quantity: int, unitPriceInCents: int, currency: string}> $lines
|
|
*/
|
|
public function __construct(
|
|
public string $orderId,
|
|
public string $customerId,
|
|
public int $totalInCents,
|
|
public string $currency,
|
|
public array $lines,
|
|
public string $correlationId = '',
|
|
) {}
|
|
}
|