# FNR (FnrGenerator)

The [FNR](https://docs.tonic.ai/app/generation/generators/generator-reference/fnr) generator transforms Norwegian national identity numbers.

## Link object structure <a href="#generator-api-fnr-link-object-structure" id="generator-api-fnr-link-object-structure"></a>

The `metadata` object is populated from the [`FnrMetadata`](https://app.tonic.ai/apidocs/index.html#/models/FnrMetadata) object.

`preserveDate` indicates whether to preserve the birthdate values from the source database in the destination database. If the birthdate values are not preserved, the destination values are still within the same range as the source values.

`preserveGender` indicates whether the destination value should reflect the same gender as the source value.

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "path": "string",  //JSON fields only
  "dataType": "string",  //MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {
    "presetId": "string",
    "generatorId": "FnrGenerator",
    "preserveDate": boolean,
    "preserveGender": boolean,
    "isConsistent": boolean,
    "consistencyColumn": "string",
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor applied
  }
}
```

## Example replacement <a href="#generator-api-fnr-example-replacement" id="generator-api-fnr-example-replacement"></a>

In the following example replacement for the FNR generator, the birthdate values in the source database are not preserved in the destination database.

The destination values use the same gender as the source values.

The generator is consistent with the `name` column.

```json
{
  "name": "fnr",
  "schema": "public",
  "table": "users",
  "links": [
    {
      "column": "fnr",
      "table": "users",
      "schema": "public",
      "metadata": {
        "presetId": "FnrGenerator",
        "generatorId": "FnrGenerator",
        "preserveDate": false,
        "preserveGender": true,
        "isConsistent": true,
        "consistencyColumn": "name"
      }
    }
  ]
}
```
