-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
29 changed files
with
1,476 additions
and
116 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
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,11 @@ | ||
name: PHP Linting | ||
on: push | ||
jobs: | ||
pint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: "laravel-pint" | ||
uses: aglipanci/[email protected] | ||
with: | ||
configPath: "pint.json" |
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,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Database\Factories\ClientFactory; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $name | ||
* @property string $organization_id | ||
* @property-read Team $organization | ||
* | ||
* @method static ClientFactory factory() | ||
*/ | ||
class Client extends Model | ||
{ | ||
use HasFactory; | ||
use HasUuids; | ||
|
||
/** | ||
* The attributes that should be cast. | ||
* | ||
* @var array<string, string> | ||
*/ | ||
protected $casts = [ | ||
'name' => 'string', | ||
]; | ||
|
||
/** | ||
* @return BelongsTo<Team, Client> | ||
*/ | ||
public function organization(): BelongsTo | ||
{ | ||
return $this->belongsTo(Team::class, 'organization_id'); | ||
} | ||
} |
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,63 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Database\Factories\ProjectFactory; | ||
use Illuminate\Database\Eloquent\Collection; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
use Illuminate\Database\Eloquent\Relations\HasMany; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $name | ||
* @property string $organization_id | ||
* @property string $client_id | ||
* @property-read Team $organization | ||
* @property-read Client|null $client | ||
* @property-read Collection<Task> $tasks | ||
* | ||
* @method static ProjectFactory factory() | ||
*/ | ||
class Project extends Model | ||
{ | ||
use HasFactory; | ||
use HasUuids; | ||
|
||
/** | ||
* The attributes that should be cast. | ||
* | ||
* @var array<string, string> | ||
*/ | ||
protected $casts = [ | ||
'name' => 'string', | ||
]; | ||
|
||
/** | ||
* @return BelongsTo<Team, Project> | ||
*/ | ||
public function organization(): BelongsTo | ||
{ | ||
return $this->belongsTo(Team::class, 'organization_id'); | ||
} | ||
|
||
/** | ||
* @return BelongsTo<Client, Project> | ||
*/ | ||
public function client(): BelongsTo | ||
{ | ||
return $this->belongsTo(Client::class, 'client_id'); | ||
} | ||
|
||
/** | ||
* @return HasMany<Task> | ||
*/ | ||
public function tasks(): HasMany | ||
{ | ||
return $this->hasMany(Task::class); | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Database\Factories\TagFactory; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $name | ||
* @property string $organization_id | ||
* @property-read Team $organization | ||
* | ||
* @method static TagFactory factory() | ||
*/ | ||
class Tag extends Model | ||
{ | ||
use HasFactory; | ||
use HasUuids; | ||
|
||
/** | ||
* The attributes that should be cast. | ||
* | ||
* @var array<string, string> | ||
*/ | ||
protected $casts = [ | ||
'name' => 'string', | ||
]; | ||
|
||
/** | ||
* @return BelongsTo<Team, Tag> | ||
*/ | ||
public function organization(): BelongsTo | ||
{ | ||
return $this->belongsTo(Team::class, 'organization_id'); | ||
} | ||
} |
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,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Database\Factories\TaskFactory; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $name | ||
* @property string $project_id | ||
* @property string $organization_id | ||
* @property-read Project $project | ||
* @property-read Team $organization | ||
* | ||
* @method static TaskFactory factory() | ||
*/ | ||
class Task extends Model | ||
{ | ||
use HasFactory; | ||
use HasUuids; | ||
|
||
/** | ||
* The attributes that should be cast. | ||
* | ||
* @var array<string, string> | ||
*/ | ||
protected $casts = [ | ||
'name' => 'string', | ||
]; | ||
|
||
/** | ||
* @return BelongsTo<Project, Task> | ||
*/ | ||
public function project(): BelongsTo | ||
{ | ||
return $this->belongsTo(Project::class); | ||
} | ||
|
||
/** | ||
* @return BelongsTo<Team, Task> | ||
*/ | ||
public function organization(): BelongsTo | ||
{ | ||
return $this->belongsTo(Team::class, 'organization_id'); | ||
} | ||
} |
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,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Database\Factories\TimeEntryFactory; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
use Illuminate\Support\Carbon; | ||
|
||
/** | ||
* @property string $id | ||
* @property string $description | ||
* @property Carbon $start | ||
* @property Carbon|null $end | ||
* @property bool $billable | ||
* @property array $tags | ||
* @property-read User $user | ||
* @property-read Team $organization | ||
* @property-read Project|null $project | ||
* @property-read Task|null $task | ||
* | ||
* @method static TimeEntryFactory factory() | ||
*/ | ||
class TimeEntry extends Model | ||
{ | ||
use HasFactory; | ||
use HasUuids; | ||
|
||
/** | ||
* The attributes that should be cast. | ||
* | ||
* @var array<string, string> | ||
*/ | ||
protected $casts = [ | ||
'description' => 'string', | ||
'start' => 'datetime', | ||
'end' => 'datetime', | ||
'billable' => 'bool', | ||
'tags' => 'array', | ||
]; | ||
|
||
/** | ||
* @return BelongsTo<User, TimeEntry> | ||
*/ | ||
public function user(): BelongsTo | ||
{ | ||
return $this->belongsTo(User::class, 'user_id'); | ||
} | ||
|
||
/** | ||
* @return BelongsTo<Team, TimeEntry> | ||
*/ | ||
public function organization(): BelongsTo | ||
{ | ||
return $this->belongsTo(Team::class, 'organization_id'); | ||
} | ||
|
||
/** | ||
* @return BelongsTo<Project, TimeEntry> | ||
*/ | ||
public function project(): BelongsTo | ||
{ | ||
return $this->belongsTo(Project::class, 'project_id'); | ||
} | ||
|
||
/** | ||
* @return BelongsTo<Task, TimeEntry> | ||
*/ | ||
public function task(): BelongsTo | ||
{ | ||
return $this->belongsTo(Task::class, 'task_id'); | ||
} | ||
} |
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
Oops, something went wrong.