Build package / xml-lint (push) Successful in 33s
Build package / php-lint (8.5) (push) Successful in 1m48s
Build package / php-lint (8.4) (push) Successful in 1m50s
Build package / unit-tests (push) Successful in 1m52s
Build package / package (push) Successful in 1m38s
Each workflow now has a notify channel (mail, notification or both) next to its recipient mode. Notifications go out per card through OCP\Notification\IManager, so they show up in the bell and as push on the mobile and desktop clients. Without the notifications app nothing is sent. The one-off "workflow disabled" notice is sent as a notification as well. Existing workflows keep mail (migration Version1004). Bumps to 35.3.0 so the migration runs.
69 lines
2.1 KiB
PHP
69 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\WorkflowDeckAutomation\Db;
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
use OCP\DB\Types;
|
|
|
|
/**
|
|
* @method string getUserId()
|
|
* @method void setUserId(string $userId)
|
|
* @method string getTitle()
|
|
* @method void setTitle(string $title)
|
|
* @method int getBoardId()
|
|
* @method void setBoardId(int $boardId)
|
|
* @method int getSourceStackId()
|
|
* @method void setSourceStackId(int $sourceStackId)
|
|
* @method int getTargetStackId()
|
|
* @method void setTargetStackId(int $targetStackId)
|
|
* @method string getNotifyMode()
|
|
* @method void setNotifyMode(string $notifyMode)
|
|
* @method string getNotifyChannel()
|
|
* @method void setNotifyChannel(string $notifyChannel)
|
|
* @method bool getEnabled()
|
|
* @method void setEnabled(bool $enabled)
|
|
* @method \DateTime|null getLastRun()
|
|
* @method void setLastRun(?\DateTime $lastRun)
|
|
*/
|
|
class Workflow extends Entity implements \JsonSerializable {
|
|
protected $userId;
|
|
protected $title;
|
|
protected $boardId;
|
|
protected $sourceStackId;
|
|
protected $targetStackId;
|
|
protected $notifyMode;
|
|
protected $notifyChannel;
|
|
protected $enabled;
|
|
protected $lastRun;
|
|
|
|
public function __construct() {
|
|
$this->addType('id', Types::INTEGER);
|
|
$this->addType('userId', Types::STRING);
|
|
$this->addType('title', Types::STRING);
|
|
$this->addType('boardId', Types::INTEGER);
|
|
$this->addType('sourceStackId', Types::INTEGER);
|
|
$this->addType('targetStackId', Types::INTEGER);
|
|
$this->addType('notifyMode', Types::STRING);
|
|
$this->addType('notifyChannel', Types::STRING);
|
|
$this->addType('enabled', Types::BOOLEAN);
|
|
$this->addType('lastRun', Types::DATETIME);
|
|
}
|
|
|
|
public function jsonSerialize(): array {
|
|
return [
|
|
'id' => $this->getId(),
|
|
'userId' => $this->getUserId(),
|
|
'title' => $this->getTitle(),
|
|
'boardId' => $this->getBoardId(),
|
|
'sourceStackId' => $this->getSourceStackId(),
|
|
'targetStackId' => $this->getTargetStackId(),
|
|
'notifyMode' => (string)$this->getNotifyMode(),
|
|
'notifyChannel' => (string)$this->getNotifyChannel(),
|
|
'enabled' => (bool)$this->getEnabled(),
|
|
'lastRun' => $this->getLastRun()?->format(\DateTimeInterface::ATOM),
|
|
];
|
|
}
|
|
}
|