diff --git a/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php b/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php index 873ef8c..f9e98bc 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_backlogs_table.php @@ -32,6 +32,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_boards_table.php b/database/migrations/2020_01_02_100001_create_matrix_boards_table.php index 0fcc963..a3c3c17 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_boards_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_boards_table.php @@ -32,6 +32,7 @@ public function up(): void $table->uuid('backlog_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_epics_table.php b/database/migrations/2020_01_02_100001_create_matrix_epics_table.php index 7ad4336..f250f19 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_epics_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_epics_table.php @@ -32,6 +32,7 @@ public function up(): void $table->uuid('backlog_id')->nullable()->index(); $table->uuid('board_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_flows_table.php b/database/migrations/2020_01_02_100001_create_matrix_flows_table.php index 00ac43d..19642fa 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_flows_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_flows_table.php @@ -29,6 +29,7 @@ public function up(): void $table->uuid('owned_by_id')->nullable()->index(); $table->uuid('parent_id')->nullable()->index(); $table->string('flow_type')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('tag_id')->nullable()->index(); $table->uuid('team_id')->nullable()->index(); @@ -73,7 +74,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_matrices_table.php b/database/migrations/2020_01_02_100001_create_matrix_matrices_table.php index e0c1a27..a61f31d 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_matrices_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_matrices_table.php @@ -27,6 +27,7 @@ public function up(): void $table->uuid('created_by_id')->nullable()->index(); $table->uuid('modified_by_id')->nullable()->index(); $table->uuid('owned_by_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('parent_id')->nullable()->index(); $table->string('matrix_type')->nullable()->index(); @@ -64,7 +65,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_milestones_table.php b/database/migrations/2020_01_02_100001_create_matrix_milestones_table.php index ea85e7d..f7542fa 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_milestones_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_milestones_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); $table->uuid('release_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_notes_table.php b/database/migrations/2020_01_02_100001_create_matrix_notes_table.php index 7cc6f0a..a560643 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_notes_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_notes_table.php @@ -29,6 +29,7 @@ public function up(): void $table->uuid('owned_by_id')->nullable()->index(); $table->uuid('parent_id')->nullable()->index(); $table->string('note_type')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); // Dates @@ -70,7 +71,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_projects_table.php b/database/migrations/2020_01_02_100001_create_matrix_projects_table.php index 848712f..8902052 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_projects_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_projects_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('release_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); @@ -128,6 +129,8 @@ public function up(): void $table->string('introduction')->default(''); $table->mediumText('content')->nullable(); $table->mediumText('summary')->nullable(); + $table->string('key', 128)->default(''); + $table->string('code_name', 128)->default(''); // UI diff --git a/database/migrations/2020_01_02_100001_create_matrix_releases_table.php b/database/migrations/2020_01_02_100001_create_matrix_releases_table.php index 0538ff1..c46da27 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_releases_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_releases_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_roadmaps_table.php b/database/migrations/2020_01_02_100001_create_matrix_roadmaps_table.php index e042b61..8d342ba 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_roadmaps_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_roadmaps_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_sources_table.php b/database/migrations/2020_01_02_100001_create_matrix_sources_table.php index 598c74b..1fd31c4 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_sources_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_sources_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_sprints_table.php b/database/migrations/2020_01_02_100001_create_matrix_sprints_table.php index 03e5c42..b48645c 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_sprints_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_sprints_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_tags_table.php b/database/migrations/2020_01_02_100001_create_matrix_tags_table.php index 3072c6f..efd7bd6 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_tags_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_tags_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_teams_table.php b/database/migrations/2020_01_02_100001_create_matrix_teams_table.php index cb16a2c..95682ce 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_teams_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_teams_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/database/migrations/2020_01_02_100001_create_matrix_tickets_table.php b/database/migrations/2020_01_02_100001_create_matrix_tickets_table.php index 24c6b3a..6064f6d 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_tickets_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_tickets_table.php @@ -28,13 +28,14 @@ public function up(): void $table->uuid('modified_by_id')->nullable()->index(); $table->uuid('owned_by_id')->nullable()->index(); $table->uuid('parent_id')->nullable()->index(); - $table->string('ticket_type')->nullable()->index(); $table->uuid('duplicate_id')->nullable()->index(); $table->uuid('backlog_id')->nullable()->index(); $table->uuid('board_id')->nullable()->index(); $table->uuid('completed_by_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); + $table->uuid('fixed_by_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -47,6 +48,7 @@ public function up(): void $table->uuid('team_id')->nullable()->index(); $table->uuid('version_id')->nullable()->index(); $table->uuid('version_fixed_id')->nullable()->index(); + $table->string('ticket_type')->nullable()->index(); // Dates @@ -88,7 +90,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); @@ -143,7 +145,10 @@ public function up(): void $table->string('state')->default(''); $table->string('workflow_type')->default(''); $table->tinyInteger('points')->default(0)->unsigned(); + $table->mediumText('actual')->nullable(); + $table->mediumText('expected')->nullable(); $table->mediumText('story')->nullable(); + $table->mediumText('steps')->nullable(); $table->mediumText('criteria')->nullable(); $table->decimal('reproducibility', 8, 2)->nullable()->default(null); diff --git a/database/migrations/2020_01_02_100001_create_matrix_versions_table.php b/database/migrations/2020_01_02_100001_create_matrix_versions_table.php index 46313cb..03dffcc 100644 --- a/database/migrations/2020_01_02_100001_create_matrix_versions_table.php +++ b/database/migrations/2020_01_02_100001_create_matrix_versions_table.php @@ -33,6 +33,7 @@ public function up(): void $table->uuid('board_id')->nullable()->index(); $table->uuid('epic_id')->nullable()->index(); $table->uuid('flow_id')->nullable()->index(); + $table->uuid('matrix_id')->nullable()->index(); $table->uuid('milestone_id')->nullable()->index(); $table->uuid('note_id')->nullable()->index(); $table->uuid('project_id')->nullable()->index(); @@ -84,7 +85,7 @@ public function up(): void // Matrix - $table->string('matrix')->default(''); + $table->json('matrix')->nullable()->default(new Expression('(JSON_OBJECT())')); $table->bigInteger('x')->nullable(); $table->bigInteger('y')->nullable(); $table->bigInteger('z')->nullable(); diff --git a/src/Models/Ticket.php b/src/Models/Ticket.php index 772a616..9343638 100644 --- a/src/Models/Ticket.php +++ b/src/Models/Ticket.php @@ -11,6 +11,131 @@ /** * \Playground\Matrix\Models\Ticket + * + * @property string $id + * @property ?scalar $created_by_id + * @property ?scalar $modified_by_id + * @property ?scalar $owned_by_id + * @property ?string $parent_id + * @property string $ticket_type + * @property ?string $backlog_id + * @property ?string $board_id + * @property ?string $completed_by_id + * @property ?string $duplicate_id + * @property ?string $epic_id + * @property ?string $fixed_by_id + * @property ?string $flow_id + * @property ?string $matrix_id + * @property ?string $milestone_id + * @property ?string $note_id + * @property ?string $project_id + * @property ?string $release_id + * @property ?string $reported_by_id + * @property ?string $roadmap_id + * @property ?string $source_id + * @property ?string $sprint_id + * @property ?string $tag_id + * @property ?string $team_id + * @property ?string $version_id + * @property ?string $version_fixed_id + * @property ?Carbon $created_at + * @property ?Carbon $updated_at + * @property ?Carbon $deleted_at + * @property ?Carbon $start_at + * @property ?Carbon $planned_start_at + * @property ?Carbon $end_at + * @property ?Carbon $planned_end_at + * @property ?Carbon $canceled_at + * @property ?Carbon $closed_at + * @property ?Carbon $embargo_at + * @property ?Carbon $fixed_at + * @property ?Carbon $postponed_at + * @property ?Carbon $published_at + * @property ?Carbon $released_at + * @property ?Carbon $resumed_at + * @property ?Carbon $resolved_at + * @property ?Carbon $suspended_at + * @property int $gids + * @property int $po + * @property int $pg + * @property int $pw + * @property bool $only_admin + * @property bool $only_user + * @property bool $only_guest + * @property bool $allow_public + * @property int $status + * @property int $rank + * @property int $size + * @property int $revision + * @property array $matrix + * @property ?int $x + * @property ?int $y + * @property ?int $z + * @property ?double $r + * @property ?double $theta + * @property ?double $rho + * @property ?double $phi + * @property ?double $elevation + * @property ?double $latitude + * @property ?double $longitude + * @property bool $active + * @property bool $canceled + * @property bool $closed + * @property bool $completed + * @property bool $duplicate + * @property bool $fixed + * @property bool $flagged + * @property bool $internal + * @property bool $locked + * @property bool $pending + * @property bool $planned + * @property bool $problem + * @property bool $published + * @property bool $released + * @property bool $retired + * @property bool $resolved + * @property bool $suspended + * @property bool $unknown + * @property string $label + * @property string $title + * @property string $byline + * @property string $slug + * @property string $url + * @property string $description + * @property string $introduction + * @property string $content + * @property string $summary + * @property string $key + * @property string $handler + * @property int $code + * @property string $key_code_hash + * @property string $priority + * @property string $severity + * @property string $resolution + * @property string $step + * @property string $state + * @property string $workflow_type + * @property int $points + * @property string $actual + * @property string $expected + * @property string $story + * @property string $steps + * @property string $criteria + * @property ?float $reproducibility + * @property string $icon + * @property string $image + * @property string $avatar + * @property array $ui + * @property array $assets + * @property array $backlog + * @property array $board + * @property array $flow + * @property array $history + * @property array $meta + * @property array $notes + * @property array $options + * @property array $roadmap + * @property array $sources */ class Ticket extends Model { @@ -26,13 +151,14 @@ class Ticket extends Model 'modified_by_id' => null, 'owned_by_id' => null, 'parent_id' => null, - 'ticket_type' => null, 'duplicate_id' => null, 'backlog_id' => null, 'board_id' => null, 'completed_by_id' => null, 'epic_id' => null, + 'fixed_by_id' => null, 'flow_id' => null, + 'matrix_id' => null, 'milestone_id' => null, 'note_id' => null, 'project_id' => null, @@ -45,6 +171,7 @@ class Ticket extends Model 'team_id' => null, 'version_id' => null, 'version_fixed_id' => null, + 'ticket_type' => null, 'created_at' => null, 'updated_at' => null, 'deleted_at' => null, @@ -150,12 +277,14 @@ class Ticket extends Model 'owned_by_id', 'parent_id', 'ticket_type', - 'duplicate_id', 'backlog_id', 'board_id', 'completed_by_id', + 'duplicate_id', 'epic_id', + 'fixed_by_id', 'flow_id', + 'matrix_id', 'milestone_id', 'note_id', 'project_id', @@ -242,6 +371,10 @@ class Ticket extends Model 'state', 'workflow_type', 'points', + 'actual', + 'expected', + 'story', + 'steps', 'story', 'criteria', 'reproducibility', @@ -298,7 +431,7 @@ protected function casts(): array 'status' => 'integer', 'rank' => 'integer', 'size' => 'integer', - 'matrix' => 'string', + 'matrix' => 'array', 'x' => 'integer', 'y' => 'integer', 'z' => 'integer', @@ -420,6 +553,23 @@ public function epic(): HasOne ); } + /** + * The fixed by user of the ticket. + */ + public function fixedBy(): HasOne + { + /** + * @var class-string<\Illuminate\Contracts\Auth\Authenticatable> + */ + $uc = config('auth.providers.users.model', '\\App\\Models\\User'); + + return $this->hasOne( + $uc, + 'id', + 'fixed_by_id' + ); + } + /** * The flow of the ticket. */