From 3e39dd9a1e5dd86c0aa29fd639e6fe6595e1c28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 10 Jun 2021 13:02:35 +0200 Subject: [PATCH] remove route for testing move --- .../Controller/HouseholdMemberController.php | 43 ------------------- .../ChillPersonBundle/chill.api.specs.yaml | 42 ------------------ 2 files changed, 85 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index d2142f43f..63c0657a0 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -71,49 +71,6 @@ class HouseholdMemberController extends ApiController return $this->json($editor->getHousehold(), Response::HTTP_OK, [], ["groups" => ["read"]]); } - /** - * @Route( - * "/api/1.0/person/household/members/move/test.{_format}", - * name="chill_api_person_household_members_move_test" - * ) - */ - public function test(Request $request, $_format): Response - { - try { - $editor = $this->getSerializer() - ->deserialize($request->getContent(), MembersEditor::class, - $_format, ['groups' => [ "read" ]]); - } catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) { - throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e); - } - // TODO ACL - // - // TODO validation - // temporary, to have at least one problem for testing purpose - /*$violations = [ - new \Symfony\Component\Validator\ConstraintViolation( - "This is a fake message", - null, - [], - $editor->getHousehold(), - 'household.members.startDate', - new \DateTime('10 years ago') - ), - new \Symfony\Component\Validator\ConstraintViolation( - "This is another fake message", - null, - [], - $editor->getHousehold(), - 'household.members.endDate', - new \DateTime('10 years ago') - ) - ]; - $violationsList = new \Symfony\Component\Validator\ConstraintViolationList($violations); - */ - - return $this->json($editor->getHousehold(), Response::HTTP_OK, ["groups" => ["read"]]); - } - /** * @Route( * "/{_locale}/person/household/members/editor", diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index bd3a8706f..75ff6dfb8 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -869,45 +869,3 @@ paths: 400: description: "transition cannot be applyed" - /1.0/person/household/members/move/test.json: - post: - tags: - - household - summary: test the move of one or more person, without persisting changes in database - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - concerned: - type: array - items: - type: object - properties: - person: - $ref: '#/components/schemas/PersonById' - start_date: - $ref: '#/components/schemas/Date' - position: - $ref: '#/components/schemas/HouseholdPosition' - holder: - type: boolean - comment: - type: string - destination: - oneOf: - - $ref: '#/components/schemas/Household' - responses: - 401: - description: "Unauthorized" - 404: - description: "Not found" - 200: - description: "OK" - 422: - description: "Unprocessable entity (validation errors)" - 400: - description: "transition cannot be applyed" -