Skip to content
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

Updated fees register contract api version and fixed incorrect fee issue #116

Merged
merged 5 commits into from
Mar 19, 2018

Conversation

sacsdam
Copy link
Contributor

@sacsdam sacsdam commented Mar 15, 2018

No description provided.

@sacsdam sacsdam requested a review from jaleen March 15, 2018 11:59
unPopulatedFee.setNaturalAccountCode(fee.getNaturalAccountCode());
Fee2Dto feeFromFeesRegister = feesDataMap.get(unPopulatedFee.getCode());
if(null!=feeFromFeesRegister) {
if(unPopulatedFee.getVersion().equals(feeFromFeesRegister.getCurrentVersion().getVersion())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the name pls, unpopulted doesn't makes any sense

unPopulatedFee.setNaturalAccountCode(fee.getNaturalAccountCode());
Fee2Dto feeFromFeesRegister = feesDataMap.get(unPopulatedFee.getCode());
if(null!=feeFromFeesRegister) {
if(unPopulatedFee.getVersion().equals(feeFromFeesRegister.getCurrentVersion().getVersion())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove this whole method. in toCSV it should retrieve individual value from map i.e. lazy initialization from fees register at repo level only when needed

return matchingFeeVersion;
}

public List<PaymentDto> getMemolineAndNacForReconciliation(List<PaymentDto> payments) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this method and replace it wih a map lookup using key like feecode_version and FeeVersionDTO as value. i.e. prepare the map once retrieved from the fees register

}


public FeeVersionDto getFeeVersion(String feeCode, String feeVersion) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this method, replace with it wih a map lookup using key like feecode_version and FeeVersionDTO as value. i.e. prepare the map once retrieved from the fees register


feeSb.add(fee.getCode()).add(fee.getVersion()).add(fee.getCalculatedAmount().toString());
String memolineWithQuotes="";
if (null!=fee.getMemoLine()){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it good idea to do it with Optional?

Map<String, FeeVersionDto> feeVersionsDtoMapForAFeeCode = getFeesVersionsData().get(feeCode);
FeeVersionDto matchingFeeDtoVersion = null;
if (null != feeVersionsDtoMapForAFeeCode) {
matchingFeeDtoVersion = feeVersionsDtoMapForAFeeCode.get(version);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use Optional here?

@sacsdam sacsdam merged commit 124c86d into master Mar 19, 2018
@sacsdam sacsdam deleted the feature/PAY-548-1 branch March 19, 2018 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants