From b5760e82ea3f6aa3f32ca1eb1ad95eeb460a163e Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 30 Jun 2021 14:58:24 +0200 Subject: [PATCH 1/7] swagger person: just sorting yaml tree items --- .../ChillPersonBundle/chill.api.specs.yaml | 186 +++++++++--------- 1 file changed, 95 insertions(+), 91 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index 3bfd1fb57..46223facf 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -296,6 +296,7 @@ paths: $ref: "#/components/schemas/Person" 403: description: "Unauthorized" + /1.0/person/person.json: post: tags: @@ -358,39 +359,6 @@ paths: - /1.0/person/social-work/social-issue.json: - get: - tags: - - social-issue - summary: Return a list of social work - responses: - 200: - description: "ok" - /1.0/person/social-work/social-issue/{id}.json: - get: - tags: - - social-issue - summary: Return a social issue by id - parameters: - - name: id - in: path - required: true - description: The social issue's id - schema: - type: integer - format: integer - minimum: 1 - responses: - 200: - description: "ok" - content: - application/json: - schema: - $ref: '#/components/schemas/SocialIssue' - 404: - description: "not found" - 401: - description: "Unauthorized" /1.0/person/accompanying-course/{id}.json: get: tags: @@ -457,6 +425,7 @@ paths: description: "OK" 422: description: "object with validation errors" + /1.0/person/accompanying-course/{id}/requestor.json: post: tags: @@ -908,6 +877,61 @@ paths: 422: description: "object with validation errors" + /1.0/person/accompanying-course/work/{id}.json: + get: + tags: + - accompanying-course-work + summary: edit an existing accompanying course work + parameters: + - name: id + in: path + required: true + description: The accompanying course social work's id + schema: + type: integer + format: integer + minimum: 1 + responses: + 401: + description: "Unauthorized" + 404: + description: "Not found" + 200: + description: "OK" + 400: + description: "Bad Request" + + put: + tags: + - accompanying-course-work + summary: edit an existing accompanying course work + parameters: + - name: id + in: path + required: true + description: The accompanying course social work's id + schema: + type: integer + format: integer + minimum: 1 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccompanyingCourseWork' + responses: + 401: + description: "Unauthorized" + 404: + description: "Not found" + 200: + description: "OK" + 422: + description: "Unprocessable entity (validation errors)" + 400: + description: "Bad Request" + /1.0/person/accompanying-course/{id}/confirm.json: post: tags: @@ -932,6 +956,8 @@ paths: 400: description: "transition cannot be applyed" + + /1.0/person/household.json: get: tags: @@ -1120,61 +1146,6 @@ paths: - /1.0/person/accompanying-course/work/{id}.json: - get: - tags: - - accompanying-course-work - summary: edit an existing accompanying course work - parameters: - - name: id - in: path - required: true - description: The accompanying course social work's id - schema: - type: integer - format: integer - minimum: 1 - responses: - 401: - description: "Unauthorized" - 404: - description: "Not found" - 200: - description: "OK" - 400: - description: "Bad Request" - - put: - tags: - - accompanying-course-work - summary: edit an existing accompanying course work - parameters: - - name: id - in: path - required: true - description: The accompanying course social work's id - schema: - type: integer - format: integer - minimum: 1 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AccompanyingCourseWork' - responses: - 401: - description: "Unauthorized" - 404: - description: "Not found" - 200: - description: "OK" - 422: - description: "Unprocessable entity (validation errors)" - 400: - description: "Bad Request" - /1.0/person/social/social-action.json: get: tags: @@ -1209,7 +1180,6 @@ paths: 400: description: "Bad Request" - /1.0/person/social/social-action/by-social-issue/{id}.json: get: tags: @@ -1234,6 +1204,42 @@ paths: description: "Bad Request" + + /1.0/person/social-work/social-issue.json: + get: + tags: + - social-issue + summary: Return a list of social work + responses: + 200: + description: "ok" + + /1.0/person/social-work/social-issue/{id}.json: + get: + tags: + - social-issue + summary: Return a social issue by id + parameters: + - name: id + in: path + required: true + description: The social issue's id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/SocialIssue' + 404: + description: "not found" + 401: + description: "Unauthorized" + /1.0/person/social-work/result.json: get: tags: @@ -1268,7 +1274,6 @@ paths: 400: description: "Bad Request" - /1.0/person/social-work/result/by-goal/{id}.json: get: tags: @@ -1349,7 +1354,6 @@ paths: 400: description: "Bad Request" - /1.0/person/social-work/goal/by-social-action/{id}.json: get: tags: From d8256b0ac5fbfe4aa37cbcb828300075a5aaabfe Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 30 Jun 2021 14:59:27 +0200 Subject: [PATCH 2/7] swagger person: adding origin routes --- .../ChillPersonBundle/chill.api.specs.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index 46223facf..9fba308c5 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -958,6 +958,41 @@ paths: + /1.0/person/accompanying-period/origin.json: + get: + tags: + - person + summary: Return a list of all origins + responses: + 200: + description: "ok" + + /1.0/person/accompanying-period/origin/{id}.json: + get: + tags: + - person + summary: Return an origin by id + parameters: + - name: id + in: path + required: true + description: The origin id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + 400: + description: "Bad Request" + 401: + description: "Unauthorized" + 404: + description: "Not found" + + + /1.0/person/household.json: get: tags: From 2fe1605385c0d92e95468a3b9d6a9bee804f5c80 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 30 Jun 2021 17:07:48 +0200 Subject: [PATCH 3/7] vue accompanyingCourse, adding an origin sub-component --- .../Entity/AccompanyingPeriod/Origin.php | 7 +++ .../components/OriginDemand.vue | 45 ++++++++++++++++-- .../components/Referrer.vue | 4 +- .../vuejs/AccompanyingCourse/js/i18n.js | 2 + .../vuejs/AccompanyingCourse/store/index.js | 11 +++++ .../AccompanyingPeriodOriginNormalizer.php | 46 +++++++++++++++++++ 6 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Origin.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Origin.php index 3175e3156..aaf2bec94 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Origin.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Origin.php @@ -24,10 +24,17 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Annotation as Serializer; +use Symfony\Component\Serializer\Annotation\DiscriminatorMap; /** * @ORM\Entity * @ORM\Table(name="chill_person_accompanying_period_origin") + * @Serializer\DiscriminatorMap( + * typeProperty="type", + * mapping={ + * "origin"=Origin::class + * }) */ class Origin { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue index 8706601e2..1a4ad5fe8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/OriginDemand.vue @@ -1,17 +1,37 @@ - + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue index c566d2281..aa10b76a2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Referrer.vue @@ -3,7 +3,7 @@

{{ $t('referrer.title') }}

-