notifications-api
notifications-api copied to clipboard
Ensure filenames unique between all email files within one template
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 💖