protected function defineFields(): FieldCollection
{ // @deprecated tag:v6.6.0 - Variable $autoload will be removed in the next major as it will be false by default
$autoload = !Feature::
isActive('v6.6.0.0'
);
return new FieldCollection([ (new IdField('id', 'id'
))->
addFlags(new ApiAware(),
new PrimaryKey(),
new Required()),
(new VersionField())->
addFlags(new ApiAware()),
(new FkField('order_id', 'orderId', OrderDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new ReferenceVersionField(OrderDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new FkField('shipping_order_address_id', 'shippingOrderAddressId', OrderAddressDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new ReferenceVersionField(OrderAddressDefinition::
class, 'shipping_order_address_version_id'
))->
addFlags(new ApiAware(),
new Required()),
(new FkField('shipping_method_id', 'shippingMethodId', ShippingMethodDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new StateMachineStateField('state_id', 'stateId', OrderDeliveryStates::STATE_MACHINE
))->
addFlags(new ApiAware(),
new Required()),
(new ManyToOneAssociationField('stateMachineState', 'state_id', StateMachineStateDefinition::
class, 'id',
$autoload))->
addFlags(new ApiAware()),
(new ListField('tracking_codes', 'trackingCodes', StringField::
class))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING
)),
(new DateTimeField('shipping_date_earliest', 'shippingDateEarliest'
))->
addFlags(new ApiAware(),
new Required(),
new SearchRanking(SearchRanking::MIDDLE_SEARCH_RANKING
)),
(