feat(profile): scaffold SetMinDmChatInitFee - #1344
Merged
Merged
Conversation
Scaffolds the new flipcash2 Profile.SetMinDmChatInitFee RPC and the UserProfile.min_dm_chat_init_fee field (both purely additive) through the service/wrapper/repository/controller layers, following the same shape as the sibling UpdateTipCard RPC: - ProfileApi.setMinDmChatInitFee builds and validates the request - ProfileService.setMinDmChatInitFee folds the response Result enum into a new SetMinDmChatInitFeeError sealed class (Denied, InvalidAmount, Unrecognized, Other) - ProfileRepository/InternalProfileRepository expose the call, reporting every failure (no "expected" rejections to suppress, same as updateTipCard) - ProfileController.setMinDmChatInitFee resolves the caller's key pair and delegates; no local profile cache merge, again matching updateTipCard rather than the setDisplayName/setUsername pattern - UserProfile gains min_dm_chat_init_fee, mapped from the proto via a new FiatPaymentAmount <-> Fiat conversion pair in ProtobufToLocal.kt/LocalToProtobuf.kt No UI wiring: the sibling updateTipCard RPC has no callers in apps/ either, so this stops at the domain-model layer until a feature needs it. No new tests beyond the required FakeProfileRepository override, matching the existing partial per-field coverage in UserProfileMapperTest and ProfileControllerTest.
bmc08gt
marked this pull request as ready for review
August 27, 2026 18:33
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.
Scaffolds
SetMinDmChatInitFeeandUserProfile.min_dm_chat_init_fee, which arrive inflipcash2-client-protocol0.2.0.Blocked on the contract release
Draft until code-payments/flipcash2-client-protocol#5 merges and
0.2.0publishes to Maven Central. The pin bump here names a version that does not exist yet, so dependency resolution reportscom.flipcash:flipcash2-client-protocol:0.2.0 FAILEDuntil then. CI never sees the localprotoLocalRootoverride, so it resolves the pin and nothing else.Built green against the client checkout locally:
:services:flipcash:assembleDebugand:services:flipcash:testDebugUnitTest.What the contract added
SetMinDmChatInitFeesets the minimum fee another user must pay to initialize a DM chat with the caller, replacing any fee already set.SetMinDmChatInitFeeResponse.Resultis a new enum ofOK,DENIED, andINVALID_AMOUNT.UserProfile.min_dm_chat_init_feeis a new optionalFiatPaymentAmount, unset when the user has not chosen one.Scaffolding
Follows
updateTipCard, the closest existing sibling, through the same layers:ProfileApi.setMinDmChatInitFeebuilds and validates the request, dispatching on IO.ProfileServicefolds the responseResultinto a newSetMinDmChatInitFeeErrorsealed class.InternalProfileRepositoryreports every failure throughErrorUtils.handleError, matchingupdateTipCardrather thansetUsername's selective suppression.ProfileController.setMinDmChatInitFee(fee: Fiat)exposes it, with no local-profile-cache merge, again matchingupdateTipCard.UserProfilegainsminDmChatInitFee: Fiat?, mapped inUserProfileMapper, with newFiatPaymentAmountconversions in both directions.No UI or feature-layer wiring:
updateTipCardhas no feature-layer callers either, so a surface here would be inventing a feature rather than scaffolding the contract. That wiring belongs in whichever PR builds the screen.