Scene templates are reusable episode structures — a named collection of scenes and blocks that can be applied to a new episode to pre-populate its structure. They are distinct from the assignment template (which manages creator roles and stages).
Data model
Template
| Field | Type | Description |
|---|
id | number | Primary key |
name | string | Display name |
description | string | What kind of episodes this template suits |
isActive | boolean | Whether the template is available for use |
TemplateScene
| Field | Type | Description |
|---|
templateId | number | Parent template |
title | string | Scene title placeholder |
order | number | Position in the template |
TemplateBlock
| Field | Type | Description |
|---|
templateSceneId | number | Parent scene |
type | dialog | action | Block type |
order | number | Position in the scene |
placeholder | string | Hint text for the writer |
Applying a template
When a user applies a template to an episode, the backend clones all template scenes and blocks (with type and order preserved) into real scene and scene_block records linked to the episode. Existing scenes in the episode are not affected.
GET /templates vs GET /templates/all
/templates — returns only isActive = true records (what users see)
/templates/all — returns all records including archived ones (admin view)
Permission scopes
| Scope | What it guards |
|---|
TEMPLATE_CREATE | Creating a template |
TEMPLATE_EDIT | Editing template metadata, scenes, and blocks |
TEMPLATE_DELETE | Deleting a template |