Altinn / altinn-notifications

Altinn platform microservice for handling notifications (mail, sms, etc)
MIT License
2 stars 3 forks source link

Investigate the use of the [UseRegisterForNotification] field #526

Open SandGrainOne opened 1 month ago

SandGrainOne commented 1 month ago

Description

UnitProfile has a boolean called [UseRegisterForNotification]. We should look into how it should be used or if we need it. Is it in use by Altinn 2. If so, then document the use.

Analysis

Persisted in table: UnitProfile 792236 units in production with this value set to true. ~36% of all units in db

Application logic: In SBL there are two procedures to update the property UseRegisterForNotification for a UnitProfile within UnitProfileDAL.cs.

  1. This function SaveUnitProfile is again used by UnitProfileSI's method SaveUnitProfileInternal which has 0 references.
  2. The functionn UpdateUnitProfileLastModified is used by UnitProfileSI's method SaveUnitProfile and only updated the property in question if unitProfile.Id == 0.

In SBL I can find two functions that read the property, but as far as I can see the value is not further used in the business logic.

DB logic

Conclusion

A property we should not migrate. Rules for updating unit profile can be controlled without the property, There is no logic actually retrieving notification endpoints from Register if property is not set. This has also been confirmed by Brønnøysundregistrene.