kapil-panchal commented on code in PR #4902:
URL: https://github.com/apache/fineract/pull/4902#discussion_r2273669247


##########
fineract-core/src/main/java/org/apache/fineract/organisation/monetary/api/CurrenciesApiResource.java:
##########
@@ -77,4 +82,22 @@ public CurrencyUpdateResponse 
updateCurrencies(CurrencyUpdateRequest request) {
 
         return response.get();
     }
+
+    @POST
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Operation(summary = "Create a new currency", description = "Adds a new 
currency to the platform with the given code, name, symbol, decimal places, in 
multiples of and name code.")
+    public CurrencyCreateResponse createCurrencies(@Valid 
CurrencyCreateRequest request) {
+        final CurrencyCreateCommand command = new CurrencyCreateCommand();
+
+        request.setNameCode("currency." + request.getCode());

Review Comment:
   request.setNameCode("currency." + request.getCode()); is for setting the 
nameCode when the request comes in so that it need not be explicitly validated 
e.g. ("currency." + request.getCode()) here I am hardcoding the prefix currency.
   {
       "code":**"AAA"**,
       "name":"Currency23",
       "decimalPlaces":2,
       "inMultiplesOf":1,
       "displaySymbol": "Val",
       **"nameCode":"currency.AAA"**
   }



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to