Skip to content

feat(realunit): version legal-disclaimer steps via partner consent#3860

Open
TaprootFreak wants to merge 1 commit into
developfrom
feat/partner-consent
Open

feat(realunit): version legal-disclaimer steps via partner consent#3860
TaprootFreak wants to merge 1 commit into
developfrom
feat/partner-consent

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

Summary

Persists RealUnit legal-disclaimer acceptance server-side so each of the five onboarding disclaimer steps is versioned independently. The user is only re-prompted for a step whose required version they have not accepted yet (today the app gates the whole 5-step wizard on a volatile in-memory flag, re-showing it on every KYC entry and keeping no record of what was accepted when).

  • New generic partner-consent domain (src/subdomains/generic/partner-consent/): an append-only consent log keyed by userData + partner (the existing Wallet entity) + topic + version, plus a service that reports missing topics and records acceptances. Kept generic on purpose — any DFX partner can reuse it.
  • RealUnit wiring: GET /v1/realunit/disclaimer returns the steps still to confirm (in wizard order); PUT /v1/realunit/disclaimer records acceptances. Required versions live in Config.blockchain.realunit.disclaimer.versions, so the backend is the single source of truth and the app only renders the returned steps.
  • The naming uses partner for the new artifacts even though the FK points at the Wallet entity — a global Wallet → Partner rename is intentionally out of scope (public API contract).

PR completeness

  • Migration: 1781031292273-AddPartnerConsent.js (CREATE TABLE partner_consent + indexes + FKs to wallet / user_data; constraint names follow the deterministic TypeORM scheme).
  • Config: disclaimer.versions added to the RealUnit config block.
  • Frontend sync: the companion realunit-app PR (consuming the endpoints and deleting the local in-memory gate) follows after this merges to develop (pair-PR discipline).

Test plan

  • npm run format && npm run lint && npm run type-check && npm run build — all clean
  • Unit tests: partner-consent.service.spec.ts (version compare, append, empty list) + realunit.service.spec.ts (status ordering, version stamping, missing-partner errors) — 41 passing
  • DEV smoke: fresh user GET /disclaimer → all 5 steps; PUT two steps → re-GET returns the other 3; bump a config version → that step reappears

Persist disclaimer acceptance server-side so each of the five RealUnit
onboarding disclaimer steps is versioned independently. The user is only
re-prompted for a step whose required version they have not accepted yet.

Add a generic partner-consent domain: an append-only consent log keyed by
userData + partner (the existing Wallet entity) + topic + version, plus a
service that reports missing topics and records acceptances. RealUnit wires
it up via GET/PUT /v1/realunit/disclaimer, with the required versions held
in config so the backend stays the single source of truth and the app only
renders the returned steps.

The companion realunit-app PR (consuming the endpoints and removing the
local in-memory gate) follows after this merges to develop.
@TaprootFreak TaprootFreak marked this pull request as ready for review June 9, 2026 19:14
@TaprootFreak TaprootFreak requested a review from davidleomay as a code owner June 9, 2026 19:14
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.

1 participant