feat(partner): add /partner dashboard for partner self-service#1114
Draft
TaprootFreak wants to merge 1 commit into
Draft
feat(partner): add /partner dashboard for partner self-service#1114TaprootFreak wants to merge 1 commit into
TaprootFreak wants to merge 1 commit into
Conversation
Adds the frontend counterpart to DFXswiss/api#3787. Referral partners (role=Partner) can now look up their referees, assign or remove individual onboarding fees, and review their full referee list directly on app.dfx.swiss — replacing the manual Google-Sheet workflow currently operated by the Compliance team. - usePartnerGuard (Admin + Partner) - usePartner hook with 5 methods against /v1/partner/* endpoints - Local PartnerUserInfo / PartnerFee DTOs (admin-style, mirrors compliance.hook pattern; can later migrate to @dfx.swiss/react once packages 1.4.0-beta.2 is consumed) - Routes: /partner → hub (set-fee tile + referees tile) /partner/onboarding → lookup-by-address form + fee dropdown + Set / Remove buttons, server enforces scope /partner/history → table of all users with usedRef == caller.ref - PartnerUserCard component for the lookup result Backend scope enforcement (api#3787) guarantees the partner can only touch users whose usedRef is either empty (defaultRef '000-000') or equal to the caller's own ref; UI surfaces this via the canModify flag.
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
/partnerroute family onapp.dfx.swiss, gated byusePartnerGuard(Admin+Partner)/partner— hub with two tiles/partner/onboarding— lookup-by-address form, fee dropdown, Set Fee + Activate / Remove Fee buttons/partner/history— table of all users currently linked to caller'susedRefusePartnerhook with 5 methods against/v1/partner/*(api#3787)PartnerUserInfo/PartnerFeeDTOs (admin-style, mirrorscompliance.hookpattern)Why
Referral partners like Fab today rely on the internal DFX Admin Google Sheet (operated by the Compliance team) to set custom onboarding fees on their referees. This PR moves that workflow into a self-service UI on
app.dfx.swiss, paired with backend scope enforcement.Dependencies
UserRole.PARTNER+/v1/partner/*endpoints with server-side scope check (caller can only act on users withusedRef ∈ { defaultRef, caller.ref })PARTNERenum value +PartnerUrlconstants in@dfx.swiss/core. Not consumed in this PR (cast workaround inguard.hook.ts); a follow-up can migrate to nativeUserRole.PARTNERonce packages 1.4.0-beta.2 is published.Operational notes
user.role = 'Partner'via DB to test scope behaviour.UPDATEfor the actual partner accounts.Test plan
npm run lintcleannpm run build:lib(tsc) cleannpm run test— 283 passednpm run build:devclean/partner/partner/onboarding: paste an unowned address → Lookup → see UserCard withcanModify=true→ pick fee → Set → success, UserCard refreshes with new fee + Active + caller's refusedRef→canModify=false, dropdown disabled, message visible/partner/history: see table of own referees/