generated from wayofdev/spiral-starter-tpl
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
644 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
tools: phive | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
tools: phive | ||
|
@@ -109,7 +109,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
tools: phive | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, opcache, pcntl, posix, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, opcache, pcntl, posix, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
|
||
|
@@ -89,7 +89,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, pdo_mysql, curl, fileinfo, opcache, pcntl, posix, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, pdo_mysql, curl, fileinfo, opcache, pcntl, posix, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: xdebug | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ jobs: | |
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, pdo_mysql, pdo_sqlite, curl, fileinfo, opcache, pcntl, posix, sockets, decimal | ||
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, pdo_mysql, pdo_sqlite, curl, fileinfo, opcache, pcntl, posix, sockets, decimal, grpc | ||
ini-values: error_reporting=E_ALL | ||
coverage: xdebug | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Application\Transfer\DTO; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
class TransferDetails | ||
{ | ||
#[OAT\Property(format: 'string', example: '10ab5df0-693a-4cd8-8ed5-1e702947d4d0')] | ||
public string $transferId; | ||
|
||
#[OAT\Property(format: 'string', example: '10ab5df0-693a-4cd8-8ed5-1e702947d4d0')] | ||
public string $fromUserId; | ||
|
||
#[OAT\Property(format: 'string', example: '10ab5df0-693a-4cd8-8ed5-1e702947d4d0')] | ||
public string $toUserId; | ||
|
||
#[OAT\Property(format: 'string', example: 'https://wayof.dev')] | ||
public string $fromDomain; | ||
|
||
#[OAT\Property(format: 'string', example: 'https://your-dev.way')] | ||
public string $toDomain; | ||
|
||
public function __construct( | ||
string $transferId, | ||
string $fromUserId, | ||
string $toUserId, | ||
string $fromDomain, | ||
string $toDomain, | ||
) { | ||
$this->transferId = $transferId; | ||
$this->fromUserId = $fromUserId; | ||
$this->toUserId = $toUserId; | ||
$this->fromDomain = $fromDomain; | ||
$this->toDomain = $toDomain; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bridge\Spiral\Console; | ||
|
||
use Application\Transfer\DTO\TransferDetails; | ||
use Infrastructure\Temporal\Transfer\Workflows\TransferWebsiteWorkflowStub; | ||
use Spiral\Console\Attribute\AsCommand; | ||
use Spiral\Console\Command; | ||
use Temporal\Client\WorkflowClientInterface; | ||
|
||
/** | ||
* @psalm-suppress PropertyNotSetInConstructor | ||
*/ | ||
#[AsCommand(name: 'website:transfer', description: 'Transfer website from source to destination')] | ||
class TransferCommand extends Command | ||
{ | ||
public function __invoke(WorkflowClientInterface $workflow): int | ||
{ | ||
$transferDetails = new TransferDetails( | ||
transferId: '10ab5df0-693a-4cd8-8ed5-1e702947d4d0', | ||
fromUserId: '10ab5df0-693a-4cd8-8ed5-1e702947d4d0', | ||
toUserId: '10ab5df0-693a-4cd8-8ed5-1e702947d4d0', | ||
fromDomain: 'https://wayof.dev', | ||
toDomain: 'https://your-dev.way' | ||
); | ||
|
||
TransferWebsiteWorkflowStub::handle($workflow, $transferDetails); | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/Domain/Transfer/Contracts/TransferWebsiteWorkflowInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Domain\Transfer\Contracts; | ||
|
||
use Application\Transfer\DTO\TransferDetails; | ||
use Temporal\Workflow\WorkflowInterface; | ||
use Temporal\Workflow\WorkflowMethod; | ||
|
||
#[WorkflowInterface] | ||
interface TransferWebsiteWorkflowInterface | ||
{ | ||
#[WorkflowMethod(name: 'website.transfer')] | ||
public function handle(TransferDetails $transferDetails); | ||
Check failure on line 15 in app/src/Domain/Transfer/Contracts/TransferWebsiteWorkflowInterface.php GitHub Actions / deptrac (ubuntu-latest, 8.3, locked)
Check failure on line 15 in app/src/Domain/Transfer/Contracts/TransferWebsiteWorkflowInterface.php GitHub Actions / deptrac (ubuntu-latest, 8.3, locked)
|
||
} |
22 changes: 22 additions & 0 deletions
22
app/src/Infrastructure/Temporal/Transfer/Activities/Destination/AllocateSpaceActivity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Infrastructure\Temporal\Transfer\Activities\Destination; | ||
|
||
use Ramsey\Uuid\Uuid; | ||
use Temporal\Activity\ActivityInterface; | ||
|
||
use function sleep; | ||
|
||
#[ActivityInterface(prefix: 'website.transfer.destination.')] | ||
final readonly class AllocateSpaceActivity | ||
{ | ||
public function handle(): string | ||
{ | ||
// Simulate long-running Amazon Block Storage allocation | ||
sleep(5); | ||
|
||
return Uuid::uuid7()->toString(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
app/src/Infrastructure/Temporal/Transfer/Activities/Destination/AttachDomainActivity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Infrastructure\Temporal\Transfer\Activities\Destination; | ||
|
||
use Ramsey\Uuid\Uuid; | ||
use Temporal\Activity\ActivityInterface; | ||
|
||
use function sleep; | ||
|
||
#[ActivityInterface(prefix: 'website.transfer.destination.')] | ||
final readonly class AttachDomainActivity | ||
{ | ||
public function handle(): string | ||
{ | ||
// Attach domain in destination | ||
sleep(5); | ||
|
||
return Uuid::uuid7()->toString(); | ||
} | ||
} |
Oops, something went wrong.