What problem does it solve?
Generating human-readable business numbers without gaps or duplicates under concurrent writes is difficult when numbering logic runs outside the database or outside the write transaction. This Skill centralizes sequence allocation so financial and compliance documents receive deterministic, auditable numbers that remain consistent after rollbacks and concurrent operations.
Core Features & Use Cases
- Atomic, gap-free allocation: Uses a centralized sequences table and an atomic SQL UPSERT to allocate monotonic numbers per prefix.
- Transaction safety: Designed to be called with the transaction handle so number allocation and record insertion are atomic and rollback-safe.
- Flexible formatting: Supports pad length, separator, and optional year prefix while keeping the counter keyed by prefix.
- Use cases: Invoice, order, shipment, purchase order numbering, compliance documents, and automated test validations for concurrency and rollback scenarios.
Quick Start
Generate a gap-free invoice number for prefix INV inside the same transaction and persist it with the invoice record.