Break the price-adoption spec into six testable steps

Six tasks, each ending on a green billing folder and its own commit: the key
fingerprint (and a fake that finally reproduces Stripe's refusal), the two
listing calls, the adoption step itself, then each price service in turn, then
one row per Stripe price.

The spec now names both test files. What goes on the wire is checked through
Http::fake against the real client — asserting against the fake would only prove
the fake agrees with itself, which is the mistake that let the incident through.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
feature/betriebsmodus^2
nexxo 2026-07-30 10:18:20 +02:00
parent af9d60469e
commit 0ec5d93da8
2 changed files with 1848 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@ -219,8 +219,14 @@ diese Prüfung je gerissen wird.
## 11. Tests
Ein Regeldatei-Test nach Repo-Sitte:
`tests/Feature/Billing/StripePriceAdoptionTest.php`
Zwei Regeldatei-Tests nach Repo-Sitte, getrennt danach, **gegen wen** sie prüfen:
- `tests/Feature/Billing/StripeIdempotencyKeyTest.php` — was auf der Leitung
landet. Läuft über `Http::fake()` gegen `HttpStripeClient`, weil geprüft werden
muss, was **gesendet** wird, nicht was der Fake sich merkt. Hier steht auch,
dass der Fake Stripes 400 überhaupt nachbildet.
- `tests/Feature/Billing/StripePriceAdoptionTest.php` — die Übernahmeregeln,
beide Seiten, über den `FakeStripeClient`.
| Prüfung | Deckt ab |
|---|---|
@ -235,9 +241,6 @@ Ein Regeldatei-Test nach Repo-Sitte:
| Der Fake wirft bei gleichem Schlüssel mit anderen Parametern | §9 |
| Zwei Zeilen können keine `stripe_price_id` teilen | §10 |
Der Header-Test läuft über `Http::fake()` gegen `HttpStripeClient`, nicht gegen
den Fake: geprüft werden muss, was **gesendet** wird.
## 12. Nicht Teil dieses Vorhabens
- **Ein Aufräum-Kommando** für Waisen, die niemand mehr übernehmen kann (etwa
@ -255,6 +258,7 @@ den Fake: geprüft werden muss, was **gesendet** wird.
- `app/Services/Billing/AdoptStripePrice.php`
- `app/Services/Stripe/IdempotencyKey.php`
- `database/migrations/2026_07_31_210000_one_row_per_stripe_price.php`
- `tests/Feature/Billing/StripeIdempotencyKeyTest.php`
- `tests/Feature/Billing/StripePriceAdoptionTest.php`
**Geändert**