Skip to main content

Task Numbering System

Revision 1.0 (2026-02-23) - Initial documentation

Feature Summary

The Task Numbering System automatically generates a unique, human-readable reference number for every workflow task created in the platform. This number appears across all views — task toolbar, task lists, print previews, and PDF/XLSX exports — providing a consistent identifier for cross-referencing tasks in meetings, reports, and communications.

Key Capabilities:

  • Automatic number generation at task creation (no manual input)
  • Configurable format per employer (6 built-in options)
  • Customizable type prefixes per workflow type
  • Atomic sequence generation (no duplicates, even under concurrent load)
  • Visible in all task views: toolbar, My Tasks, All Tasks, print preview, PDF/XLSX export

Design Decision: "Task No." vs "Document No."

Feedback Requested

We chose Task No. (เลขที่งาน) instead of Document No. (เลขที่เอกสาร).

Why? Each workflow task may contain multiple documents (e.g., a Project Registration task contains both the Registration Form and the Pre-Work Procedures Form). A single task number covers all documents within that task.

If we used "Document No." instead, it would imply each document has its own unique number — which would require a more complex per-document numbering system that adds overhead without clear benefit at this stage.

Please confirm: Is "Task No." the right label? Or should each document have its own number?

Visual Comparison

┌─────────────────────────────────────────────────────┐
│ Option A: Task No. (Current — Recommended) │
│ │
│ Task: REG-202602-000001 │
│ ├── Project Registration Form (same number) │
│ └── Pre-Work Procedures Form (same number) │
│ │
│ + Simple: one number per task │
│ + Easy to reference in meetings │
│ + "Check task REG-202602-000001" — clear & short │
├─────────────────────────────────────────────────────┤
│ Option B: Document No. (Over-engineered) │
│ │
│ Task: REG-202602-000001 │
│ ├── Project Registration Form REG-202602-000001/1│
│ └── Pre-Work Procedures Form REG-202602-000001/2│
│ │
│ - More complexity with little benefit │
│ - Users rarely reference individual documents │
│ - Longer number, harder to communicate verbally │
└─────────────────────────────────────────────────────┘

Number Format

The task number follows this pattern:

{TypePrefix}-{DatePart}-{PaddedRunningNumber}

Format Options (6 choices)

Employers can choose from 6 built-in formats in Settings > Employer > Document Numbering:

#CalendarFormatExample
1CE (ค.ศ.)Year/Month/Day/RunREG-20260223-0001
2CE (ค.ศ.)Year/Month/RunREG-202602-000001
3CE (ค.ศ.)Year/RunREG-2026-00000001
4BE (พ.ศ.)Year/Month/Day/RunREG-25690223-0001
5BE (พ.ศ.)Year/Month/RunREG-256902-000001
6BE (พ.ศ.)Year/RunREG-2569-00000001

Trade-offs by format:

Granularity:  Daily ◄──────────────────► Yearly
Format 1,4 Format 2,5 Format 3,6

Counter size: 4 digits 6 digits 8 digits
Reset cycle: Every day Every month Every year
Best for: High volume Medium volume Low volume
(many tasks (standard (small
per day) operations) teams)

Type Prefixes (Customizable)

Each workflow type has a default prefix that can be changed per employer:

Workflow TypeDefault PrefixExample Number
Project Registration (ขึ้นทะเบียนโครงการ)REGREG-202602-000001
Contractor Registration (ลงทะเบียนผู้รับเหมา)CRCR-202602-000001
Work Permit Request (ขอใบอนุญาตทำงาน)WPWP-202602-000001
Training Enrollment (ส่งรายชื่อผู้อบรม)TETE-202602-000001
JSA Preparation (จัดเตรียม JSA)JSAJSA-202602-000001
Tool List Preparation (รายการเครื่องมือ)TLTL-202602-000001
Contractor Evaluation (ประเมินผู้รับเหมา)CECE-202602-000001

Where Task Numbers Appear

┌──────────────────────────────────────────────┐
│ 1. Task Toolbar (Review Task) │
│ ┌────────────────────────────────────────┐ │
│ │ [Status: ...] [REG-202602-000001] │ │
│ └────────────────────────────────────────┘ │
│ │
│ 2. My Tasks (Task Cards) │
│ ┌────────────────────────────────────────┐ │
│ │ Project Registration │ │
│ │ REG-202602-000001 (monospace, gray) │ │
│ │ Project ABC │ │
│ └────────────────────────────────────────┘ │
│ │
│ 3. All Tasks (Table Column) │
│ ┌──────────┬──────────────────┬──────────┐ │
│ │ Type │ Task No. │ Project │ │
│ ├──────────┼──────────────────┼──────────┤ │
│ │ PR │ REG-202602-0001 │ ABC │ │
│ │ JSA │ JSA-202602-0002 │ ABC │ │
│ └──────────┴──────────────────┴──────────┘ │
│ │
│ 4. Print Preview (Header) │
│ ┌────────────────────────────────────────┐ │
│ │ Task No.: REG-... │ │
│ │ [Form Title] │ │
│ └────────────────────────────────────────┘ │
│ │
│ 5. PDF/XLSX Export (Header) │
│ ┌────────────────────────────────────────┐ │
│ │ Task No.: REG-202602-000001 │ │
│ │ [Document content below] │ │
│ └────────────────────────────────────────┘ │
└──────────────────────────────────────────────┘

Searchable in All Tasks

The task number is included in the keyword search in the All Tasks view. Users can type part of a task number (e.g., REG-2026 or 000001) to quickly find tasks.


Settings Configuration

Location: Settings (เครื่องมือ) > Employer Setting (ตั้งค่าบริษัท) > Document Numbering tab (เลขรันงาน)

The settings page has two sections:

Section 1: Format Selection

Radio buttons to choose one of the 6 formats. Each option shows a live preview of what the number will look like.

┌───────────────────────────────────────────────────┐
│ Task Number Format │
│ │
│ o CE Year/Month/Day/Run REG-20260223-0001 │
│ * CE Year/Month/Run REG-202602-000001 │
│ o CE Year/Run REG-2026-00000001 │
│ o BE Year/Month/Day/Run REG-25690223-0001 │
│ o BE Year/Month/Run REG-256902-000001 │
│ o BE Year/Run REG-2569-00000001 │
└───────────────────────────────────────────────────┘

Section 2: Type Prefix Configuration

Editable table where each workflow type's prefix can be customized. The preview column updates in real-time.

┌──────────────────────────────────────────────────┐
│ Type Prefixes │
│ │
│ Workflow Type │ Prefix │ Preview │
│ Project Registration │ [REG ] │ REG-... │
│ Contractor Registration │ [CR ] │ CR-... │
│ Work Permit Request │ [WP ] │ WP-... │
│ Training Enrollment │ [TE ] │ TE-... │
│ JSA Preparation │ [JSA ] │ JSA-... │
│ Tool List Preparation │ [TL ] │ TL-... │
│ Contractor Evaluation │ [CE ] │ CE-... │
└──────────────────────────────────────────────────┘

Behavior Rules

ScenarioBehavior
New task createdNumber auto-generated based on current format + prefix
Format changed in settingsOnly affects new tasks; existing numbers are permanent
Prefix changed in settingsOnly affects new tasks; existing numbers unchanged
Task cancelled/closedNumber remains assigned (never recycled)
Existing tasks (before feature)Show dash - or empty (no retroactive numbering)
Concurrent task creationAtomic PostgreSQL UPSERT prevents duplicate numbers

What to Test

#Test CaseExpected Result
1Create a new workflow taskTask number generated and shown in toolbar
2View task in My Tasks listTask number visible on task card
3Search by task number in All TasksTask found by partial number match
4Open print previewTask number shown in header
5Export PDFTask number in document header
6Change numbering format in settingsNew tasks use new format; old tasks unchanged
7Change type prefix in settingsNew tasks use new prefix; old tasks unchanged
8Create 2 tasks of same type quicklySequential numbers (no gaps, no duplicates)
9Verify Buddhist Era formats (4-6)Year shows +543 (e.g., 2569 instead of 2026)
10Existing tasks without numberShows dash or empty gracefully