Skip to content

Commit

Permalink
[create-pull-request] automated change (#1680)
Browse files Browse the repository at this point in the history
Co-authored-by: shopwareBot <[email protected]>
  • Loading branch information
github-actions[bot] and shopwareBot authored Feb 3, 2025
1 parent cb77fb7 commit b17cdf5
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions resources/references/adr/2025-01-29-make-rule-classes-internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Make Rule classes internal
date: 2025-01-29
area: core
tags: [core, rules]
---

# Make Rule classes internal

::: info
This document represents an architecture decision record (ADR) and has been mirrored from the ADR section in our Shopware 6 repository.
You can find the original version [here](https://github.com/shopware/shopware/blob/trunk/adr/2025-01-29-make-rule-classes-internal.md)
:::

## Context
The existing rule system is flexible but complex, making it difficult to evolve and maintain. Allowing unrestricted extensions of rule classes slows down improvements and increases the complexity of the system.

See RFC: https://github.com/shopware/shopware/discussions/5785

## Decision
We will mark existing rule classes as internal, limiting direct usage by third parties. Developers should create new rule classes instead of modifying existing ones.

Nearly all rule classes will be marked as internal, with a few exceptions:
```
LineItemOfTypeRule
LineItemProductStatesRule
PromotionCodeOfTypeRule
ZipCodeRule
BillingZipCodeRule
ShippingZipCodeRule
```

These classes will remain public for now, because they rely on configuration which is reasonably expected to be extended by third-party developers.

## Consequences
* Faster evolution of the rule system
* Clearer extension mechanisms for developers
* Potential migration efforts for third-party developers currently extending rule classes
* Internal rule implementations may evolve

0 comments on commit b17cdf5

Please sign in to comment.