private function createOrder(string
$customerId): string
{ $id = Uuid::
randomHex();
$this->
getContainer()->
get('order.repository'
)->
create( [[ 'id' =>
$id,
'itemRounding' =>
json_decode(json_encode(new CashRoundingConfig(2, 0.01, true
), \JSON_THROW_ON_ERROR
), true, 512, \JSON_THROW_ON_ERROR
),
'totalRounding' =>
json_decode(json_encode(new CashRoundingConfig(2, 0.01, true
), \JSON_THROW_ON_ERROR
), true, 512, \JSON_THROW_ON_ERROR
),
'orderDateTime'
=> (new \
DateTimeImmutable())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
),
'price' =>
new CartPrice(10, 10, 10,
new CalculatedTaxCollection(),
new TaxRuleCollection(), CartPrice::TAX_STATE_NET
),
'shippingCosts' =>
new CalculatedPrice(10, 10,
new CalculatedTaxCollection(),
new TaxRuleCollection()),
'orderCustomer' =>
[ 'customerId' =>
$customerId,
'email' => 'test@example.com',
'salutationId' =>
$this->
getValidSalutationId(),
'firstName' => 'Max',
'lastName' => 'Mustermann',
],
'orderNumber' => 'anOrderNumber',
'stateId' =>
$this->
getStateMachineState(),
'currencyId' => Defaults::CURRENCY,
'currencyFactor' => 1.0,