# SizeRun

object type

A size run — a RATIO over ONE option dimension (S-M-L-XL 1-2-2-1; a colour run 2 black: 1 white is equally real — any OptionGroup type may carry a run) a buyer fills a matrix with: kept ONCE and reused on every Style that names it (Style.sizeRunId — its group must be in the scheme) or by the dimension itself (OptionGroup.defaultSizeRunId — the org default lives on the dimension); resolution = the style pick, then the group default, then none (the matrix axes carry the resolved id). optionGroupId is IMMUTABLE at birth (a different dimension is a DIFFERENT run: doom + create — the PurchasePack unitsPerPack stance). entries = 1..256 { optionValueId, share } rows — DISTINCT values OF THAT GROUP, every share an integer 0..10000, the shares summing to at least 1, stored in the CALLER order = the display order (a 0-share value rides the run but never receives a unit). sizeRunFill spreads a total over the ratio by the fill rule (largest remainder, ties to the earlier entry, the quantities summing to the total exactly). Doom is blocked while a non-doomed Style or OptionGroup names the run (CONFLICT/REFERENCED naming the holders); deactivate is free. Group-parented (parentId === rootId); sysId SZ-….

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (SZ-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `SizeRun` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: active \| inactive \| doomed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent org group; for a SizeRun parentId === rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `optionGroupId` | [ID](/types/#scalars) `ID!` | The ONE dimension this run is over — set at creation, IMMUTABLE thereafter (a different dimension is a different run: doom + create). |
| `entries` | [SizeRunEntry](/types/SizeRunEntry/) `[SizeRunEntry!]!` | The ratio — 1..256 DISTINCT values of the run group with their shares (integers 0..10000, summing to at least 1), in the CALLER order = the display order. Editable WHOLESALE (every value re-gated a member of the group + non-doomed). |
| `code` | [String](/types/#scalars) | Optional mutable merchant reference code; uniqueness NOT enforced. |

## Used by

- [createSizeRun](/reference/size-run/createSizeRun/)
- [deactivateSizeRun](/reference/size-run/deactivateSizeRun/)
- [doomSizeRun](/reference/size-run/doomSizeRun/)
- [reactivateSizeRun](/reference/size-run/reactivateSizeRun/)
- [sizeRun](/reference/size-run/sizeRun/)
- [updateSizeRun](/reference/size-run/updateSizeRun/)
