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:
- Converting the created
Account back to a DTO after accountService.addPaymentAccount(account)
- Returning the mapped DTO that includes all server-generated fields
Related