Files
cpo_test/README.md
2026-02-06 23:26:56 +07:00

48 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Тестовое задание
**На хост машине**
```bash
make help
make build
make install
make run # заполнит базу и запустит тесты
make bash # попасть в контейнер
```
**URL**
https://localhost:8443
**pgadmin**
http://localhost:8081
Маршруты в api.php
```php
Route::post('/login', [AuthController::class, 'login']);
Route::middleware(['auth:sanctum'])->group(function () {
Route::post('/logout', [AuthController::class, 'logout']);
Route::prefix('tasks')->name('tasks.')->group(function () {
Route::get('/', [TaskController::class, 'index'])->name('index');
Route::post('/', [TaskController::class, 'store'])->name('store');
Route::get('/{task}', [TaskController::class, 'show'])->name('show');
Route::match(['put', 'patch'], '/{task}', [TaskController::class, 'update'])->name('update');
Route::delete('/{task}', [TaskController::class, 'destroy'])->name('destroy');
});
});
```
### Комментарий:
Не стал ставить редис и настраивать крон корректно, тк тестовое задание
Запустил отдельными сервисами, проверил
Жестко не стал базу ограничивать, сделал просто каст через php enum (статус таски)
Выбрал frankenphp пхп из-за простоты и любви
В тестах не рефреш датабейз трейт использовал, а транзакции, мне было удобнее просто