agent-mtd-identifiers

Build Status Download

Micro-library for typing and validating UK tax identifiers within the Agents domain.

Now also includes support for access groups (aka granular permissions) in the Agent Services Account

Identifier Types

Types are provided for many common tax identifiers, such as:

JSON handling

Reads and Writes have been provided for Play's JSON library for all identifiers.

Validation

isValid method is available for all the identifiers.

Arn.isValid("TARN0000001") // true
Arn.isValid("TABC0000001") // false

Access group Types

These types are specific to agent services and exist to support the 'Access groups' (a.k.a. 'Granular permissions') feature.

There are two core types of access groups:

  • Custom group (a list of clients & team members)
  • Tax group (a tax service key & a list of team members, and a list of excluded clients)

Both group types extend the common trait and can also be converted into a slimmed down Group Summary

trait AccessGroup {
  def id: UUID
  def arn: Arn
  def groupName: String
  def created: LocalDateTime
  def lastUpdated: LocalDateTime
  def createdBy: AgentUser
  def lastUpdatedBy: AgentUser
}
### Installing

Add the following to your SBT build:
```scala
resolvers += Resolver.bintrayRepo("hmrc", "releases")

libraryDependencies += "uk.gov.hmrc" % "agent-mtd-identifiers" % "[INSERT VERSION]"

License

This code is open source software licensed under the Apache 2.0 License.