Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Apr 29, 2024
1 parent 15b1d08 commit b338db3
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 11 deletions.
17 changes: 15 additions & 2 deletions src/Http/Requests/Backlog/CreateRequest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Http\Requests\Backlog;

use Playground\Matrix\Resource\Http\Requests\FormRequest;
Expand All @@ -23,6 +23,7 @@ class CreateRequest extends FormRequest
'board_id' => ['nullable', 'uuid'],
'epic_id' => ['nullable', 'uuid'],
'flow_id' => ['nullable', 'uuid'],
'matrix_id' => ['nullable', 'uuid'],
'milestone_id' => ['nullable', 'uuid'],
'note_id' => ['nullable', 'uuid'],
'project_id' => ['nullable', 'uuid'],
Expand Down Expand Up @@ -59,10 +60,22 @@ class CreateRequest extends FormRequest
'status' => ['integer'],
'rank' => ['integer'],
'size' => ['integer'],
'matrix' => ['array'],
'x' => ['integer'],
'y' => ['integer'],
'z' => ['integer'],
'r' => ['float'],
'theta' => ['float'],
'rho' => ['float'],
'phi' => ['float'],
'elevation' => ['float'],
'latitude' => ['float'],
'longitude' => ['float'],
'active' => ['boolean'],
'canceled' => ['boolean'],
'closed' => ['boolean'],
'completed' => ['boolean'],
'cron' => ['boolean'],
'duplicate' => ['boolean'],
'fixed' => ['boolean'],
'flagged' => ['boolean'],
Expand Down
39 changes: 32 additions & 7 deletions src/Http/Requests/Backlog/IndexRequest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Http\Requests\Backlog;

use Playground\Http\Requests\IndexRequest as BaseIndexRequest;
Expand All @@ -14,7 +14,7 @@
class IndexRequest extends BaseIndexRequest
{
/**
* @var array<string, mixed>
* @var array<string, array<string, mixed>>
*/
protected array $paginationDates = [
'created_at' => ['column' => 'created_at', 'label' => 'Created At', 'nullable' => true],
Expand All @@ -37,13 +37,14 @@ class IndexRequest extends BaseIndexRequest
];

/**
* @var array<string, mixed>
* @var array<string, array<string, mixed>>
*/
protected array $paginationFlags = [
'active' => ['column' => 'active', 'label' => 'Active', 'icon' => 'fa-solid fa-person-running'],
'canceled' => ['column' => 'canceled', 'label' => 'Canceled', 'icon' => 'fa-solid fa-ban text-warning'],
'closed' => ['column' => 'closed', 'label' => 'Closed', 'icon' => 'fa-solid fa-xmark'],
'completed' => ['column' => 'completed', 'label' => 'Completed', 'icon' => 'fa-solid fa-check'],
'cron' => ['column' => 'cron', 'label' => 'Cron', 'icon' => 'fa-regular fa-clock'],
'duplicate' => ['column' => 'duplicate', 'label' => 'Duplicate', 'icon' => 'fa-solid fa-clone'],
'fixed' => ['column' => 'fixed', 'label' => 'Fixed', 'icon' => 'fa-solid fa-wrench'],
'flagged' => ['column' => 'flagged', 'label' => 'Flagged', 'icon' => 'fa-solid fa-flag'],
Expand All @@ -61,7 +62,7 @@ class IndexRequest extends BaseIndexRequest
];

/**
* @var array<string, mixed>
* @var array<string, array<string, mixed>>
*/
protected array $paginationIds = [
'id' => ['column' => 'id', 'label' => 'Id', 'type' => 'uuid', 'nullable' => false],
Expand All @@ -73,6 +74,7 @@ class IndexRequest extends BaseIndexRequest
'board_id' => ['column' => 'board_id', 'label' => 'Board Id', 'type' => 'uuid', 'nullable' => true],
'epic_id' => ['column' => 'epic_id', 'label' => 'Epic Id', 'type' => 'uuid', 'nullable' => true],
'flow_id' => ['column' => 'flow_id', 'label' => 'Flow Id', 'type' => 'uuid', 'nullable' => true],
'matrix_id' => ['column' => 'matrix_id', 'label' => 'Matrix id', 'type' => 'uuid', 'nullable' => true],
'milestone_id' => ['column' => 'milestone_id', 'label' => 'Milestone Id', 'type' => 'uuid', 'nullable' => true],
'note_id' => ['column' => 'note_id', 'label' => 'Note Id', 'type' => 'uuid', 'nullable' => true],
'project_id' => ['column' => 'project_id', 'label' => 'Project Id', 'type' => 'uuid', 'nullable' => true],
Expand All @@ -87,7 +89,7 @@ class IndexRequest extends BaseIndexRequest
];

/**
* @var array<string, mixed>
* @var array<string, array<string, mixed>>
*/
protected array $paginationColumns = [
'label' => ['column' => 'label', 'label' => 'Label', 'type' => 'string', 'nullable' => false],
Expand All @@ -102,7 +104,7 @@ class IndexRequest extends BaseIndexRequest
];

/**
* @var array<string, mixed>
* @var array<string, array<string, mixed>>
*/
protected array $sortable = [
'id' => ['column' => 'id', 'label' => 'Id', 'type' => 'string'],
Expand All @@ -114,6 +116,7 @@ class IndexRequest extends BaseIndexRequest
'board_id' => ['column' => 'board_id', 'label' => 'Board Id', 'type' => 'string'],
'epic_id' => ['column' => 'epic_id', 'label' => 'Epic Id', 'type' => 'string'],
'flow_id' => ['column' => 'flow_id', 'label' => 'Flow Id', 'type' => 'string'],
'matrix_id' => ['column' => 'matrix_id', 'label' => 'Matrix id', 'type' => 'string'],
'milestone_id' => ['column' => 'milestone_id', 'label' => 'Milestone Id', 'type' => 'string'],
'note_id' => ['column' => 'note_id', 'label' => 'Note Id', 'type' => 'string'],
'project_id' => ['column' => 'project_id', 'label' => 'Project Id', 'type' => 'string'],
Expand Down Expand Up @@ -153,10 +156,22 @@ class IndexRequest extends BaseIndexRequest
'status' => ['column' => 'status', 'label' => 'Status', 'type' => 'integer'],
'rank' => ['column' => 'rank', 'label' => 'Rank', 'type' => 'integer'],
'size' => ['column' => 'size', 'label' => 'Size', 'type' => 'integer'],
'matrix' => ['column' => 'matrix', 'label' => 'Matrix', 'type' => 'JSON_OBJECT'],
'x' => ['column' => 'x', 'label' => 'X', 'type' => 'integer'],
'y' => ['column' => 'y', 'label' => 'Y', 'type' => 'integer'],
'z' => ['column' => 'z', 'label' => 'Z', 'type' => 'integer'],
'r' => ['column' => 'r', 'label' => 'R', 'type' => 'float'],
'theta' => ['column' => 'theta', 'label' => 'Theta', 'type' => 'float'],
'rho' => ['column' => 'rho', 'label' => 'Rho', 'type' => 'float'],
'phi' => ['column' => 'phi', 'label' => 'Phi', 'type' => 'float'],
'elevation' => ['column' => 'elevation', 'label' => 'Elevation', 'type' => 'float'],
'latitude' => ['column' => 'latitude', 'label' => 'Latitude', 'type' => 'float'],
'longitude' => ['column' => 'longitude', 'label' => 'Longitude', 'type' => 'float'],
'active' => ['column' => 'active', 'label' => 'Active', 'type' => 'boolean'],
'canceled' => ['column' => 'canceled', 'label' => 'Canceled', 'type' => 'boolean'],
'closed' => ['column' => 'closed', 'label' => 'Closed', 'type' => 'boolean'],
'completed' => ['column' => 'completed', 'label' => 'Completed', 'type' => 'boolean'],
'cron' => ['column' => 'cron', 'label' => 'Cron', 'type' => 'boolean'],
'duplicate' => ['column' => 'duplicate', 'label' => 'Duplicate', 'type' => 'boolean'],
'fixed' => ['column' => 'fixed', 'label' => 'Fixed', 'type' => 'boolean'],
'flagged' => ['column' => 'flagged', 'label' => 'Flagged', 'type' => 'boolean'],
Expand All @@ -183,5 +198,15 @@ class IndexRequest extends BaseIndexRequest
'icon' => ['column' => 'icon', 'label' => 'Icon', 'type' => 'string'],
'image' => ['column' => 'image', 'label' => 'Image', 'type' => 'string'],
'avatar' => ['column' => 'avatar', 'label' => 'Avatar', 'type' => 'string'],
'ui' => ['column' => 'ui', 'label' => 'Ui', 'type' => 'JSON_OBJECT'],
'assets' => ['column' => 'assets', 'label' => 'Assets', 'type' => 'JSON_OBJECT'],
'backlog' => ['column' => 'backlog', 'label' => 'Backlog', 'type' => 'JSON_OBJECT'],
'board' => ['column' => 'board', 'label' => 'Board', 'type' => 'JSON_OBJECT'],
'flow' => ['column' => 'flow', 'label' => 'Flow', 'type' => 'JSON_OBJECT'],
'meta' => ['column' => 'meta', 'label' => 'Meta', 'type' => 'JSON_OBJECT'],
'notes' => ['column' => 'notes', 'label' => 'Notes', 'type' => 'JSON_ARRAY'],
'options' => ['column' => 'options', 'label' => 'Options', 'type' => 'JSON_OBJECT'],
'roadmap' => ['column' => 'roadmap', 'label' => 'Roadmap', 'type' => 'JSON_OBJECT'],
'sources' => ['column' => 'sources', 'label' => 'Sources', 'type' => 'JSON_OBJECT'],
];
}
3 changes: 3 additions & 0 deletions src/Http/Resources/Backlog.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Http\Resources;
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Resources/BacklogCollection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Http\Resources;
Expand Down
4 changes: 2 additions & 2 deletions src/Policies/BacklogPolicy.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);
/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Policies;

use Playground\Auth\Policies\ModelPolicy;
Expand Down

0 comments on commit b338db3

Please sign in to comment.