components: schemas: # should go to main Date: type: object properties: datetime: type: string format: date-time Scope: type: object properties: id: type: integer type: type: string enum: - scope name: type: object additionalProperties: type: string example: fr: Social ScopeById: type: object properties: id: type: integer type: type: string enum: - scope required: - id - scope # ok to stay here Person: type: object properties: id: type: integer readOnly: true type: type: string enum: - 'person' firstName: type: string lastName: type: string text: type: string description: a canonical representation for the person name readOnly: true birthdate: $ref: '#/components/schemas/Date' phonenumber: type: string mobilenumber: type: string gender: type: string enum: - man - woman - both gender_numeric: type: integer description: a numerical representation of gender readOnly: true PersonById: type: object properties: id: type: integer type: type: string enum: - 'person' required: - id - type # should go to third party ThirdParty: type: object properties: text: type: string ThirdPartyById: type: object properties: id: type: integer type: type: string enum: - 'thirdparty' required: - id - type # ok to stay here AccompanyingPeriod: type: object properties: type: type: string enum: - accompanying_period id: type: integer requestorAnonymous: type: boolean Resource: type: object properties: type: type: string enum: - 'accompanying_period_resource' readOnly: true id: type: integer readOnly: true resource: anyOf: - $ref: '#/components/schemas/PersonById' - $ref: '#/components/schemas/ThirdPartyById' ResourceById: type: object properties: id: type: integer type: type: string enum: - 'accompanying_period_resource' required: - id - type Comment: type: object properties: type: type: string enum: - 'accompanying_period_comment' readOnly: true id: type: integer readOnly: true content: type: string CommentById: type: object properties: id: type: integer type: type: string enum: - 'accompanying_period_comment' 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 Household: type: object properties: id: type: integer type: type: string enum: - 'household' HouseholdPosition: type: object properties: id: type: integer type: type: string enum: - 'household_position' paths: /1.0/person/person/{id}.json: get: tags: - person summary: Get a single person parameters: - name: id in: path required: true description: The person's id schema: type: integer format: integer minimum: 1 responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/Person" 403: description: "Unauthorized" /1.0/person/person.json: post: tags: - person summary: Create a single person requestBody: description: "A person" required: true content: application/json: schema: $ref: '#/components/schemas/Person' responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/Person" 403: description: "Unauthorized" 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: - 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: - person summary: "Return the description for an accompanying course (accompanying period)" parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" patch: tags: - person summary: "Alter an accompanying course (accompanying period)" parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 requestBody: description: "An accompanying period" required: true content: application/json: schema: $ref: '#/components/schemas/AccompanyingPeriod' examples: Set the requestor as anonymous: value: type: accompanying_period id: 12345 requestorAnonymous: true Adding an initial comment: value: type: accompanying_period id: 2668, initialComment: type: accompanying_period_comment content: > This is my an initial comment. Say hello to the new "parcours"! responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" /1.0/person/accompanying-course/{id}/requestor.json: post: tags: - person summary: "Add a requestor 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 person or thirdparty" required: true content: application/json: schema: oneOf: - $ref: '#/components/schemas/PersonById' - $ref: '#/components/schemas/ThirdPartyById' examples: add person with id 50: summary: "a person with id 50" value: type: person id: 50 add thirdparty with id 100: summary: "a third party with id 100" value: type: thirdparty id: 100 responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" delete: tags: - person summary: "Remove the requestor for the accompanying course" parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" /1.0/person/accompanying-course/{id}/participation.json: post: tags: - person summary: "Add a participant 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 person" required: true content: application/json: schema: $ref: '#/components/schemas/PersonById' responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" delete: tags: - person summary: "Remove the participant for 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 person" required: true content: application/json: schema: $ref: '#/components/schemas/PersonById' responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" /1.0/person/accompanying-course/{id}/resource.json: post: tags: - person summary: "Add a resource 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 resource" required: true content: application/json: schema: $ref: '#/components/schemas/Resource' examples: add person with id 50: summary: "a person with id 50" value: type: accompanying_period_resource resource: type: person id: 50 add thirdparty with id 100: summary: "a third party with id 100" value: type: accompanying_period_resource resource: type: thirdparty id: 100 responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" delete: tags: - person summary: "Remove the resource" parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 requestBody: description: "A resource" required: true content: application/json: schema: $ref: '#/components/schemas/ResourceById' responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" /1.0/person/accompanying-course/{id}/comment.json: post: tags: - person summary: "Add a comment 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 comment" required: true content: application/json: schema: $ref: '#/components/schemas/Comment' examples: a single comment: summary: "a simple comment" value: type: accompanying_period_comment content: | This is a funny comment I would like to share with you. Thank you for reading this ! responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" delete: tags: - person summary: "Remove the comment" parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 requestBody: description: "A comment" required: true content: application/json: schema: $ref: '#/components/schemas/CommentById' responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "object with validation errors" /1.0/person/accompanying-course/{id}/scope.json: post: tags: - person summary: "Add a scope 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 comment" required: true content: application/json: schema: $ref: '#/components/schemas/Scope' examples: add a scope: value: type: scope 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 scope" parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 requestBody: description: "A scope with his id" required: true content: application/json: schema: $ref: '#/components/schemas/ScopeById' responses: 401: description: "Unauthorized" 404: description: "Not found" 200: 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" /1.0/person/accompanying-course/{id}/confirm.json: post: tags: - person summary: confirm an accompanying course parameters: - name: id in: path required: true description: The accompanying period's id schema: type: integer format: integer minimum: 1 responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 400: description: "transition cannot be applyed" /1.0/person/household.json: get: tags: - household summary: Return a list of all household responses: 200: description: "ok" /1.0/person/household/{id}.json: get: tags: - household summary: Return a household by id parameters: - name: id in: path required: true description: The household id schema: type: integer format: integer minimum: 1 responses: 200: description: "ok" content: application/json: schema: $ref: '#/components/schemas/Household' 404: description: "not found" 401: description: "Unauthorized" /1.0/person/household/members/move.json: post: tags: - household summary: move one or multiple person from a household to another 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: $ref: '#/components/schemas/Household' examples: Moving person to a new household: value: concerned: - person: id: 0 type: person position: type: position id: 1 start_date: datetime: 2021-06-01T00:00:00+02:00 comment: "This is my comment for moving" holder: false destination: type: household Moving person to an existing household: value: concerned: - person: id: 0 type: person position: type: position id: 1 start_date: datetime: 2021-06-01T00:00:00+02:00 comment: "This is my comment for moving" holder: false destination: type: household id: 54 Removing a person from any household: value: concerned: - person: id: 0 type: person start_date: datetime: 2021-06-01T00:00:00+02:00 destination: null 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/household/{id}/address.json: post: tags: - household summary: post an address to a household parameters: - name: id in: path required: true description: The household 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 household responses: 401: description: "Unauthorized" 404: description: "Not found" 200: description: "OK" 422: description: "Unprocessable entity (validation errors)" 400: description: "transition cannot be applyed"