Open zalsaeed opened 2 weeks ago
Regarding deletion: When a template that has an associated event is deleted, and a user tries to generate a certificate for that event, an error occurs because the template image and name are missing. What if we allow the user to delete the template, but instead of completely removing it, we make it similar to the process of deleting an event type? The template would disappear from the user's view but remain in the database with an inactive status. Certificates could still be generated for events relying on the deleted template. Another solution, we could notify the user that deleting the template may result in an inability to generate certificates that depend on it. If a user attempts to generate a certificate with the deleted template, user would be alerted that it relies on a non-existent template.
I recommend the first option: "make delete as inactive, not deleted, only hide from user view." When generating using an inactive template, a user message should appear:
"You are trying to use an inactive template. Do you want to reactivate it to continue generating?"
I believe it is better to update the file path for images and the position for JSON objects, as well as the template name, while keeping the ID the same. This way, when the user clicks on generate after a successful update, they will have new values, while previously generated certificates will retain the old values. This enhances the process.
For the update process, I suggest:
An important behavior that we need to discuss is what if the templates are deleted or updated? How can it effect existing certificate that uses the given template?