Skip to content

feat(profile): scaffold SetMinDmChatInitFee - #1344

Merged
bmc08gt merged 4 commits into
code/cashfrom
feat/min-dm-chat-init-fee
Aug 27, 2026
Merged

feat(profile): scaffold SetMinDmChatInitFee#1344
bmc08gt merged 4 commits into
code/cashfrom
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 to Maven Central. The pin bump here names a version that does not exist yet, so dependency resolution reports com.flipcash:flipcash2-client-protocol:0.2.0 FAILED until then. CI never sees the local protoLocalRoot override, so it resolves the pin and nothing else.

Built green against the client checkout locally: :services:flipcash:assembleDebug and :services:flipcash:testDebugUnitTest.

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.

Scaffolding

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

  • ProfileApi.setMinDmChatInitFee builds and validates the request, dispatching on IO.
  • ProfileService folds the response Result into a new SetMinDmChatInitFeeError sealed class.
  • InternalProfileRepository reports every failure through ErrorUtils.handleError, matching updateTipCard rather than setUsername's selective suppression.
  • ProfileController.setMinDmChatInitFee(fee: Fiat) exposes it, with no local-profile-cache merge, again matching updateTipCard.
  • UserProfile gains minDmChatInitFee: Fiat?, mapped in UserProfileMapper, with new FiatPaymentAmount conversions in both directions.

No UI or feature-layer wiring: updateTipCard has 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.

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 bmc08gt self-assigned this Aug 27, 2026
@github-actions github-actions Bot added type: feature New functionality area: network gRPC, connectivity, API, exchange rates area: build-system Gradle, convention plugins, build-logic and removed type: feature New functionality labels Aug 27, 2026
@bmc08gt
bmc08gt marked this pull request as ready for review August 27, 2026 18:33
@bmc08gt
bmc08gt merged commit e0f29f8 into code/cash Aug 27, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/min-dm-chat-init-fee branch August 27, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: network gRPC, connectivity, API, exchange rates type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant