Enforce customer product restrictions for order bookings (#318)

## What changed

- validate every normalized order-booking item against active customer
product rules before reservation and persistence
- return a structured HTTP 400 response containing the rejected product
and matching rule metadata
- document the rejection response in both OpenAPI specifications
- add API coverage for restricted base products, restricted add-ons, and
allowed neighboring products

## Why

Frontend rule guidance alone cannot prevent stale or crafted requests
from persisting restricted booking products. The booking write boundary
must enforce the same customer rules.

## Validation

- full backend API suite
- focused order-booking API coverage
- PHP syntax checks
- OpenAPI and diff checks

## Related frontend PR

The coordinated frontend PR provides fail-closed selection, recovery,
and responsive booking-page behavior.
This commit is contained in:
Jeppe B
2026-07-20 14:09:20 +02:00
committed by GitHub
parent abde54c898
commit 677d4700b0
4 changed files with 155 additions and 0 deletions
+8
View File
@@ -6442,6 +6442,14 @@ paths:
responses:
'200':
description: Success
'400':
description: Invalid booking input or a product blocked by active customer rules
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/CustomerRuleProductRestrictedResponse'
- type: object
put:
tags:
- Bookings