Skip to content

Commit

Permalink
feat:Business logic exception categorized as features
Browse files Browse the repository at this point in the history
  • Loading branch information
sathish Ramesh committed Nov 18, 2024
1 parent 43596ab commit 347a360
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.mx.path.model.mdx.accessor.feature;

import java.util.HashMap;
import java.util.Map;

import com.mx.path.core.common.request.Feature;

public class FeatureMapper {

private static final Map<Feature, String> FEATURE_NAMES = new HashMap<>();

static {
FEATURE_NAMES.put(Feature.TRANSFERS, "transfers");
FEATURE_NAMES.put(Feature.REMOTE_DEPOSITS, "remote_deposits");
}

public static String getFeatureName(Feature feature) {
return FEATURE_NAMES.get(feature);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.mx.path.model.mdx.accessor.ach_transfer;

package com.mx.path.model.mdx.accessor.transfer;

import com.mx.path.core.common.request.Feature;
import com.mx.path.model.mdx.accessor.feature.ErrorDescriptor;
import com.mx.path.model.mdx.accessor.feature.Feature;
import com.mx.path.model.mdx.accessor.feature.FeatureException;
import com.mx.path.model.mdx.accessor.feature.FeatureMapper;

/**
* Exception thrown when there is an error related to transfers.
Expand All @@ -29,6 +31,6 @@ public TransfersException(String userMessage, ErrorDescriptor errorDescriptor) {
*/
@Override
protected String getFeatureName() {
return Feature.TRANSFERS.getFeatureName();
return FeatureMapper.getFeatureName(Feature.TRANSFERS);
}
}

0 comments on commit 347a360

Please sign in to comment.