InjectorTaxCharges

InjectorTaxCharges

Creates a tax charges injector

Constructor

new InjectorTaxCharges(skv_config, arr_tax_years, arr_tax_charges, arr_tax_company_vehicle)

Source:
Parameters:
Name Type Description
skv_config struct

Struct passed in when initializing the injector

arr_tax_years array

Array of basic tax years that we will manipulate and pass back

arr_tax_charges array

Array of tax charges data from pluto

arr_tax_company_vehicle array

Array of company vehicle tax data from pluto

Methods

(static) addTaxChargesToTaxYears(arr_tax_years, arr_tax_charges) → {array}

Source:

Updated tax years with the tax charges

Parameters:
Name Type Description
arr_tax_years array
arr_tax_charges array
Returns:
Type
array

(static) duplicateChargeYears(arr_tax_years, arr_tax_rates) → {array}

Source:

See if we need to duplicate tax charge years to match the tax years

Parameters:
Name Type Description
arr_tax_years array

Basic tax years

arr_tax_rates array

Tax rates, bands etc could be charges or company vehicle from pluto

Returns:

Amended tax charges array

Type
array

(static) removeChargeYears(arr_tax_years, arr_tax_rates) → {array}

Source:

See if we need to remove tax charge years to match the tax years

Parameters:
Name Type Description
arr_tax_years array

Basic tax years

arr_tax_rates array

Tax rates, bands etc could be charges or company vehicle from pluto

Returns:

Amended tax charges array

Type
array

(static) removeUnrequiredRegions(region_code_to_keep) → {array}

Source:

We don't want redundant region data in tax charges, so remove it

Parameters:
Name Type Description
region_code_to_keep string
Returns:

Tax charges with regions removed from income tax

Type
array

formatData(data, coverage_ratio, curr_key) → {anything}

Source:

Recurse through a deeply nested object and update the desired key values with the coverage ratio

Parameters:
Name Type Description
data anything
coverage_ratio number
curr_key string

We need current key to check whether its a value to multiply by coverage ratio

Returns:
Type
anything

updateToUseMonthsOccupied(param_name) → {data_type}

Source:

Description

Parameters:
Name Type Description
param_name data_type

Description

Returns:

Description

Type
data_type