37 Setting Adjustment Limit for Event Adjustments

Learn how to customize Oracle Communications Billing Care to set the maximum adjustment limit based on the currency resources used for event adjustments.

Topics in this document:

About Adjustment Limits

Typically, customer service representatives (CSRs) perform the adjustments by providing the adjustment amount to be applied for the customer. You can set an adjustment limit for a CSR to control the adjustment amount entered by the CSR. For event adjustments, you can customize Billing Care to set the maximum adjustment limit allowed for a CSR based on the currency resources used for the adjustments. For example, you can set an adjustment limit of $10 for USD and 5 euro for EUR for a CSR to perform event adjustments.

Setting Event Adjustment Limit for CSRs

To set the event adjustment limit for a CSR:

  1. If not already created, create a custom ResourceType and Resource (for example, AdjustmentResourceType, AdjustmentResource) with the adjustment action in the OPSS Server and add the ResourceType to the CustomConfigurations.xml file. See "Creating a Custom Configuration File" for more information.
  2. Add an obligation (for example, Maximum Adjustment Limit) in the custom adjustment resource with a string (for example, 840, the currency code for US dollars) for a policy using OPSS. For more information on adding obligations, see the OPSS documentation.
  3. Set the maximum adjustment limit you want to allow for the CSR for a currency resource as the obligation value in the OPSS Server. For example, $10 for USD.
  4. Create a custom REST resource to validate the adjustment amount entered in the Event Adjustment dialog box. See "Creating customAdjustmentResource.java Class" for more information.
  5. Create or update the CustomEventAdjustmentViewModel.js class file to override the default event adjustment flow. See "Creating the Custom Event Adjustment View Model" for more information.
  6. Configure the custom view model entry in the customRegistry.js file to use the custom view model that you created or updated. See "Configuring the Custom Event Adjustment View Model in the Registry" for more information.
  7. Deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".
  8. Verify the changes in Billing Care by doing the following:
    1. Log into Billing Care as a CSR who has adjustments action granted and maximum adjustment limit set.
    2. In the Events dialog box, select events and click Adjust.

      The Event Adjustment dialog box appears.

    3. Select an adjustment option and enter the adjustment amount you want to adjust.

    If the amount entered is less than the obligation value, the specified amount is adjusted. If the amount entered is more than the obligation value, an error message is displayed. For example: "You have exceeded the maximum adjustment limit for this currency."

Creating customAdjustmentResource.java Class

You can override the existing event adjustment flow with your customization by using REST resources. Create a custom resource Java class to validate the event adjustment amount against the obligation value.

To create the customAdjustmentResource.java class:

  1. Create the customAdjustmentResource.java class file in myproject/projectname/src/java/com/oracle/communications/brm/cc/ws/account, where myproject is your NetBeans IDE Billing Care customizations project and projectname is the name of your custom project.
  2. Add the following code in the customAdjustmentResource.java class file using a text editor:
    //Create a custom REST with class named as "customAdjustmentResource" 
    // Add method "adjustEvent" which takes parameter "AdjustmentEvent" 
    //This custom REST validates entered amount to adjust with the obligation and 
    then calls the OOTB REST resource. 
    @Path("customadjustment") 
    public class CustomAdjustmentResource { 
       
        @Context 
        HttpServletRequest servletRequest; 
           
        @Path("/event") 
        @POST 
        @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) 
        public void eventAdjustment(AdjustmentEvent adjustEvent) throws 
    JSONException, IOException { 
      
        UIRequestValue maxAdjustmentLimit = new 
    UIRequestValue(adjustEvent.getResourceId().toString(), 
                        adjustEvent.getAmount(), ConstraintOperator.GREATER_THAN, 
                        new EnforcementError(40010,"For this currency you have 
    exceed Max adjustment limit."));       
        //Checks if user is not super csr and UI value is greater than OPSS 
    obligation value and throws error "For this currency you have exceed Max 
    limit." 
        if (!EnforcementUtil.isResourceGranted(servletRequest, subject, 
    "BillingCare", EnforcementConstants.SUPERUSER_RESOURCE)) { 
           EnforcementUtil.checkAccess(subject, "BillingCare", "adjustment", 
            "AdjustmentResourceType","AdjustmentResource", 
           new EnforcementError(20000, "You do not have permission to perform an 
    adjustment."), maxAdjustmentLimit); 
        }           
       } 
         
       /* 
        *After validating maximum validity end month criteria invoke out of the 
    box code to perform adjustment. 
        */ 
       
     } 
      
  3. Save the file in your NetBeans IDE project.

Creating the Custom Event Adjustment View Model

Billing Care uses view model to define the display of the screens in Billing Care. You must create or update the custom view model, CustomEventAdjustmentViewModel, containing the details to set the adjustment limit for CSRs performing event adjustments.

See "About View Models" for more information about Billing Care view models.

To create the custom event adjustment view model:

  1. Create or update the customEventAdjustmentViewModel.js file in the myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
  2. Add the following code in the customEventAdjustmentViewModel.js file using a text editor:
    define(['knockout', 'jquery', 'underscore', 
    Registry.accountCreation.wizardBase, 
    'viewmodels/ARActions/adjustments/EventAdjustmentViewModel'], 
            function (ko, $, _, WizardBaseViewModel, EventAdjustmentViewModel) { 
                customEventAdjustmentViewModel.prototype = new 
    WizardBaseViewModel(); 
                function customEventAdjustmentViewModel() { 
                    EventAdjustmentViewModel.apply(this, arguments); 
                    var self = this; 
                     
                    self.persistData = function (eventAdjustmentObj) { 
                        var ajaxDef = $.ajax({ 
                            type: "POST", 
                            url: baseURL + "/customadjustment/event/", 
                            data: ko.toJSON(eventAdjustmentObj), 
                            contentType: "application/json; charset=utf-8", 
                            dataType: "json", 
                            processData: false 
                        }); 
    
                       ajaxDef.done(function (completeResponse) { 
                           
                        }); 
    
                        ajaxDef.fail(function (errorThrown) { 
                            alert(errorThrown.responseJSON.errorMessage); 
                        }); 
                        return ajaxDef; 
                    }; 
    
    
                } 
                return customEventAdjustmentViewModel; 
            }); 
  3. Save the file in your NetBeans IDE project.

Configuring the Custom Event Adjustment View Model in the Registry

After creating the required custom view model, create a custom event adjustment view model entry in the customRegistry.js file. Billing Care uses the custom event adjustment view model instead of the default event adjustment view model during adjustments and renders the Event Adjustment dialog box containing your customization.

To create the custom event adjustment view model entry in the registry:

  1. Create a customRegistry.js file in the myproject/web/custom/ directory.
  2. Define the custom event adjustment view model in this file. For example:
    eventAdjustment: { 
       viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js'       
    } 
  3. Save the file in your NetBeans IDE project.