pub async fn create(
pool: &PgPool,
actor: &Actor,
project_id: Uuid,
input: TemplateInput,
) -> AppResult<ResultTemplate>Expand description
Creates a template (managers of the group, administrators).
ยงInvariants
- Permission: manager of the project group or administrator (403); a hidden group is a 404.
- Locks: the project group row (
FOR UPDATE), so the template count and the insert are one step. - Data: at most
MAX_TEMPLATESper group (400); the same name and load case twice gets a 409. - Audit:
result_template.create. - Notifications / webhooks: none.
- Atomic: one transaction.