-
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.
* Add controllers, migrations,models,repositories and services * Remove missing columns * Repair migration * Repair migration * Repair migration * Repair bug in migration * Remove empty swagger * Change localization swagger * Change namespasec in testcase * Add changes after CR * Repair bug in test. Set specyfic version in swagger * Change value in test-cc github * Add filter to phpunit in cc * Change value in env * Start create api admin * Change method name * Add tests to list * Repair bug in enums * Update test-cc.yml * Add crud to consultation * Remove missing controller * Add swagger and destroy action * Repair tests * Change autorizator in request * Add changes with CR Co-authored-by: Hubert Krzysztofiak <hubert.krzysztofiak@escolasoft.com> Co-authored-by: Mateusz Qunabu <mateusz@qunabu.com>
- Loading branch information
1 parent
bc93ed3
commit 27b5dfe
Showing
38 changed files
with
1,186 additions
and
126 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
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
32 changes: 32 additions & 0 deletions
32
database/migrations/2022_02_07_142406_remove_missing_columns.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,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class RemoveMissingColumns extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('consultations', function (Blueprint $table) { | ||
$table->dropColumn('calendar_url'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('consultations', function (Blueprint $table) { | ||
$table->text('calendar_url')->nullable(); | ||
}); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
database/migrations/2022_02_07_143005_add_columns_date_and_status_to_orders.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,43 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddColumnsDateAndStatusToOrders extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
if ( | ||
Schema::hasTable('orders') && | ||
!Schema::hasColumns('orders', ['executed_at', 'executed_status']) | ||
) { | ||
Schema::table('orders', function (Blueprint $table) { | ||
$table->dateTime('executed_at')->nullable(); | ||
$table->string('executed_status')->nullable(); | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
if ( | ||
Schema::hasTable('orders') && | ||
Schema::hasColumns('orders', ['executed_at', 'executed_status']) | ||
) { | ||
Schema::table('orders', function (Blueprint $table) { | ||
$table->dropColumn(['executed_at', 'executed_status']); | ||
}); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
database/migrations/2022_02_07_143927_add_missings_column_to_consultations_table.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,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddMissingsColumnToConsultationsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('consultations', function (Blueprint $table) { | ||
$table->string('duration')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('consultations', function (Blueprint $table) { | ||
$table->dropColumn('duration'); | ||
}); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
database/migrations/2022_02_09_122813_remove_redundant_columns_from_consultations_table.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,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class RemoveRedundantColumnsFromConsultationsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('consultations', function (Blueprint $table) { | ||
$table->dropColumn('duration'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('consultations', function (Blueprint $table) { | ||
$table->string('duration')->nullable(); | ||
}); | ||
} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
namespace EscolaLms\Consultations\Dto; | ||
|
||
use EscolaLms\Consultations\Dto\Traits\DtoHelper; | ||
|
||
abstract class BaseDto | ||
{ | ||
use DtoHelper; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
$this->setterByData($data); | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace EscolaLms\Consultations\Dto; | ||
|
||
use EscolaLms\Consultations\Dto\Contracts\ModelDtoContract; | ||
use EscolaLms\Consultations\Models\Consultation; | ||
|
||
class ConsultationDto extends BaseDto implements ModelDtoContract | ||
{ | ||
protected string $name; | ||
protected string $status; | ||
protected string $description; | ||
protected ?string $startedAt; | ||
protected ?string $finishedAt; | ||
protected ?int $basePrice; | ||
protected ?int $authorId; | ||
|
||
public function model(): Consultation | ||
{ | ||
return Consultation::newModelInstance(); | ||
} | ||
|
||
public function toArray($filters = false): array | ||
{ | ||
$result = $this->fillInArray($this->model()->getFillable()); | ||
return $filters ? array_filter($result) : $result; | ||
} | ||
} |
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 @@ | ||
<?php | ||
|
||
namespace EscolaLms\Consultations\Dto\Contracts; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
interface ModelDtoContract | ||
{ | ||
public function model(): Model; | ||
public function toArray($filters = false): array; | ||
} |
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
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
Oops, something went wrong.