notifications-api icon indicating copy to clipboard operation
notifications-api copied to clipboard

Ensure filenames unique between all email files within one template

Open CrystalPea opened this issue 1 month ago • 0 comments

In this PR

This is both when creating and updating an email file.

This is because we use these filenames as placeholder names in the template content.

Also simplify an existing test.

Best reviewed commit by commit.

Considerations

  • Should the check happen in the rest endpoint, together with the other checks? Or should it happen in the DAO methods, so it's as close to the database as possible?
  • Can we write it in as a constraint in the database? I struggled to find syntax that would enforce uniqueness of a field (unique filename ) only between a group of objects sharing the same value for another field (for email files within the same template).

Thanks

Thanks @BlessedDev for pairing on this PR 💖

CrystalPea avatar Nov 28 '25 17:11 CrystalPea