From 7c26f0a56c79948465a010269eae1ac94e401db8 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 15 Jun 2021 07:49:35 +0200 Subject: [PATCH] address: add a new address to a person --- .../Resources/public/vuejs/Address/App.vue | 64 ++++++++++++++++--- .../Resources/public/vuejs/Address/js/i18n.js | 8 ++- .../public/vuejs/Address/store/index.js | 33 +++++++++- .../Resources/public/vuejs/_api/AddAddress.js | 29 ++++++++- .../Controller/PersonApiController.php | 11 +++- .../ChillPersonExtension.php | 11 +++- .../public/vuejs/HouseholdAddress/api.js | 3 +- .../Resources/views/Address/new.html.twig | 34 ++-------- .../ChillPersonBundle/chill.api.specs.yaml | 38 +++++++++++ 9 files changed, 181 insertions(+), 50 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index a1ee92523..6016a6acc 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -1,18 +1,45 @@ {{ encore_entry_script_tags('address') }} {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index 94d7fb98e..26e990fa8 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -260,6 +260,44 @@ paths: 422: description: "Invalid data: the data is a valid json, could be deserialized, but does not pass validation" + /1.0/person/person/{id}/address.json: + post: + tags: + - person + summary: post an address to a person + parameters: + - name: id + in: path + required: true + description: The person id + schema: + type: integer + format: integer + minimum: 1 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: integer + description: The address id to attach to the person + responses: + 401: + description: "Unauthorized" + 404: + description: "Not found" + 200: + description: "OK" + 422: + description: "Unprocessable entity (validation errors)" + 400: + description: "transition cannot be applyed" + + + /1.0/person/social-work/social-issue.json: get: tags: