Altinn / altinn-register

Altinn platform microservice for handling register data
0 stars 1 forks source link

Define datamodel for Altinn 3 Register #189

Open TheTechArch opened 2 months ago

TheTechArch commented 2 months ago

Description

We need to define the data model for the Altinn 3 register. Altinn 3 register is used for the following.

Currently, all this data is taken from the Altinn 2 register.

In scope

We need to identify the amount of data in Altinn 2 that is needed to be stored in Altinn 3.

We should expect that when this happens, Altinn 3 Apps will still be using the same GetParty API in Register and be expecting at least the same amount of data as before. This data will be used for prefil in Apps

For performance reasons, there might be a need to switch early, before 2026, and stuff should work as before.

The following enities are exposed by register API in Altinn 3.

Beeing able to populate all current fields on the entities from the new data model is essential.

    public class Party
    {
        public int PartyId { get; set; }

        public Guid? PartyUuid { get; set; }

        public PartyType PartyTypeName { get; set; }

        public string OrgNumber { get; set; }

        public string SSN { get; set; }

        public string UnitType { get; set; }

        public string Name { get; set; }

        public bool IsDeleted { get; set; }

        public Person Person { get; set; }

        public Organization Organization { get; set; }
    }
}

See register repo

 public class Person
    {
        public string SSN { get; set; }

        public string Name { get; set; }

        public string FirstName { get; set; }

        public string MiddleName { get; set; }

        public string LastName { get; set; }

        public string TelephoneNumber { get; set; }

        public string MobileNumber { get; set; }

        public string MailingAddress { get; set; }

        public string MailingPostalCode { get; set; }

        public string MailingPostalCity { get; set; }

        public string AddressMunicipalNumber { get; set; }

        public string AddressMunicipalName { get; set; }

        public string AddressStreetName { get; set; }

        public string AddressHouseNumber { get; set; }

        public string AddressHouseLetter { get; set; }

        public string AddressPostalCode { get; set; }

        public string AddressCity { get; set; }

        public DateTime? DateOfDeath { get; set; }
    }

See register repo

public class Organization
    {
        public string OrgNumber { get; set; }

        public string Name { get; set; }

        public string UnitType { get; set; }

        public string TelephoneNumber { get; set; }

        public string MobileNumber { get; set; }

        public string FaxNumber { get; set; }

       public string EMailAddress { get; set; }

        public string InternetAddress { get; set; }

        public string MailingAddress { get; set; }

        public string MailingPostalCode { get; set; }

        public string MailingPostalCity { get; set; }

        public string BusinessAddress { get; set; }

        public string BusinessPostalCode { get; set; }

        public string BusinessPostalCity { get; set; }

        public string UnitStatus { get; set; }
    }

See register repo

Analysis

Altinn 2 Datamodel

The following describes the central tables in the Altinn 2 data model.

image

Altinn 3 database design

Below is the suggested design. The principles followed are

image

Important

Field Note
party.created_date_time Time created in Altinn database
party.last_updated_date_time Date from ER when available, else date in Altinn

Conclusion

No response

SandGrainOne commented 1 month ago

@TheTechArch Team Core is removing this issue from our board.