*/ public function statuses(): array { return match ($this) { self::Quotes => [JobStatus::Prospect, JobStatus::Tentative, JobStatus::QuoteRequest], self::InProduction, self::InProductionUrgent => [JobStatus::InProduction], default => [JobStatus::from($this->value)], }; } /** * The status a card gets when it is dropped into this column from * another one. */ public function targetStatus(): JobStatus { return match ($this) { self::Quotes => JobStatus::QuoteRequest, self::InProduction, self::InProductionUrgent => JobStatus::InProduction, default => JobStatus::from($this->value), }; } public function isOngoing(): bool { return $this === self::Ongoing; } public function isUrgentLane(): bool { return $this === self::InProductionUrgent; } public function isNormalProductionLane(): bool { return $this === self::InProduction; } /** * Whether a promoted (pinned) task card may be in or dropped into this * column: its column follows the task's status. */ public function acceptsTasks(): bool { return in_array($this, [self::Order, self::InProduction, self::Done], true); } /** * The column header colour before the user picks one (the design's * default palette). */ public function defaultColor(): string { return match ($this) { self::Quotes, self::Tentative => '#4338ca', self::Prospect => '#374151', self::QuoteRequest => '#6d28d9', self::Order => '#23476a', self::InProduction, self::InProductionUrgent => '#1d4ed8', self::OnHold => '#78350f', self::Done => '#14532d', self::Invoiced => '#0f5c63', self::Billed => '#065f46', self::Ongoing => '#3b2d5e', }; } /** * A Heroicon name for the column header. */ public function icon(): string { return match ($this) { self::Quotes, self::QuoteRequest => 'document-text', self::Prospect => 'light-bulb', self::Tentative => 'pencil-square', self::Order => 'inbox-stack', self::InProduction => 'play-circle', self::InProductionUrgent => 'fire', self::OnHold => 'clock', self::Done => 'check-circle', self::Invoiced => 'credit-card', self::Billed => 'check-badge', self::Ongoing => 'arrow-path', }; } /** * The column a job card stands in. A sales status is in "Tarjoukset" in * views that gather them, in its own column otherwise. */ public static function forJob(JobStatus $status, Priority $priority, UrgentThreshold $threshold, bool $gatherQuotes): ?self { return match ($status) { JobStatus::Prospect, JobStatus::Tentative, JobStatus::QuoteRequest => $gatherQuotes ? self::Quotes : self::from($status->value), JobStatus::InProduction => $threshold->includes($priority) ? self::InProductionUrgent : self::InProduction, JobStatus::Archived => null, default => self::from($status->value), }; } /** * The column a promoted task card stands in, by the task's status. */ public static function forTask(TaskStatus $status): self { return match ($status) { TaskStatus::Waiting => self::Order, TaskStatus::InProgress, TaskStatus::InReview => self::InProduction, TaskStatus::Done => self::Done, }; } /** * The task status a promoted task card gets when dropped here. */ public function taskStatus(): ?TaskStatus { return match ($this) { self::Order => TaskStatus::Waiting, self::InProduction => TaskStatus::InProgress, self::Done => TaskStatus::Done, default => null, }; } }