-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FINERACT-1272: Creating Currencies (org.apache.fineract.organisation.monetary.api) #4971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
FINERACT-1272: Creating Currencies (org.apache.fineract.organisation.monetary.api) #4971
Conversation
|
This pull request seems to be stale. Are you still planning to work on it? We will automatically close it in 30 days. |
| @Size(min = 5, max = 50, message = "{org.apache.fineract.organisation.monetary.currencies" + ".name" + ".size}") | ||
| private String name; | ||
|
|
||
| @NotNull(message = "{org.apache.fineract.organisation.monetary.currencies.decimalPlaces" + ".notNull}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for string concatenation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will remove the String concat.
| private String name; | ||
|
|
||
| @NotNull(message = "{org.apache.fineract.organisation.monetary.currencies.decimalPlaces" + ".notNull}") | ||
| @Min(value = 0, message = "{org.apache.fineract.organisation.monetary.currencies" + ".decimalPlaces" + ".min}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for string concatenation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove the String concat.
|
|
||
| @NotNull(message = "{org.apache.fineract.organisation.monetary.currencies.decimalPlaces" + ".notNull}") | ||
| @Min(value = 0, message = "{org.apache.fineract.organisation.monetary.currencies" + ".decimalPlaces" + ".min}") | ||
| @Max(value = 5, message = "{org.apache.fineract.organisation.monetary.currencies" + ".decimalPlaces" + ".max}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for string concatenation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove the String concat.
| @Max(value = 5, message = "{org.apache.fineract.organisation.monetary.currencies" + ".decimalPlaces" + ".max}") | ||
| private Integer decimalPlaces; | ||
|
|
||
| @PositiveOrZero(message = "{org.apache.fineract.organisation.monetary.currencies" + ".inMultiplesOf" + ".positiveOrZero}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for string concatenation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove the String concat.
| @Data | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @SuperBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non need for SuperBuilder annotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will remove the SuperBuilder.
| import lombok.experimental.SuperBuilder; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need no arg constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove the NoArgsContructor.
| import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom; | ||
| import org.apache.fineract.organisation.monetary.data.CurrencyData; | ||
|
|
||
| @Builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please dont use Builder for JPA entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove the Builder.
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| @Service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont need this. We are using Configuration classes to instantiate this bean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will remove the Service annotation.
| final ApplicationCurrency currency = currencyMapper.mapToEntity(request); | ||
| currency.setNameCode(getNameCode(currency.getCode())); | ||
|
|
||
| validateIfExistingCurrency(currency.getCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do the validation first before any mapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do the validation before mapping.
adamsaghy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly see my review!
|
@kapil-panchal are you working on it? |
|
Hi Victor, yes I am awaiting comments from Aleksandar Vidakovic. |
|
@kapil-panchal also there are pending items in the code regarding the comments done by @adamsaghy |
|
@vidakovic awaiting your inputs on this ticket. |
|
@kapil-panchal You can move forward with the comments from others till @vidakovic review's also... |
|
@adamsaghy this ticket has the NewCommandInfrastructure implementation that I needed to get verified by @vidakovic? |
|
Moving this into draft as it was learned new command handler does not support:
|
Description
Describe the changes made and why they were made.
Ignore if these details are present on the associated Apache Fineract JIRA ticket.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.