Skip to content

fix(tag): require reasons only for sticky removals - #56

Merged
zaxovaiko merged 1 commit into
devfrom
feat/removing-a-tag-doesnt-require-a-reason
Aug 5, 2026
Merged

fix(tag): require reasons only for sticky removals#56
zaxovaiko merged 1 commit into
devfrom
feat/removing-a-tag-doesnt-require-a-reason

Conversation

@marek-chmielowski-blurify

Copy link
Copy Markdown
Collaborator

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

removePlayerTagSchema required removalReason: 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: removalReason is optional on the removal input, and TagService throws TagRemovalReasonRequiredError (mapped to BAD_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 the tag.player.removed event.

Worth knowing

  • replacePlayerTagSchema (the atomic same-key swap) is unaffected - it still requires a reason.

  • pnpm verify is green (typecheck + lint + boundaries + module-shape + tests) - full run had 2 suite-level afterAll hook 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:drift is green (catalog / OpenAPI not stale) - run pnpm regen if not

  • New cross-module talk goes through events / command ports / contracts / the /schema subpath (no direct module imports)

  • New data tables carry tenantId and are RLS-covered (pnpm regen runs gen:rls) - N/A, no new tables

  • No secrets, real player data, or internal/customer names added

@zaxovaiko
zaxovaiko merged commit 9bf50e5 into dev Aug 5, 2026
2 checks passed
@zaxovaiko
zaxovaiko deleted the feat/removing-a-tag-doesnt-require-a-reason branch August 5, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants