new BoolField('active', 'active'
))->
addFlags(new ApiAware()),
(new IntField('position', 'position'
))->
addFlags(new ApiAware()),
(new TranslatedField('customFields'
))->
addFlags(new ApiAware()),
(new FkField('availability_rule_id', 'availabilityRuleId', RuleDefinition::
class))->
addFlags(new Required()),
(new FkField('media_id', 'mediaId', MediaDefinition::
class))->
addFlags(new ApiAware()),
(new FkField('delivery_time_id', 'deliveryTimeId', DeliveryTimeDefinition::
class))->
addFlags(new ApiAware(),
new Required()),
(new StringField('tax_type', 'taxType', 50
))->
addFlags(new ApiAware(),
new Required()),
new FkField('tax_id', 'taxId', TaxDefinition::
class),
(new ManyToOneAssociationField('deliveryTime', 'delivery_time_id', DeliveryTimeDefinition::
class, 'id', true
))->
addFlags(new ApiAware()),
(new TranslatedField('description'
))->
addFlags(new ApiAware(),
new SearchRanking(SearchRanking::LOW_SEARCH_RANKING
)),
(new TranslatedField('trackingUrl'
))->
addFlags(new ApiAware()),
(new TranslationsAssociationField(ShippingMethodTranslationDefinition::
class, 'shipping_method_id'
))->
addFlags(new ApiAware(),
new Required()),
(new ManyToOneAssociationField('availabilityRule', 'availability_rule_id', RuleDefinition::
class))->
addFlags(new ApiAware()),
(new OneToManyAssociationField('prices', ShippingMethodPriceDefinition::
class, 'shipping_method_id', 'id'
))->
addFlags(new ApiAware(),
new CascadeDelete()),
(new ManyToOneAssociationField('media', 'media_id', MediaDefinition::
class))->
addFlags(new ApiAware()),
(new ManyToManyAssociationField('tags', TagDefinition::
class, ShippingMethodTagDefinition::
class, 'shipping_method_id', 'tag_id'
))->
addFlags(new ApiAware()),
// Reverse Association, not available in sales-channel-api
(new OneToManyAssociationField('orderDeliveries', OrderDeliveryDefinition::
class, 'shipping_method_id', 'id'
))->
addFlags(new RestrictDelete()),
new ManyToManyAssociationField('salesChannels', SalesChannelDefinition::
class, SalesChannelShippingMethodDefinition::
class, 'shipping_method_id', 'sales_channel_id'
),
(new OneToManyAssociationField('salesChannelDefaultAssignments', SalesChannelDefinition::
class, 'shipping_method_id', 'id'
))->
addFlags(new RestrictDelete()),
(new ManyToOneAssociationField('tax', 'tax_id', TaxDefinition::
class))->
addFlags(new ApiAware()),
]);
}