Auto-numbering
Auto-generate sequential reference numbers for records — like ticket numbers (INC-00042), order IDs, or case references.
Configuration
| Setting | Description |
|---|---|
| Prefix | Text before the number (e.g., INC-, TICKET-, ORD-) |
| Padding | How many digits, zero-padded (e.g., 5 → 00042) |
| Next value | The next number to assign |
The formatted output is stored in the record's pfm_number column.
Atomic allocation
Number allocation uses INSERT ... ON DUPLICATE KEY UPDATE with LAST_INSERT_ID() — this guarantees no two records get the same number, even under concurrent load.
Backfill
If you add auto-numbering to an existing entity:
POST /pfm/v1/meta/entities/{slug}/numbering/backfill
This assigns numbers to all existing records that don't have one yet.
Format stability
The format is captured at allocation time. If you later change the prefix or padding, existing records keep their original numbers. Only new records use the updated format.