feat(profile): scaffold SetMinDmChatInitFee - #672
Merged
Conversation
Wrap the new Profile.SetMinDmChatInitFee RPC (flipcash2-protobuf-api commit 0300d252) through the usual service/client chain: ProfileService.setMinDmChatInitFee builds the request and maps the result enum to a new ErrorSetMinDmChatInitFee, FlipClient+Profile exposes it as an async throwing call, and UserProfile.min_dm_chat_init_fee is decoded into Profile.minDmChatInitFee (FiatPaymentAmount to FiatAmount). Built against the local flipcash2-client-protocol checkout; the published package version isn't bumped here.
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. Theexact:requirement here names a tag that does not exist yet, so SwiftPM cannot resolve it. CI never sees the localFLIPCASH_PROTO_LOCALoverride, so it resolves the pin and nothing else.Built green against the client checkout locally:
./Scripts/build.sh, schemeFlipcash,generic/platform=iOS.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.Worth stating explicitly, since it is the failure mode this repo is exposed to:
Resultis a new enum, not a case inserted into an existing one, so no error mapped positionally throughError*(rawValue:)renumbers.Scaffolding
Follows
updateTipCard, the closest existing sibling, through the same layers:ProfileService.setMinDmChatInitFee(_:owner:), async-native, with a newErrorSetMinDmChatInitFeecoveringok,denied, andinvalidAmountin the proto's rawValue order plus the usual negative transport sentinels.FlipClient+Profileexposes the publicsetMinDmChatInitFee(_:owner:)wrapper.ProfilegainsminDmChatInitFee: FiatAmount?, threaded through both memberwise initializers and the proto mapping.TransportClassificationTestsgains the required registry line.Database+Profilestores the whole struct as a JSON blob, so the new optional field round-trips with no schema change and noSQLiteVersionbump.No UI, Session, or Controller surface:
updateTipCardandtipCardCustomizationhave no consumers either, so a surface here would be inventing a feature rather than scaffolding the contract. That wiring belongs in whichever PR builds the screen.