Skip to content

feat(profile): scaffold SetMinDmChatInitFee - #672

Merged
bmc08gt merged 2 commits into
mainfrom
feat/min-dm-chat-init-fee
Aug 27, 2026
Merged

feat(profile): scaffold SetMinDmChatInitFee#672
bmc08gt merged 2 commits into
mainfrom
feat/min-dm-chat-init-fee

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Scaffolds SetMinDmChatInitFee and UserProfile.min_dm_chat_init_fee, which arrive in flipcash2-client-protocol 0.2.0.

Blocked on the contract release

Draft until code-payments/flipcash2-client-protocol#5 merges and 0.2.0 publishes. The exact: requirement here names a tag that does not exist yet, so SwiftPM cannot resolve it. CI never sees the local FLIPCASH_PROTO_LOCAL override, so it resolves the pin and nothing else.

Built green against the client checkout locally: ./Scripts/build.sh, scheme Flipcash, generic/platform=iOS.

What the contract added

SetMinDmChatInitFee sets the minimum fee another user must pay to initialize a DM chat with the caller, replacing any fee already set. SetMinDmChatInitFeeResponse.Result is a new enum of OK, DENIED, and INVALID_AMOUNT. UserProfile.min_dm_chat_init_fee is a new optional FiatPaymentAmount, unset when the user has not chosen one.

Worth stating explicitly, since it is the failure mode this repo is exposed to: Result is a new enum, not a case inserted into an existing one, so no error mapped positionally through Error*(rawValue:) renumbers.

Scaffolding

Follows updateTipCard, the closest existing sibling, through the same layers:

  • ProfileService.setMinDmChatInitFee(_:owner:), async-native, with a new ErrorSetMinDmChatInitFee covering ok, denied, and invalidAmount in the proto's rawValue order plus the usual negative transport sentinels.
  • FlipClient+Profile exposes the public setMinDmChatInitFee(_:owner:) wrapper.
  • Profile gains minDmChatInitFee: FiatAmount?, threaded through both memberwise initializers and the proto mapping.
  • TransportClassificationTests gains the required registry line.

Database+Profile stores the whole struct as a JSON blob, so the new optional field round-trips with no schema change and no SQLiteVersion bump.

No UI, Session, or Controller surface: updateTipCard and tipCardCustomization have 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.

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.
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