Open SandGrainOne opened 4 weeks ago
Checking with Register to get any inputs and/or a go-ahead to do the change and sent a PR.
OK to submit PR. Check/validate approach with @Alxandr before starting.
Input from refinement: v1 can be 1-by-1 lookups
Description
Notifications have a needs for the first, middle and last name of a person as separate properties. The values will be used in search and replace operations when notification texts contains keyword for those values. Register currently doesn't have a suitable endpoint that provide this, so we need to make changes to Register.
This issue will make changes to the register/api/v1/parties/nameslookup endpoint in Register with a new parameter and optionally include the name of a person as separate properties for first, middle and last name.
Additional Information
There was an analysis of existing endpoints in Register: #589. This concluded that we needed changes in Register and potentially in Altinn 2 (bridge). After a talk with the team responsible for Register we've found a solution isolated to Register.
Tasks
Altinn.Platform.Register.Models.PartyName
model with properties for FirstName, MiddleName and LastName. Decorate the properties with[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
Altinn.Register.Clients.PartiesClient.GetOrAddPartyNameToCacheAsync()
method to support a more complex entity instead of only a single string. It's a private method so we could consider using a record struct.Altinn.Register.Controllers.PartiesController.PostPartyNamesLookup()
method calledsplitpersonname
. The value should be used to optionally populate first, middle and last name during mapping to the PartyName model. (In a future version of Register the default behavior of the logic is to not retrieve the values from the database unless specifically asked for. This is future proofing.)LookupPartyBySSNOrOrgNo()
.Acceptance Criterias
register/api/v1/parties/nameslookup
endpoint returns the person name split across separate properties in addition to the original name property.