added unread and read all function with endpoints for notifications

This commit is contained in:
2024-07-05 13:36:31 +00:00
committed by Julien Fastré
parent 2b09e1459c
commit 2d67843901
14 changed files with 805 additions and 377 deletions

View File

@@ -5,8 +5,8 @@ info:
title: "Chill api"
description: "Api documentation for chill. Currently, work in progress"
servers:
- url: "/api"
description: "Your current dev server"
- url: "/api"
description: "Your current dev server"
components:
schemas:
@@ -165,7 +165,6 @@ components:
endDate:
$ref: "#/components/schemas/Date"
paths:
/1.0/search.json:
get:
@@ -182,25 +181,25 @@ paths:
The results are ordered by relevance, from the most to the lowest relevant.
parameters:
- name: q
in: query
required: true
description: the pattern to search
schema:
type: string
- name: type[]
in: query
required: true
description: the type entities amongst the search is performed
schema:
type: array
items:
type: string
enum:
- person
- thirdparty
- user
- household
- name: q
in: query
required: true
description: the pattern to search
schema:
type: string
- name: type[]
in: query
required: true
description: the type entities amongst the search is performed
schema:
type: array
items:
type: string
enum:
- person
- thirdparty
- user
- household
responses:
200:
description: "OK"
@@ -237,7 +236,7 @@ paths:
minItems: 2
maxItems: 2
postcode:
$ref: '#/components/schemas/PostalCode'
$ref: "#/components/schemas/PostalCode"
steps:
type: string
street:
@@ -261,21 +260,21 @@ paths:
- address
summary: Return an address by id
parameters:
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
$ref: "#/components/schemas/Address"
404:
description: "not found"
401:
@@ -285,14 +284,14 @@ paths:
- address
summary: patch an address
parameters:
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The address id
schema:
type: integer
format: integer
minimum: 1
requestBody:
required: true
content:
@@ -321,7 +320,7 @@ paths:
minItems: 2
maxItems: 2
postcode:
$ref: '#/components/schemas/PostalCode'
$ref: "#/components/schemas/PostalCode"
steps:
type: string
street:
@@ -344,28 +343,27 @@ paths:
400:
description: "transition cannot be applyed"
/1.0/main/address/{id}/duplicate.json:
post:
tags:
- address
summary: Duplicate an existing address
parameters:
- name: id
in: path
required: true
description: The address id that will be duplicated
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The address id that will be duplicated
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/Address'
$ref: "#/components/schemas/Address"
404:
description: "not found"
401:
@@ -377,12 +375,12 @@ paths:
- address
summary: Return a list of all reference addresses
parameters:
- in: query
name: postal_code
required: false
schema:
type: integer
description: The id of a postal code to filter the reference addresses
- in: query
name: postal_code
required: false
schema:
type: integer
description: The id of a postal code to filter the reference addresses
responses:
200:
description: "ok"
@@ -392,21 +390,21 @@ paths:
- address
summary: Return a reference address by id
parameters:
- name: id
in: path
required: true
description: The reference address id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The reference address id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/AddressReference'
$ref: "#/components/schemas/AddressReference"
404:
description: "not found"
401:
@@ -419,27 +417,27 @@ paths:
- search
summary: Return a reference address by id
parameters:
- name: id
in: path
required: true
description: The reference address id
schema:
type: integer
format: integer
minimum: 1
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
- name: id
in: path
required: true
description: The reference address id
schema:
type: integer
format: integer
minimum: 1
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/AddressReference'
$ref: "#/components/schemas/AddressReference"
404:
description: "not found"
401:
@@ -452,12 +450,12 @@ paths:
- address
summary: Return a list of all postal-code
parameters:
- in: query
name: country
required: false
schema:
type: integer
description: The id of a country to filter the postal code
- in: query
name: country
required: false
schema:
type: integer
description: The id of a country to filter the postal code
responses:
200:
description: "ok"
@@ -477,7 +475,7 @@ paths:
code:
type: string
country:
$ref: '#/components/schemas/Country'
$ref: "#/components/schemas/Country"
responses:
401:
description: "Unauthorized"
@@ -496,21 +494,21 @@ paths:
- address
summary: Return a postal code by id
parameters:
- name: id
in: path
required: true
description: The postal code id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The postal code id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/PostalCode'
$ref: "#/components/schemas/PostalCode"
404:
description: "not found"
401:
@@ -523,25 +521,25 @@ paths:
- search
summary: Search a postal code
parameters:
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
- name: country
in: query
required: false
description: The country id
schema:
type: integer
- name: q
in: query
required: true
description: The search pattern
schema:
type: string
- name: country
in: query
required: false
description: The country id
schema:
type: integer
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/PostalCode'
$ref: "#/components/schemas/PostalCode"
404:
description: "not found"
400:
@@ -561,27 +559,26 @@ paths:
- address
summary: Return a country by id
parameters:
- name: id
in: path
required: true
description: The country id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The country id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/Country'
$ref: "#/components/schemas/Country"
404:
description: "not found"
401:
description: "Unauthorized"
/1.0/main/user.json:
get:
tags:
@@ -612,21 +609,21 @@ paths:
- user
summary: Return a user by id
parameters:
- name: id
in: path
required: true
description: The user id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The user id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: "#/components/schemas/User"
404:
description: "not found"
401:
@@ -649,14 +646,14 @@ paths:
- scope
summary: return a list of scopes
parameters:
- name: id
in: path
required: true
description: The scope id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The scope id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -724,14 +721,14 @@ paths:
- location
summary: Return the given location
parameters:
- name: id
in: path
required: true
description: The location id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The location id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
@@ -784,21 +781,21 @@ paths:
id: 1
class: 'Chill\PersonBundle\Entity\AccompanyingPeriod'
roles:
- 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE'
- "CHILL_PERSON_ACCOMPANYING_PERIOD_SEE"
/1.0/main/notification/{id}/mark/read:
post:
tags:
- notification
summary: mark a notification as read
parameters:
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
responses:
202:
description: "accepted"
@@ -810,23 +807,55 @@ paths:
- notification
summary: mark a notification as unread
parameters:
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
- name: id
in: path
required: true
description: The notification id
schema:
type: integer
format: integer
minimum: 1
responses:
202:
description: "accepted"
403:
description: "unauthorized"
/1.0/main/notification/mark/allread:
post:
tags:
- notification
summary: Mark all notifications as read
responses:
202:
description: "accepted"
403:
description: "unauthorized"
/1.0/main/notification/mark/undoallread:
post: # Use POST method for creating resources
tags:
- notification
summary: Mark notifications as unread
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
ids:
type: array
items:
type: integer
example: [1, 2, 3] # Example array of IDs
responses:
"202":
description: Notifications marked as unread successfully
"403":
description: Unauthorized
/1.0/main/civility.json:
get:
tags:
- civility
- civility
summary: Return all civility types
responses:
200:
@@ -844,7 +873,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/UserJob'
$ref: "#/components/schemas/UserJob"
/1.0/main/workflow/my:
get:
tags:
@@ -858,7 +887,7 @@ paths:
schema:
type: array
items:
$ref: '#/components/schemas/Workflow'
$ref: "#/components/schemas/Workflow"
403:
description: "Unauthorized"
/1.0/main/workflow/my-cc:
@@ -874,7 +903,7 @@ paths:
schema:
type: array
items:
$ref: '#/components/schemas/Workflow'
$ref: "#/components/schemas/Workflow"
403:
description: "Unauthorized"
/1.0/main/dashboard-config-item.json:
@@ -888,7 +917,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/DashboardConfigItem'
$ref: "#/components/schemas/DashboardConfigItem"
403:
description: "Unauthorized"
@@ -905,6 +934,6 @@ paths:
schema:
type: array
items:
$ref: '#/components/schemas/NewsItem'
$ref: "#/components/schemas/NewsItem"
403:
description: "Unauthorized"