-
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.
Merge pull request #1 from EscolaLMS/feature/TOS-99
Consultation access enquiry
- Loading branch information
Showing
64 changed files
with
2,507 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Generate Contracts Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
phpunit-code-coverage: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: escolalms/php:7.4 | ||
|
||
steps: | ||
- name: Instantiate package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup environment | ||
run: cp -r env/codecov/. . | ||
|
||
- name: add Contracts main annotaion | ||
run: php -r "file_put_contents('src/EscolaLmsConsultationAccessServiceProvider.php', str_replace('SWAGGER_VERSION', '@OA\Info(title=\"EscolaLMS\", version=\"0.0.1\")', file_get_contents('src/EscolaLmsConsultationAccessServiceProvider.php')));" | ||
|
||
- name: Update composer | ||
run: composer update | ||
|
||
- name: Require composer swagger package | ||
run: composer require darkaonline/l5-swagger:8.1.0 | ||
|
||
- name: Discover packages | ||
run: vendor/bin/testbench package:discover --ansi | ||
|
||
- name: Generate YAML openapi | ||
run: vendor/bin/openapi --format json -b env/openapi/config.php -o openapi.json src | ||
|
||
- name: Generate Swagger UI | ||
uses: Legion2/swagger-ui-action@v1 | ||
with: | ||
output: swagger-ui | ||
spec-file: openapi.json | ||
|
||
- name: Install git | ||
run: apt-get install git -y | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: swagger-ui |
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,66 @@ | ||
name: Tests Code Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
phpunit-code-coverage: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: escolalms/php:8-work | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: database | ||
MYSQL_PASSWORD: password | ||
MYSQL_USER: username | ||
ports: | ||
- 33306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: install git | ||
run: apt-get install git -y | ||
|
||
- name: Instantiate package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup environment | ||
run: cp -r env/codecov/. . | ||
|
||
- name: Update composer | ||
run: composer update | ||
|
||
- name: Clear config | ||
run: vendor/bin/testbench config:clear | ||
|
||
- name: Publish things | ||
run: vendor/bin/testbench migrate:fresh | ||
|
||
- name: require phpunit-github-actions-printer | ||
run: COMPOSER_ROOT_VERSION=0.9.9 composer require --dev mheap/phpunit-github-actions-printer | ||
|
||
- name: Run tests | ||
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml --printer mheap\\GithubActionsReporter\\Printer | ||
|
||
- name: Code Coverage upload | ||
uses: codecov/codecov-action@v1 | ||
|
||
- name: Setup Code Climate test-reporter | ||
run: | | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
- name: Convert | ||
run: ./cc-test-reporter format-coverage coverage.xml -t clover -o codeclimate.0.json | ||
|
||
- name: Upload | ||
run: ./cc-test-reporter upload-coverage -i codeclimate.0.json | ||
env: | ||
CC_TEST_REPORTER_ID: 24d39b073fa0d5fd489f641f77013cc86b5b70d16dcd364d0e8498bd532da062 |
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,173 @@ | ||
name: Tests PHPUnit in environments | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
php8-laravel-latest-phpunit-mysql: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: escolalms/php:8 | ||
|
||
services: | ||
mysql: | ||
image: mariadb | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: database | ||
MYSQL_PASSWORD: password | ||
MYSQL_USER: username | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: Instantiate package | ||
run: apt-get install git -y | ||
|
||
- name: Instantiate package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup environment | ||
run: cp env/mysql/* . | ||
|
||
- name: Update composer | ||
run: composer update | ||
|
||
- name: Clear config | ||
run: vendor/bin/testbench config:clear | ||
|
||
- name: Publish things | ||
run: vendor/bin/testbench migrate:fresh | ||
|
||
- name: Generate keys | ||
run: | | ||
vendor/bin/testbench passport:keys --force | ||
vendor/bin/testbench passport:client --personal --no-interaction | ||
- name: Run tests | ||
run: vendor/bin/phpunit | ||
|
||
php74-laravel-latest-phpunit-mysql: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: escolalms/php:7.4 | ||
|
||
services: | ||
mysql: | ||
image: mariadb | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: database | ||
MYSQL_PASSWORD: password | ||
MYSQL_USER: username | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: Instantiate package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup environment | ||
run: cp env/mysql/* . | ||
|
||
- name: Update composer | ||
run: composer update | ||
|
||
- name: Clear config | ||
run: vendor/bin/testbench config:clear | ||
|
||
- name: Publish things | ||
run: vendor/bin/testbench migrate:fresh | ||
|
||
- name: Generate keys | ||
run: | | ||
vendor/bin/testbench passport:keys --force | ||
vendor/bin/testbench passport:client --personal --no-interaction | ||
- name: Run tests | ||
run: vendor/bin/phpunit | ||
|
||
php74-laravel-latest-phpunit-postgres: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: escolalms/php:7.4 | ||
|
||
services: | ||
postgres: | ||
image: postgres:12 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: test | ||
TZ: Europe/Warsaw | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Instantiate package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update composer | ||
run: composer update | ||
|
||
- name: Setup environment | ||
run: cp env/postgres/* . | ||
|
||
- name: Clear config | ||
run: vendor/bin/testbench config:clear | ||
|
||
- name: Publish things | ||
run: vendor/bin/testbench migrate:fresh | ||
|
||
- name: Generate keys | ||
run: | | ||
vendor/bin/testbench passport:keys --force | ||
vendor/bin/testbench passport:client --personal --no-interaction | ||
- name: Run tests | ||
run: vendor/bin/phpunit | ||
|
||
php81-laravel-latest-phpunit-postgres: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: escolalms/php:8.1-work | ||
|
||
services: | ||
postgres: | ||
image: postgres:12 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: test | ||
TZ: Europe/Warsaw | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Instantiate package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update composer | ||
run: composer update | ||
|
||
- name: Setup environment | ||
run: cp env/postgres/* . | ||
|
||
- name: Clear config | ||
run: vendor/bin/testbench config:clear | ||
|
||
- name: Publish things | ||
run: vendor/bin/testbench migrate:fresh | ||
|
||
- name: Generate keys | ||
run: | | ||
vendor/bin/testbench passport:keys --force | ||
vendor/bin/testbench passport:client --personal --no-interaction | ||
- name: Run tests | ||
run: vendor/bin/phpunit |
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,9 @@ | ||
/vendor | ||
.phpunit.result.cache | ||
composer.lock | ||
.idea | ||
openapi.json | ||
.env | ||
.env.testing | ||
scorm | ||
.DS_Store |
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,9 @@ | ||
# Consultation Access | ||
|
||
[](https://escolalms.github.io/Consultation-Access/) | ||
[](https://codecov.io/gh/EscolaLMS/Consultation-Access) | ||
[](https://github.com/EscolaLMS/Consultation-Access/actions/workflows/test.yml) | ||
[](https://packagist.org/packages/escolalms/consultation-access) | ||
[](https://packagist.org/packages/escolalms/consultation-access) | ||
[](https://packagist.org/packages/escolalms/consultation-access) | ||
[](https://codeclimate.com/github/EscolaLMS/Consultation-Access/maintainability) |
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,47 @@ | ||
{ | ||
"name": "escolalms/consultation-access", | ||
"description": "Escola Headles LMS Consultation Access", | ||
"type": "package", | ||
"require": { | ||
"php": "^7.4|^8.0|^8.1", | ||
"escolalms/auth": "^0", | ||
"escolalms/core": "^1", | ||
"escolalms/settings": "^0", | ||
"escolalms/consultations": "^0", | ||
"laravel/framework": "^8|^9" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.0", | ||
"orchestra/testbench": ">=5.0", | ||
"darkaonline/l5-swagger": "8.1.0" | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Maciej Rymarz", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"EscolaLms\\ConsultationAccess\\": "src", | ||
"EscolaLms\\ConsultationAccess\\Tests\\": "tests", | ||
"EscolaLms\\ConsultationAccess\\Database\\Factories\\": "database/factories", | ||
"EscolaLms\\ConsultationAccess\\Database\\Seeders\\": "database/seeders" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"EscolaLms\\ConsultationAccess\\EscolaLmsConsultationAccessServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"optimize-autoloader": false, | ||
"preferred-install": "dist", | ||
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
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,23 @@ | ||
<?php | ||
|
||
namespace EscolaLms\ConsultationAccess\Database\Factories; | ||
|
||
use EscolaLms\Auth\Models\User; | ||
use EscolaLms\ConsultationAccess\Enum\EnquiryStatusEnum; | ||
use EscolaLms\ConsultationAccess\Models\Consultation; | ||
use EscolaLms\ConsultationAccess\Models\ConsultationAccessEnquiry; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class ConsultationAccessEnquiryFactory extends Factory | ||
{ | ||
protected $model = ConsultationAccessEnquiry::class; | ||
|
||
public function definition(): array | ||
{ | ||
return [ | ||
'consultation_id' => Consultation::factory(), | ||
'user_id' => User::factory(), | ||
'status' => EnquiryStatusEnum::PENDING, | ||
]; | ||
} | ||
} |
Oops, something went wrong.