status->equals(TicketStatus::production()); } /** * Ticket is not archived * * @param Ticket $ticket * @return boolean */ protected static function ticketIsNotArchived(Ticket $ticket): bool { return !$ticket->status->equals(TicketStatus::archived()); } /** * Ticket has brand which has at least one account * * @param Ticket $ticket * @return boolean */ protected static function ticketsBrandHasAnAccount(Ticket $ticket): bool { /** @var \App\Models\Brand|null */ if (!($brand = $ticket->site->brand)) { return false; } return (bool)$brand->accounts()->count(); } /** * Ticket does already have an estimation * * @param Ticket $ticket * @return boolean */ protected static function ticketDoesHaveEstimation(Ticket $ticket): bool { return $ticket->estimation()->exists(); } /** * Ticket does not already have an estimation * * @param Ticket $ticket * @return boolean */ protected static function ticketDoesntHaveEstimation(Ticket $ticket): bool { return !$ticket->estimation()->exists(); } /** * Ticket is not internal * * @param Ticket $ticket * @return boolean */ protected static function ticketIsNotInternal(Ticket $ticket): bool { return !(bool)$ticket->is_internal; } }