fix(tag): require reasons only for sticky removals - #56
Merged
Conversation
marek-chmielowski-blurify
requested review from
agniev-a-hub,
klaudia-blazyczek-blurify and
zaxovaiko
as code owners
August 5, 2026 10:08
zaxovaiko
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removing a non-sticky player tag no longer requires a
removalReason; sticky tags still enforce one, now at the service layer rather than the schema.Why
removePlayerTagSchemarequiredremovalReason: z.string().min(5)unconditionally, forcing every caller to invent a reason even for tags that don't carry compliance weight. The reason only matters for sticky tags, so the constraint moves there:removalReasonis optional on the removal input, andTagServicethrowsTagRemovalReasonRequiredError(mapped toBAD_REQUEST) when a sticky tag is removed without one. Non-sticky removals without a reason fall back to a default ("manual tag removal") that's persisted and included in thetag.player.removedevent.Worth knowing
replacePlayerTagSchema(the atomic same-key swap) is unaffected - it still requires a reason.pnpm verifyis green (typecheck + lint + boundaries + module-shape + tests) - full run had 2 suite-levelafterAllhook timeouts (wallet-auto-withdrawal.int.test.ts,phone-login.service.int.test.ts); both pass cleanly in isolation (49/49), unrelated to this change and pre-existing teardown flakiness.pnpm check:driftis green (catalog / OpenAPI not stale) - runpnpm regenif notNew cross-module talk goes through events / command ports / contracts / the
/schemasubpath (no direct module imports)New data tables carry
tenantIdand are RLS-covered (pnpm regenrunsgen:rls) - N/A, no new tablesNo secrets, real player data, or internal/customer names added