Add moveCookieToCategory mutation

Moving a cookie between categories previously required two sequential
updateCookieCategory mutations, which was not atomic and could leave
data in an inconsistent state if the second call failed. This adds a
dedicated moveCookieToCategory mutation that performs both updates in
a single transaction.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-21 10:34:17 +04:00
parent 1574600c72
commit 653b43fc81
5 changed files with 225 additions and 80 deletions

View File

@@ -28,4 +28,6 @@ var (
ErrCannotDeleteSystemCategory = errors.New("cannot delete system cookie category")
ErrOriginAlreadyInUse = errors.New("origin is already used by another active cookie banner")
ErrConsentNotFound = errors.New("consent record not found")
ErrCookieNotFound = errors.New("cookie not found in source category")
ErrCategoriesBannerMismatch = errors.New("source and target categories belong to different banners")
)