No shipped policy can express "at most 10 places per booker across a whole season".

  • slot_per_booker_limit iterates the lines and queries one slot at a time, at modules/yoyaku_order/src/Plugin/ConstraintPolicy/SlotPerBookerLimit.php:124 and :141, so it caps each slot separately.
  • transaction_quantity_limit caps one transaction, and a booker may make several.
  • cross_resource_limit counts distinct slots rather than places, which is what makes it an at a time rule.

The documentation already describes the missing rule in passing, in the shipped policies section: attached to a resource the per slot limit caps each of that resource's slots, and capping their sum would be a different rule. That different rule has no implementation.

Proposed resolution

A per booker limit counting places, with the axis configurable between each slot separately and the sum across everything the attachment reaches.

Today's slot_per_booker_limit then becomes one setting of it rather than a separate plugin, so the family gains a rule without gaining a fourth policy. Both axes count places, so the number on the form means the same thing whichever is chosen, which is the property that made the existing limits disagree with each other before.

Worth deciding in this issue: whether the per slot axis keeps its own plugin id for the sake of stored attachments, or whether the ids are migrated as data. Renaming or removing a plugin id is a data change, not a code change.

Issue fork yoyaku-3614828

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Title: Add a per-booker limit that sums places across everything it reaches » Add a per-booker limit that sums units across everything it reaches
mably’s picture

Status: Active » Needs review

  • mably committed 9d746dcd on 1.x
    feat: #3614828 Add a per-booker limit that sums units across everything...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.