Table of Contents

Class HmrcAccountsOfficeReference

Namespace
Payetools.Common.Model
Assembly
Payetools.Common.dll

Represents an HMRC Accounts Office Reference, as defined at https://design.tax.service.gov.uk/hmrc-design-patterns/accounts-office-reference/, which is formatted as follows:

  • 3 numbers
  • The letter 'P'
  • 8 numbers, or 7 numbers and the letter ‘X’
(from )
public record HmrcAccountsOfficeReference : IEquatable<HmrcAccountsOfficeReference>
Inheritance
HmrcAccountsOfficeReference
Implements
Inherited Members

Constructors

HmrcAccountsOfficeReference(string)

Initialises a new instance of HmrcAccountsOfficeReference.

public HmrcAccountsOfficeReference(string accountsOfficeReference)

Parameters

accountsOfficeReference string

String value containing the HMRC Accounts Office Reference.

Exceptions

ArgumentException

Thrown if the supplied string value does not match the required pattern for valid HMRC Accounts Office Reference values.

Methods

IsValid(string)

Verifies whether the supplied string could be a valid HRMC Accounts Office Reference.

public static bool IsValid(string value)

Parameters

value string

String value to check.

Returns

bool

True if the supplied value could be a valid HMRC Accounts Office Reference; false otherwise.

Remarks

Although this method confirms whether the string supplied could be a valid HRMC Accounts Office Reference, it does not guarantee that the supplied value is registered with HMRC against a given company.

ToString()

Gets the string representation of this HmrcAccountsOfficeReference.

public override string ToString()

Returns

string

The value of this HmrcAccountsOfficeReference as a string.

Operators

implicit operator string(HmrcAccountsOfficeReference)

Operator for casting implicitly from a HmrcAccountsOfficeReference instance to its string equivalent.

public static implicit operator string(HmrcAccountsOfficeReference value)

Parameters

value HmrcAccountsOfficeReference

An instance of HmrcAccountsOfficeReference.

Returns

string