Skip to content

FiatPaymentAccountsRestApi POST endpoint should return server-generated account fields #4344

@coderabbitai

Description

@coderabbitai

Context

During review of PR #4338 (#4338 (comment)), it was identified that the POST /payment-accounts/fiat endpoint returns the original input DTO instead of the created account with server-generated fields.

Issue

In FiatPaymentAccountsRestApi.addAccount(), the endpoint currently returns the incoming accountDto from the request. However, the actual created account has server-generated fields:

  • id (generated via StringUtils.createUid())
  • creationDate (generated via System.currentTimeMillis())

The response doesn't reflect these server-assigned values.

Proposed Solution

As suggested by @HenrikJannsen, the endpoint should reflect the Bisq 2 model 1:1 by:

  1. Converting the created Account back to a DTO after accountService.addPaymentAccount(account)
  2. Returning the mapped DTO that includes all server-generated fields

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions