new IntField('priority', 'priority'
))->
addFlags(new Required()),
(new LongTextField('description', 'description'
))->
addFlags(new ApiAware()),
(new BlobField('payload', 'payload'
))->
removeFlag(ApiAware::
class)->
addFlags(new WriteProtected(Context::SYSTEM_SCOPE
)),
(new BoolField('invalid', 'invalid'
))->
addFlags(new WriteProtected(Context::SYSTEM_SCOPE
)),
(new ListField('areas', 'areas'
))->
addFlags(new WriteProtected(Context::SYSTEM_SCOPE
)),
(new CustomFields())->
addFlags(new ApiAware()),
new JsonField('module_types', 'moduleTypes'
),
(new OneToManyAssociationField('conditions', RuleConditionDefinition::
class, 'rule_id', 'id'
))->
addFlags(new CascadeDelete()),
// Reverse Associations not available in sales-channel-api
(new OneToManyAssociationField('productPrices', ProductPriceDefinition::
class, 'rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::PRODUCT_AREA
)),
(new OneToManyAssociationField('shippingMethodPrices', ShippingMethodPriceDefinition::
class, 'rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::SHIPPING_AREA
)),
(new OneToManyAssociationField('shippingMethodPriceCalculations', ShippingMethodPriceDefinition::
class, 'calculation_rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::SHIPPING_AREA
)),
(new OneToManyAssociationField('shippingMethods', ShippingMethodDefinition::
class, 'availability_rule_id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::SHIPPING_AREA
)),
(new OneToManyAssociationField('paymentMethods', PaymentMethodDefinition::
class, 'availability_rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::PAYMENT_AREA
)),
(new OneToManyAssociationField('personaPromotions', PromotionDefinition::
class, 'persona_rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::PROMOTION_AREA
)),
(new OneToManyAssociationField('flowSequences', FlowSequenceDefinition::
class, 'rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new RuleAreas(RuleAreas::FLOW_AREA
)),
(new OneToManyAssociationField('taxProviders', TaxProviderDefinition::
class, 'availability_rule_id', 'id'
))->
addFlags(new RestrictDelete(),
new Since('6.5.0.0'
)),
new ManyToManyAssociationField('tags', TagDefinition::
class, RuleTagDefinition::
class, 'rule_id', 'tag_id'
),
// Promotion References