-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.ts
More file actions
33 lines (28 loc) · 1.11 KB
/
Copy pathtask.ts
File metadata and controls
33 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { TaskPriority, TaskStatus } from '@/types/task';
/**
* Language-neutral domain structure only. Display labels live in the i18n
* catalog (`src/i18n`), keyed by these same status/priority values — so
* translating the UI never touches this file or any component.
*/
/** Status columns on the board, in display order. */
export const BOARD_COLUMN_STATUSES: readonly TaskStatus[] = [
'todo',
'in_progress',
'done',
'archived',
];
/**
* Legal next statuses per current status — mirrors the backend state machine.
* The UI uses this to only offer valid transitions; the backend remains the
* source of truth and still rejects anything illegal.
*/
export const ALLOWED_TRANSITIONS: Record<TaskStatus, TaskStatus[]> = {
todo: ['in_progress', 'archived'],
in_progress: ['todo', 'done', 'archived'],
done: ['archived'],
archived: [],
};
/** Priority values in display order (highest first); labels come from i18n. */
export const PRIORITY_DISPLAY_ORDER: readonly TaskPriority[] = [3, 2, 1];
/** Page size for the board's initial SSR fetch and each "Load more". */
export const BOARD_PAGE_SIZE = 10;