43 Disabling Event Adjustment Options Based on Roles

Learn how to customize Oracle Communications Billing Care to support the disabling of event adjustment options based on customer service representatives (CSRs) roles.

Topics in this document:

About Event Adjustment Options

By default, the following options in the Event Adjustment dialog box are enabled and CSRs can select these options to adjust events:

  • Adjust amount and tax
  • Adjust amount only
  • Adjust tax only

CSRs can also backdate an adjustment if required. You can customize Billing Care using the SDK to disable these options based on the user roles.

Disabling Event Adjustment Options Based on User Roles

You can customize the Event Adjustment dialog box using the SDK and Oracle Platform Security Services Entitlements Server (OPSS) policies to disable or enable the event adjustment options.

To disable the event adjustment or backdate options in the Event Adjustments dialog box:

  1. Define a new ResourceType and Resource for event adjustment options in the OPSS Server. For example, EventAdjustmentResourceType, EventAdjustmentResource .
  2. Define the following as corresponding actions for the ResourceType in the OPSS Server as required:
    • AmountAndTax
    • AmountOnly
    • TaxOnly
    • backDateEventAdjustment
  3. Associate the new Resource to the new ResourceType.
  4. Add the new ResourceType to the CustomConfigurations.xml file. For example:
    <keyvals> 
       <key>authorizationResourceTypes</key> 
       <value>EventAdjustmentResourceType</value> 
       <desc>Add comma separated OPSS Resource Types(values) for authorization. Also these resource types should be defined in OPSS. Please note that the key should not be changed here.</desc> 
    </keyvals>
  5. Create a custom view model to disable the options in the Event Adjustment dialog box. See "Creating a Custom View Model for Disabling Adjustment Options" for more information.
  6. Create a customRegistry.js file to configure Billing Care to use the custom view model that you created. See "Configuring the Custom View Model for Disabling Event Adjustment Options".
  7. Deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".

Creating a Custom View Model for Disabling Adjustment Options

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, and add the details to customize the display of event adjustment or backdate options in the Event Adjustment dialog box.

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

To create a custom model for disabling event adjustment or backdate options:

  1. Create or update the customEventAdjustmentViewModel.js file in myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
  2. To disable the amount and tax adjustment options based on the user role, add the following code in the customEventAdjustmentViewModel.js file using a text editor:
    define(['jquery', 
        'underscore', 
        'knockout', 
        'knockout-mapping', 
        'viewmodels/ARActions/adjustments/EventAdjustmentViewModel' 
         
    ], 
            function ($, _, ko, komapping, EventAdjustmentViewModel) { 
                function customEventAdjustmentViewModel() { 
                    EventAdjustmentViewModel.apply(this, arguments); 
                     
                     
                    $(function() { 
                             var myVar=    setInterval(function() { 
                                     
                                     if($('#lblAdjustAmountAndTax').length>0) 
                                     { 
                                         
    if(!util.isGrantedResourceAction('AmountAndTax','EventAdjustmentResource')) 
                                        { 
                                             
    $('#lblAdjustAmountAndTax').parent().hide(); 
                                        } 
                                         
    if(!util.isGrantedResourceAction('AmountOnly','EventAdjustmentResource')) 
                                        { 
                                             
    $('#lblAdjustAmountOnly').parent().hide(); 
                                        } 
                                         
    if(!util.isGrantedResourceAction('TaxOnly','EventAdjustmentResource')) 
                                        { 
                                             
    $('#lblAdjustTaxOnly').parent().hide(); 
                                        } 
                                        clearInterval(myVar); 
                                     } 
                                     
                                 }, 20); 
                                 
                        }); 
                   
                } 
                customEventAdjustmentViewModel.prototype = new EventAdjustmentViewModel(); 
                return customEventAdjustmentViewModel; 
            }); 
  3. To disable the backdate option based on the user role, add the following code in the customEventAdjustmentViewModel.js file using a text editor:
    define(['jquery', 'knockout',
        'viewmodels/ARActions/adjustments/EventAdjustmentViewModel'
    ],
            function($, ko, EventAdjustmentViewModel) {
                function CustomEventAdjustmentViewModel() {
                    EventAdjustmentViewModel.apply(this, arguments);
                    $(function() {
                        var myVar1 = setInterval(function() {
                            if ($('#eventAdjustmentEffectiveDate').length > 0)
                            {
                                if
    (!util.isGrantedResourceAction("backDateEventAdjustment", "customResource"))
    {
                                    
    $('#eventAdjustmentEffectiveDate').attr('disabled', true);
                                    
    $("#eventAdjustmentEffectiveDate").next("img").off("click")
                                }
                                clearInterval(myVar1);
                            }
                        }, 40);
                    });
                }
                CustomEventAdjustmentViewModel.prototype = new
    EventAdjustmentViewModel();
                return  CustomEventAdjustmentViewModel;
            });
  4. Save the file in your NetBeans IDE project.

Configuring the Custom View Model for Disabling Event Adjustment Options

After creating or updating the required custom view model, ensure that the custom event adjustment view model entry is created 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 myproject/web/custom/ directory.
  2. Define the custom event adjustment view model entry in this file. For example:
    eventAdjustment: { 
       viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js' 
    } 
  3. Save the file in your NetBeans IDE project.