add api endpoint for adding/remove social issue on accompanying period

This commit is contained in:
2021-05-18 17:18:35 +02:00
parent e095cac7e0
commit 14bd211a5f
5 changed files with 200 additions and 3 deletions

View File

@@ -84,6 +84,8 @@ components:
required:
- id
- type
# ok to stay here
AccompanyingPeriod:
type: object
properties:
@@ -147,6 +149,33 @@ components:
required:
- id
- type
SocialIssue:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- 'social_issue'
parent_id:
type: integer
readOnly: true
children_ids:
type: array
items:
type: integer
readOnly: true
title:
type: object
additionalProperties:
type: string
example:
fr: Accompagnement Social Adulte
readOnly: true
text:
type: string
readOnly: true
paths:
/1.0/person/accompanying-course/{id}.json:
@@ -534,3 +563,68 @@ paths:
description: "OK"
422:
description: "object with validation errors"
/1.0/person/accompanying-course/{id}/socialissue.json:
post:
tags:
- person
summary: "Add a social issue to the accompanying course"
parameters:
- name: id
in: path
required: true
description: The accompanying period's id
schema:
type: integer
format: integer
minimum: 1
requestBody:
description: "A social issue by id"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SocialIssue'
examples:
add a social issue:
value:
type: social_issue
id: 5
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"
delete:
tags:
- person
summary: "Remove the social issue"
parameters:
- name: id
in: path
required: true
description: The accompanying period's id
schema:
type: integer
format: integer
minimum: 1
requestBody:
description: "A social issue with his id"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SocialIssue'
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
422:
description: "object with validation errors"