Skip to content

Conversation

@ac000
Copy link
Owner

@ac000 ac000 commented Aug 6, 2025

This function checks that the specified item, such as a NINO, business id, tax year, savings account name etc is in the correct format (not necessarily that they are actually valid).

Note: The postcode check isn't a strict postcode format check, it just checks against what HMRC says is valid for a postcode. E.g. from https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/property-business-api/6.0/oas/page#tag/Annual-Submissions/paths/~1individuals~1business~1property~1uk~1%7Bnino%7D~1%7BbusinessId%7D~1annual~1%7BtaxYear%7D/put

From the "Request Body schema"

ukProperty -> allowances -> structuredBuildingAllowance -> building ->
postcode

string ^[0-9a-zA-Z{À-˿’}\- _&`():.'^]{1,90}$

The postcode for the building

Use like

bool ok;

ok = mtd_is_valid_fmt(MTD_VLDT_FMT_NINO, "AB283902D");
...

This function checks that the specified item, such as a NINO, business
id, tax year, savings account name etc is in the correct format (not
necessarily that they are actually valid).

Note: The postcode check isn't a strict postcode format check, it just
checks against what HMRC says is valid for a postcode. E.g. from
<https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/property-business-api/6.0/oas/page#tag/Annual-Submissions/paths/~1individuals~1business~1property~1uk~1%7Bnino%7D~1%7BbusinessId%7D~1annual~1%7BtaxYear%7D/put>

From the "Request Body schema"

  ukProperty -> allowances -> structuredBuildingAllowance -> building ->
  postcode

    string ^[0-9a-zA-Z{À-˿’}\- _&`():.'^]{1,90}$

    The postcode for the building

Use like

  bool ok;

  ok = mtd_is_valid_fmt(MTD_VLDT_FMT_NINO, "AB283902D");
  ...

Signed-off-by: Andrew Clayton <ac@sigsegv.uk>
@ac000 ac000 merged commit 8137a3b into master Aug 6, 2025
10 checks passed
@ac000 ac000 deleted the vldt branch August 6, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants