Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

07 — Component Library (Scheduler Module)

Module-specific components for the Scheduled Jobs console, mapped to authoritative components in 00-shared/03. Every component here is (proposed) (console-only); none exist in the Flutter app today.


C1 — JobStatusBadge

FieldDetail
BaseAppBadge (00-shared/03)
Variantsok (green, check icon) · running (blue, pulse) · failed (red, alert icon) · missed (amber, clock icon — no run in expected window) · unknown (grey, "—")
a11yicon + text always (never color alone); tooltip with last run timestamp
Data(proposed) from run-history endpoint; today undeterminable from GET /scheduler (scheduler.service.ts:152-186 returns no status)

C2 — CronChip

FieldDetail
BaseAppChips (00-shared/03)
Contentmonospace pattern + humanized summary ("daily 06:00 UTC"), tooltip with full meaning
Humanizer map0 6 * * * → daily 06:00 · 0 9 * * * → daily 09:00 · */5 * * * * → every 5 min · */15 * * * * → every 15 min · */1 * * * * → every minute · 0 2 * * 0 → Sunday 02:00 · 0 7 * * * → daily 07:00 · 0 8 * * * → daily 08:00 · 0 2 * * * → daily 02:00 (all UTC, scheduler.service.ts:48-119)
Invalidred border + tooltip "Invalid cron pattern (5 fields required)" (create-schedule.dto.ts:22)

C3 — QueueChip

FieldDetail
BaseAppChips
Contentqueue name (e.g. report-generate); color-coded per family: delivery (emails, push, whatsapp, in-app), processing (attendance-process, biometric-sync, invoice-generate, payment-reminder, report-generate), system (audit-write, tenant-purge, cache-rebuild, webhook-deliver, admission-reminder, admission-expiry) — names from queue.constants.ts:1-17

C4 — ScheduleSummaryStrip

FieldDetail
BaseAppCard (00-shared/03)
Contentcounts: default (10 — scheduler.service.ts:48-119), custom, dead letters (→ S6). Tap navigates to filtered list

C5 — RunHistoryRow

FieldDetail
BaseAppListTile (00-shared/03)
ContentstartedAt (relative + absolute), JobStatusBadge, duration ms, error excerpt (2 lines, error color, monospace)
Data(proposed); fields from BullMQ job state (attemptsMade, finishedOn, failedReason)

C6 — JobDefinitionCard

FieldDetail
BaseAppCard
Contenttrigger payload envelope spec {eventType, tenantId:'system', correlationId, actorId:'scheduler'} (scheduler.service.ts:136-142); retention removeOnComplete {age:3600, count:100}, removeOnFail {age: 7d} (scheduler.service.ts:145-146); retry attempts: 3, exponential 5 s (bullmq.module.ts:60-65)
UseS2 definition block — read-only, for operators/on-call

C7 — DLQCard

FieldDetail
BaseAppCard
ContentoriginalQueue, originalJobName, originalJobId, failedReason (prominent), attemptsMade, failedAt, expandable JSON data (dlq.setup.ts:12-21)
ActionsReplay (AppButton), Delete (opens AppDialog confirm)

C8 — PresetCronChips (form helper)

FieldDetail
BaseAppChips selectable
Content8 presets matching the defaults (scheduler.service.ts:48-119) — one-tap fill for S3's pattern field; free entry still allowed

Composition map

ScreenComponents
S1 Jobs listC4 summary, AppListTile + C1 + C2 + C3, AppMenu, AppFAB, AppSkeleton, AppEmptyState, AppOfflineBanner
S2 DetailC6 definition, C5 history rows, C1/C2/C3 header
S3 CreateC8 presets, AppTextField, AppDropdown, AppBottomSheet, AppSnackbar
S4 Logsmonospace log tiles, AppSwitch tail-live, level chips
S5 TriggerAppDialog confirm
S6 DLQC7 cards, AppDialog, AppEmptyState

Reuse rules

  • No new design tokens: colors/spacing/type per 00-shared/02.
  • All components stateless + controlled (state lives in Blocs, 13_State_Management).
  • Everything (proposed) until the console build phase starts.