# Line order

### Line order
Number your lines by **`sequence`**, not by the array order and not by
`position_number`. A chapter's own lines can stand *between* its sub-chapters —
a few lines, then a sub-chapter, then more lines — and the separate
`positions[]` and `chapters[]` arrays of a chapter cannot express that on their
own. `position_number` does not help either: an LV without ordinal numbers
reports `"-"` on every line.
`sequence` is a running number from 1, counted over chapters and lines together
across the whole tender, in the order Mercura shows the tender in. To rebuild
that order, collect every line of the tree and sort by `sequence`; a chapter's
own `sequence` places its heading right before its content. Each array stays
in that order on its own, so a tree walk works too if you merge a chapter's
`positions[]` and `chapters[]` by `sequence`.
The numbers only compare within one response: `include_deleted` and
`include_all_positions` add lines and shift them, and so can any edit to the
tender. Never store `sequence` as a key — the line's handle is its `id`.
`sequence` is read-only, not part of the `ETag`, and ignored when echoed back on
`PATCH`.

Version: 1.79.2

## Description:

  - `Line order` ()
    Number your lines by **`sequence`**, not by the array order and not by
`position_number`. A chapter's own lines can stand *between* its sub-chapters —
a few lines, then a sub-chapter, then more lines — and the separate
`positions[]` and `chapters[]` arrays of a chapter cannot express that on their
own. `position_number` does not help either: an LV without ordinal numbers
reports `"-"` on every line. `sequence` is a running number from 1, counted over chapters and lines together
across the whole tender, in the order Mercura shows the tender in. To rebuild
that order, collect every line of the tree and sort by `sequence`; a chapter's
own `sequence` places its heading right before its content. Each array stays
in that order on its own, so a tree walk works too if you merge a chapter's
`positions[]` and `chapters[]` by `sequence`. The numbers only compare within one response: `include_deleted` and
`include_all_positions` add lines and shift them, and so can any edit to the
tender. Never store `sequence` as a key — the line's handle is its `id`.
`sequence` is read-only, not part of the `ETag`, and ignored when echoed back on
`PATCH`.

