Class NiPeriodThresholdSet
- Namespace
- Payetools.NationalInsurance.ReferenceData
- Assembly
- Payetools.NationalInsurance.dll
Represents a set of NI thresholds that have been adjusted to a proportion of the tax year.
public record NiPeriodThresholdSet : INiPeriodThresholdSet, INiThresholdSet, IEnumerable<INiThresholdEntry>, IEnumerable, IEquatable<NiPeriodThresholdSet>
- Inheritance
-
NiPeriodThresholdSet
- Implements
- Inherited Members
- Extension Methods
Constructors
NiPeriodThresholdSet(INiThresholdSet, PayFrequency, int)
Initialises a new instance of NiPeriodThresholdSet based on the supplied annual thresholds, the applicable pay frequency and the applicable number of tax periods.
public NiPeriodThresholdSet(INiThresholdSet entries, PayFrequency payFrequency, int numberOfTaxPeriods = 1)
Parameters
entries
INiThresholdSetSet of National Insurance thresholds as defined by HMRC for a given tax year (or portion of a tax year, when there are in-year changes).
payFrequency
PayFrequencyApplicable pay frequency.
numberOfTaxPeriods
intNumber of tax periods, if applicable. Defaults to 1.
Properties
Count
Gets the number of threshold value this threshold set contains.
public int Count { get; }
Property Value
this[int]
Gets the INiThresholdEntry at the specified index.
public INiThresholdEntry this[int index] { get; }
Parameters
index
intZero-based index into list.
Property Value
- INiThresholdEntry
The INiThresholdEntry for the specified index.
Methods
GetEnumerator()
Returns an enumerator that iterates through the thresholds (of type INiThresholdEntry).
public IEnumerator<INiThresholdEntry> GetEnumerator()
Returns
- IEnumerator<INiThresholdEntry>
An enumerator that can be used to iterate through the collection of thresholds.
Exceptions
- InvalidOperationException
Throw if the enumerator cannot be obtained. (Should never be thrown).
GetThreshold(NiThresholdType)
Gets the base threshold for the period, as distinct from the value returned by GetThreshold1(NiThresholdType) (see below).
public decimal GetThreshold(NiThresholdType thresholdType)
Parameters
thresholdType
NiThresholdTypeApplicable threshold (e.g., LEL, UEL, PT).
Returns
- decimal
Pro-rata threshold value applicable to the period and threshold type.
GetThreshold1(NiThresholdType)
Gets the modified threshold for the period (as distinct from the value returned by GetThreshold1(NiThresholdType)) where rounding is applied based on whether the pay frequency is weekly or monthly, or otherwise. As detailed in HMRC's NI calculation documentation as 'p1'.
public decimal GetThreshold1(NiThresholdType thresholdType)
Parameters
thresholdType
NiThresholdTypeApplicable threshold (e.g., LEL, UEL, PT).
Returns
- decimal
Pro-rata threshold value applicable to the period and threshold type.
ToString()
Gets a string representation of this NiPeriodThresholdSet.
public override string ToString()
Returns
- string
String representation of this instance.