mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
no message
This commit is contained in:
1 parent
06d24746ee
commit
dc2cc57b83
2 files changed
+52
-20
No files matched your search
@@ -10,32 +10,33 @@ class SubTaskResource extends JsonResource
|
|||||||
* Transform the resource into an array.
|
* Transform the resource into an array.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'created_by' => $this->created_by,
|
'type' => $this->type,
|
||||||
'master_task' => $this->mastertask->title,
|
'created_by' => $this->created_by,
|
||||||
|
'master_task' => $this->mastertask->title,
|
||||||
'master_task_description' => $this->mastertask->description,
|
'master_task_description' => $this->mastertask->description,
|
||||||
'master_task_deadline' => $this->mastertask->deadline,
|
'master_task_deadline' => $this->mastertask->deadline,
|
||||||
'master_task_id' => $this->mastertask->id,
|
'master_task_id' => $this->mastertask->id,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'project_code' => ($this->mastertask->project) ? $this->mastertask->project->code . ' ' . $this->mastertask->project->name : null,
|
'project_code' => ($this->mastertask->project) ? $this->mastertask->project->code . ' ' . $this->mastertask->project->name : null,
|
||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'team_id' => ($this->mastertask->team) ? $this->mastertask->team->id : null,
|
'team_id' => ($this->mastertask->team) ? $this->mastertask->team->id : null,
|
||||||
'team' => $this->mastertask->team,
|
'team' => $this->mastertask->team,
|
||||||
'employee_id' => $this->user->id,
|
'employee_id' => $this->user->id,
|
||||||
'duration' => $this->estimated_time,
|
'duration' => $this->estimated_time,
|
||||||
'spent_time' => $this->tracked_time,
|
'spent_time' => $this->tracked_time,
|
||||||
'deadline' => $this->deadline,
|
'deadline' => $this->deadline,
|
||||||
'is_finished' => $this->is_finished,
|
'is_finished' => $this->is_finished,
|
||||||
'timeblocks' => TimeblockResource::collection($this->timeblocks),
|
'timeblocks' => TimeblockResource::collection($this->timeblocks),
|
||||||
'timesheets' => TimesheetResource::collection($this->timesheets),
|
'timesheets' => TimesheetResource::collection($this->timesheets),
|
||||||
'files' => AttachmentResource::collection($this->attachments->isNotEmpty() ? $this->attachments : $this->mastertask->attachments),
|
'files' => AttachmentResource::collection($this->attachments->isNotEmpty() ? $this->attachments : $this->mastertask->attachments),
|
||||||
'color' => $this->mastertask->color,
|
'color' => $this->mastertask->color,
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('sub_tasks', function (Blueprint $table) {
|
||||||
|
$table->string('type')->after('master_task_id')->default('sub_task');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('subtasks', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in new issue
Block a user