feat(entities): Cookie-Datenmodell mit Löschsperre für Kategorien (#10) #35

Merged
csaeum merged 2 commits from feature/cookie-entities into main 2026-11-09 18:31:45 +00:00
Owner
  • Entities Cookie, CookieTranslation, CookieItem, CookieItemTranslation, CookieWebspace und CookieRepository (aus wsc_sulubundle_consentanalytics, ohne EventConfig/EventField)
  • Eine Migration Version20261109190000 für alle wsc_consent_-Tabellen; Kategorie-Fremdschlüssel direkt auf ca_categories
  • Löschsperre: Eine Kategorie mit Cookies lässt sich nicht löschen
    • DB: ON DELETE RESTRICT
    • Sulu-Admin: CategoryDeleteGuard (Doctrine preRemove) wirft CategoryInUseException → HTTP 409 mit übersetzter Meldung (de/en/fr)
  • Test-Fixtures TestCategory/TestCategoryTranslation, Entity-, Migrations-, Exception- und Extension-Tests (35 Tests)
  • PHPStan: gezielte Ausnahme property.unusedType nur für src/Entity/* (Doctrine setzt IDs per Reflection), begründet in phpstan.neon und CICD-Actions.md
  • Testdaten nur mit Platzhaltern (cdn.domain.xx, anbieter.domain.xx)

Verifiziert im DDEV

  • Migration ausgeführt, schema:validate OK, down/up sauber (0 → 5 Tabellen)
  • SQL-Delete einer Kategorie mit Cookie: ERROR 1451 (Fremdschlüssel)
  • Doctrine-Delete: CategoryInUseException, Kategorie und Cookie bleiben erhalten
  • CI grün (Läufe #1453, #1454)

closes #10

🤖 Generated with Claude Code

- Entities `Cookie`, `CookieTranslation`, `CookieItem`, `CookieItemTranslation`, `CookieWebspace` und `CookieRepository` (aus `wsc_sulubundle_consentanalytics`, ohne EventConfig/EventField) - Eine Migration `Version20261109190000` für alle `wsc_consent_`-Tabellen; Kategorie-Fremdschlüssel direkt auf `ca_categories` - **Löschsperre:** Eine Kategorie mit Cookies lässt sich nicht löschen - DB: `ON DELETE RESTRICT` - Sulu-Admin: `CategoryDeleteGuard` (Doctrine `preRemove`) wirft `CategoryInUseException` → HTTP 409 mit übersetzter Meldung (de/en/fr) - Test-Fixtures `TestCategory`/`TestCategoryTranslation`, Entity-, Migrations-, Exception- und Extension-Tests (35 Tests) - PHPStan: gezielte Ausnahme `property.unusedType` nur für `src/Entity/*` (Doctrine setzt IDs per Reflection), begründet in `phpstan.neon` und `CICD-Actions.md` - Testdaten nur mit Platzhaltern (`cdn.domain.xx`, `anbieter.domain.xx`) ## Verifiziert im DDEV - Migration ausgeführt, `schema:validate` OK, down/up sauber (0 → 5 Tabellen) - SQL-Delete einer Kategorie mit Cookie: `ERROR 1451` (Fremdschlüssel) - Doctrine-Delete: `CategoryInUseException`, Kategorie und Cookie bleiben erhalten - CI grün (Läufe #1453, #1454) closes #10 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(entities): add cookie, cookie item and webspace assignment entities with migration (refs #10)
All checks were successful
CI / php (push) Successful in 41s
CI / sicherheit (push) Successful in 1m5s
CI / build-release (push) Has been skipped
3831f5d72f
Taken over from wsc_sulubundle_consentanalytics without the event and
datalayer parts. The cookie category references the Sulu category
directly; one migration creates all wsc_consent_ tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(categories): prevent deleting categories that still have cookies (refs #10)
All checks were successful
CI / php (push) Successful in 42s
CI / sicherheit (push) Successful in 1m4s
CI / build-release (push) Has been skipped
0b8990152b
The cookie category foreign key uses ON DELETE RESTRICT, and a Doctrine
preRemove listener rejects the deletion beforehand with a translated
message (HTTP 409) in the Sulu admin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
csaeum merged commit cb101108df into main 2026-11-09 18:31:45 +00:00
csaeum deleted branch feature/cookie-entities 2026-11-09 18:31:45 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Sulu-Bundles/wsc_sulubundle_orestbidacookieconsent!35
No description provided.