relation and relationship entities created + endpoints. Still something wrong with link between Relation and Relationship

This commit is contained in:
2021-10-22 19:21:32 +02:00
parent 6ff80be88d
commit 05d16ec9ab
9 changed files with 539 additions and 7 deletions

View File

@@ -274,6 +274,41 @@ components:
enum:
- "social_work_goal"
RelationById:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- "relation"
required:
- id
- type
Relationship:
type: object
properties:
type:
type: string
enum:
- "relationship"
id:
type: integer
readOnly: true
fromPerson:
anyOf:
- $ref: "#/components/schemas/PersonById"
toPerson:
anyOf:
- $ref: "#/components/schemas/PersonById"
relation:
anyOf:
- $ref: "#/components/schemas/RelationById"
reverse:
type: boolean
paths:
/1.0/person/person/{id}.json:
get:
@@ -1589,3 +1624,50 @@ paths:
description: "OK"
400:
description: "Bad Request"
/1.0/relations/relationship/by-person/{id}.json:
get:
tags:
- relationships
parameters:
- name: id
in: path
required: true
description: The person's id
schema:
type: integer
format: integer
minimum: 1
responses:
401:
description: "Unauthorized"
404:
description: "Not found"
200:
description: "OK"
400:
description: "Bad Request"
/1.0/relations/relationship.json:
post:
tags:
- relationships
summary: Create a new relationship
requestBody:
description: "A relationship"
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Relationship"
responses:
200:
description: "OK"
content:
application/json:
schema:
$ref: "#/components/schemas/Relationship"
403:
description: "Unauthorized"
422:
description: "Invalid data: the data is a valid json, could be deserialized, but does not pass validation"