Files
XBid/naming.md
2026-08-18 12:11:20 +02:00

68 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Shot Naming Conventions
## Shot Code Format
Shot codes are auto-generated on creation and are **read-only** after that point.
### Standard Job
```
{SHOW_ID}_{SCENE}_{SHOT_NUMBER}
```
Example: `PRJX_SC010_0010`
### Episodic Job
```
{SHOW_ID}_{EPISODE}_{SCENE}_{SHOT_NUMBER}
```
Example: `PRJX_EP01_SC010_0010`
---
## Segments
| Segment | Source | Notes |
|---|---|---|
| `SHOW_ID` | `Job.showId` | 1–10 chars, letters/numbers/underscores, stored uppercase. Set once on the job. |
| `EPISODE` | `Shot.episode` | Only present on `EPISODIC` jobs. Free-text, stored uppercase (e.g. `EP01`). |
| `SCENE` | `Shot.scene` | Required on every shot. Stored uppercase (e.g. `SC010`). |
| `SHOT_NUMBER` | Auto-incremented | 4-digit zero-padded integer, increments by 10 (e.g. `0010`, `0020`). |
---
## Auto-Incrementing Shot Numbers
The shot number is scoped to the **scene within a job** (and additionally to the **episode** for episodic jobs):
- On create, the system queries `MAX(shotNumber)` for all shots sharing the same `jobId + scene` (+ `episode` for episodic).
- The new shot number = `MAX + 10`, starting at `0010` when no prior shots exist in that scene.
- The number is zero-padded to 4 digits.
This means shot numbers are **non-contiguous by design** — gaps allow shots to be inserted between existing ones without renumbering.
When a shot is **duplicated**, it inherits the scene/episode of the original and receives the next available shot number in that scope. Only the trailing 4-digit segment in the code is replaced; the rest of the code is preserved.
---
## Where Fields Come From
| Field | Model | Required? |
|---|---|---|
| `showId` | `Job` | Yes — validated 1–10 chars, `[A-Z0-9_]` |
| `projectCode` | `Job` | Yes — unique across all jobs, used for billing/reference (not in shot code) |
| `jobType` | `Job` | Yes — `STANDARD` or `EPISODIC`; controls whether episode segment is included |
| `scene` | `Shot` | Yes — required by `shotSchema` |
| `episode` | `Shot` | Optional — only meaningful (and included in code) when `jobType === EPISODIC` |
| `shotGroup` | `Shot` | Optional — organisational grouping only, not part of the shot code |
---
## Notes
- `projectCode` is a separate billing/admin identifier on the Job and does **not** appear in shot codes. Shot codes use `showId` instead.
- Shot codes are not regenerated on edit — if scene or episode values change after creation, the stored `shotCode` will not reflect those changes.
- All string segments are uppercased before being written into the code.