diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index fa561b7e7..03deafd14 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -559,6 +559,20 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => \Chill\MainBundle\Entity\Civility::class, + 'name' => 'civility', + 'base_path' => '/api/1.0/main/civility', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], ], ]); } diff --git a/src/Bundle/ChillMainBundle/Entity/Civility.php b/src/Bundle/ChillMainBundle/Entity/Civility.php index c91016a63..cd4a75e5f 100644 --- a/src/Bundle/ChillMainBundle/Entity/Civility.php +++ b/src/Bundle/ChillMainBundle/Entity/Civility.php @@ -29,6 +29,7 @@ class Civility /** * @ORM\Column(type="boolean") + * @Serializer\Groups({"read"}) */ private bool $active = true; diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 034dfe74b..fa82a58cd 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -781,6 +781,16 @@ paths: description: "accepted" 403: description: "unauthorized" + /1.0/main/civility.json: + get: + tags: + - civility + summary: Return all civility types + responses: + 200: + description: "ok" + 401: + description: "Unauthorized" /1.0/main/user-job.json: get: tags: diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index 1981d6daf..124f5b7f3 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -126,6 +126,21 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte ], ], ], + [ + 'class' => \Chill\ThirdPartyBundle\Entity\ThirdPartyProfession::class, + // 'controller' => \Chill\MainBundle\Controller\ProfessionApiController::class, + 'name' => 'profession', + 'base_path' => '/api/1.0/thirdparty/professions', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], ], ]); } diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php index 1963b34a7..bf10c7cf1 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php @@ -23,6 +23,7 @@ class ThirdPartyProfession { /** * @ORM\Column(type="boolean") + * @Serializer\Groups({"read"}) */ private bool $active = true; @@ -30,13 +31,13 @@ class ThirdPartyProfession * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Serializer\Groups({"docgen:read"}) + * @Serializer\Groups({"docgen:read", "read"}) */ private ?int $id = null; /** * @ORM\Column(type="json") - * @Serializer\Groups({"docgen:read"}) + * @Serializer\Groups({"docgen:read", "read"}) */ private array $name = []; diff --git a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml index 52db7589c..eb303a4f0 100644 --- a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml @@ -110,3 +110,14 @@ paths: description: "OK" 422: description: "Object with validation errors" + + /1.0/thirdparty/professions.json: + get: + tags: + - thirdparty + summary: Return all thirdparty professions + responses: + 200: + description: "ok" + 401: + description: "Unauthorized"