Skip to content

Commit

Permalink
fix: nid validation to prevent the informant, father, and mother from…
Browse files Browse the repository at this point in the history
… having the same id (#1011)

* changed parametes like mother.id to motherNationalId

* updated changelog.md

* updated changelog.md
  • Loading branch information
anamulhaquemollah authored Jun 13, 2024
1 parent dd943f0 commit e67f4d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- Each environment now has a dedicated docker-compose-<environment>-deploy.yml. Use `environment:init` to create a new environment and generate a corresponding file for customizable configurations.
- 🔒 OpenHIM console is no longer exposed via HTTP.
- Ansible playbooks are refactored into smaller task files.
- Resolved the issue of National ID validation to prevent the informant, father, and mother from having the same ID.

### New features

Expand Down
20 changes: 10 additions & 10 deletions src/form/common/default-validation-conditionals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export function getNationalIDValidators(configCase: string): Validator[] {
},
{
operation: 'duplicateIDNumber',
parameters: ['mother.iD']
parameters: ['mother.motherNationalId']
}
]
} else if (configCase === 'mother') {
Expand All @@ -328,7 +328,7 @@ export function getNationalIDValidators(configCase: string): Validator[] {
},
{
operation: 'duplicateIDNumber',
parameters: ['father.iD']
parameters: ['father.fatherNationalId']
}
]
} else if (configCase === 'deceased') {
Expand All @@ -339,7 +339,7 @@ export function getNationalIDValidators(configCase: string): Validator[] {
},
{
operation: 'duplicateIDNumber',
parameters: ['informant.informantID']
parameters: ['informant.informantNationalId']
}
]
} else if (configCase === 'groom') {
Expand All @@ -350,7 +350,7 @@ export function getNationalIDValidators(configCase: string): Validator[] {
},
{
operation: 'duplicateIDNumber',
parameters: ['bride.iD']
parameters: ['bride.brideNationalId']
}
]
} else if (configCase === 'bride') {
Expand All @@ -361,7 +361,7 @@ export function getNationalIDValidators(configCase: string): Validator[] {
},
{
operation: 'duplicateIDNumber',
parameters: ['groom.iD']
parameters: ['groom.groomNationalId']
}
]
} else {
Expand All @@ -373,23 +373,23 @@ export function getNationalIDValidators(configCase: string): Validator[] {
},
{
operation: 'duplicateIDNumber',
parameters: ['deceased.deceasedID']
parameters: ['deceased.deceasedNationalId']
},
{
operation: 'duplicateIDNumber',
parameters: ['mother.iD']
parameters: ['mother.motherNationalId']
},
{
operation: 'duplicateIDNumber',
parameters: ['father.iD']
parameters: ['father.fatherNationalId']
},
{
operation: 'duplicateIDNumber',
parameters: ['groom.iD']
parameters: ['groom.groomNationalId']
},
{
operation: 'duplicateIDNumber',
parameters: ['bride.iD']
parameters: ['bride.brideNationalId']
}
]
}
Expand Down

0 comments on commit e67f4d6

Please sign in to comment.