feat(realunit): version legal-disclaimer steps via partner consent#3860
Open
TaprootFreak wants to merge 1 commit into
Open
feat(realunit): version legal-disclaimer steps via partner consent#3860TaprootFreak wants to merge 1 commit into
TaprootFreak wants to merge 1 commit into
Conversation
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.
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
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).
partner-consentdomain (src/subdomains/generic/partner-consent/): an append-only consent log keyed byuserData+partner(the existingWalletentity) +topic+version, plus a service that reports missing topics and records acceptances. Kept generic on purpose — any DFX partner can reuse it.GET /v1/realunit/disclaimerreturns the steps still to confirm (in wizard order);PUT /v1/realunit/disclaimerrecords acceptances. Required versions live inConfig.blockchain.realunit.disclaimer.versions, so the backend is the single source of truth and the app only renders the returned steps.partnerfor the new artifacts even though the FK points at theWalletentity — a globalWallet → Partnerrename is intentionally out of scope (public API contract).PR completeness
1781031292273-AddPartnerConsent.js(CREATE TABLEpartner_consent+ indexes + FKs towallet/user_data; constraint names follow the deterministic TypeORM scheme).disclaimer.versionsadded to the RealUnit config block.realunit-appPR (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 cleanpartner-consent.service.spec.ts(version compare, append, empty list) +realunit.service.spec.ts(status ordering, version stamping, missing-partner errors) — 41 passingGET /disclaimer→ all 5 steps;PUTtwo steps → re-GETreturns the other 3; bump a config version → that step reappears