mergerd open_api docs with backend-test
This commit is contained in:
commit
b9959014d0
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,4 +3,6 @@
|
||||
keycloak/CAS/target
|
||||
keycloak/.installed
|
||||
docker-compose.yaml
|
||||
node_modules
|
||||
.vscode
|
||||
postgres/data
|
||||
|
@ -48,4 +48,4 @@ services:
|
||||
# container_name: MyINPulse-back
|
||||
# ports:
|
||||
# - "8081:8080"
|
||||
|
||||
#
|
@ -42,11 +42,11 @@ services:
|
||||
# ports:
|
||||
# - "8080:80"
|
||||
|
||||
back:
|
||||
build:
|
||||
context: ./MyINPulse-back/
|
||||
dockerfile: Dockerfile
|
||||
container_name: MyINPulse-back
|
||||
ports:
|
||||
- "8081:8080"
|
||||
#back:
|
||||
# build:
|
||||
# context: ./MyINPulse-back/
|
||||
# dockerfile: Dockerfile
|
||||
# container_name: MyINPulse-back
|
||||
# ports:
|
||||
# - "8081:8080"
|
||||
|
@ -45,11 +45,11 @@ services:
|
||||
ports:
|
||||
- "8080:80"
|
||||
|
||||
back:
|
||||
build:
|
||||
context: ./MyINPulse-back/
|
||||
dockerfile: Dockerfile
|
||||
container_name: MyINPulse-back
|
||||
#ports:
|
||||
# - "8081:8080"
|
||||
#back:
|
||||
# build:
|
||||
# context: ./MyINPulse-back/
|
||||
# dockerfile: Dockerfile
|
||||
# container_name: MyINPulse-back
|
||||
# #ports:
|
||||
# # - "8081:8080"
|
||||
|
47
documentation/openapi/notes.md
Normal file
47
documentation/openapi/notes.md
Normal file
@ -0,0 +1,47 @@
|
||||
## API Endpoints notes
|
||||
|
||||
### EntrepreneurApi and SharedApi
|
||||
#### Endpoint Name Changes
|
||||
- `/entrepreneur/lcsection/modify/{sectionId}` → `/entrepreneur/sectionCell/modify/{sectionId}`
|
||||
|
||||
### Admin api
|
||||
- `/admin/appointments/upcoming`: is shared not admin
|
||||
- `/admin/projects/decision`: instanciates classes with `adminId` instead of taking the id from the token
|
||||
- `/admin/project/add`:
|
||||
- point 1: the doc has this `projects` everywhere this should be `/admin/projects/add` to avoid confusion I think
|
||||
- point 2: this doesn't assiociate users with a project I need to add other endopint for that
|
||||
- `/admin/appoitements/report/{appointmentId}`:
|
||||
- typo: `appoitements` → `appointments`
|
||||
- `/admin/projects/remove/{projectId}`, `/admin/project/add`, `/admin/projects/decision`, `/admin/projects/pending`:
|
||||
- should need token to delete or add project
|
||||
|
||||
### Entrepreneur api
|
||||
- `/entrepreneur/sectionCell/modify/{sectionId}`:
|
||||
- the section-id because of the definition of `sectionCell` schema the `sectionId` is given twice possibly leading to inconsistency. Which is why the path var to be removed:
|
||||
- → `/entrepreneur/sectionCell/modify`
|
||||
|
||||
### Shared api
|
||||
- `/shared/project/sectionCell/{projectId}/{sectionId}/{date}`:
|
||||
- point 1:
|
||||
same point for `project` → `projects`
|
||||
- point 2:
|
||||
have yet to read `sharedApiService` to see how dates are handled and to see if we agree on values of `date` to make it so it gets the version relative to current date
|
||||
- `/shared/entrepreneurs/{projectId}`:
|
||||
- maybe change to `/shared/projects/entrepreneurs/{projectId}` to match other similair endpoints like `/shared/projects/admin/{projectId}`
|
||||
- `/shared/appointment/request`:
|
||||
- creates the apointement but don't know how it associates other users, potentially multiple classes in one request body, is that possible ?
|
||||
|
||||
## TODOs for me
|
||||
|
||||
### list 1:
|
||||
- add back-end server links (backend and auth) for interacting with api through swagger
|
||||
- get config for that set up in the project
|
||||
|
||||
### list 2:
|
||||
- see what to do about logo img
|
||||
- see format for date and add it in examples
|
||||
- ask the form of return of the json of iterables, for now I have put array
|
||||
- add endpoint for adding users to a project
|
||||
- update endpoint descriptions
|
||||
- add examples for values in schemas
|
||||
|
11
documentation/openapi/run_doc.sh
Executable file
11
documentation/openapi/run_doc.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ./swagger-ui
|
||||
|
||||
if [ ! -d "./node_modules/" ]
|
||||
then
|
||||
npm install
|
||||
npm install swagger-cli
|
||||
fi
|
||||
|
||||
npm start
|
214
documentation/openapi/src/adminApi.yaml
Normal file
214
documentation/openapi/src/adminApi.yaml
Normal file
@ -0,0 +1,214 @@
|
||||
# _ ____ __ __ ___ _ _ _ ____ ___
|
||||
# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _|
|
||||
# / _ \ | | | | |\/| || || \| | / _ \ | |_) | |
|
||||
# / ___ \| |_| | | | || || |\ | / ___ \| __/| |
|
||||
# /_/ \_\____/|_| |_|___|_| \_| /_/ \_\_| |___|
|
||||
#
|
||||
paths:
|
||||
/admin/projects:
|
||||
get:
|
||||
summary: Retourne la liste of projets associés à l'admin
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
description:
|
||||
JSON array of who's elements are objects containing necessary information for the view
|
||||
(project name, entrepreneur names, etc..)
|
||||
of the projects an admin is watching over.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/project"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
||||
/admin/projects/pending/decision:
|
||||
post:
|
||||
summary: valider un projet en attente de validation
|
||||
tags:
|
||||
- Admin API
|
||||
description:
|
||||
if the request is accepted the status of the
|
||||
project is changed to ongoing, entrepreneur
|
||||
account is confirmed and the project is linked
|
||||
to the admin accepting the request and the
|
||||
entrepreneur requesting it. Else the pending
|
||||
project and user info are deleted.
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
pedingProjectId:
|
||||
type: integer
|
||||
decision:
|
||||
type: boolean
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
/admin/projects/add:
|
||||
post:
|
||||
summary: Ajout manuel d'un projet
|
||||
description:
|
||||
Adds a project with the
|
||||
inputed details
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/project"
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
/admin/appointments/report/{appointmentId}:
|
||||
put:
|
||||
summary: enregistrer un rapport du rendez-vous
|
||||
description:
|
||||
Generate a PDF file formatted
|
||||
from input text and links it
|
||||
to the appointement.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
parameters:
|
||||
- in: path
|
||||
name: appointmentId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/report"
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
post:
|
||||
summary: modifier un rapport déja éxistant du rendez-vous
|
||||
description:
|
||||
Modifies the report file to input
|
||||
text and links it to the appointement.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
parameters:
|
||||
- in: path
|
||||
name: appointmentId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/report"
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
|
||||
/admin/projects/remove/{projectId}:
|
||||
delete:
|
||||
summary: supression d'un project
|
||||
description:
|
||||
Removes the project
|
||||
with the inputed id projectId
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
|
||||
/admin/projects/pending:
|
||||
get:
|
||||
summary: Retourne la liste des projets en attente de validation
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
description:
|
||||
JSON array of who's elements are objects containing
|
||||
necessary information for the view (project name, etc..)
|
||||
of all pending projects.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/project"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
600
documentation/openapi/src/bundled.yaml
Normal file
600
documentation/openapi/src/bundled.yaml
Normal file
@ -0,0 +1,600 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: MyInpulse Backend Api
|
||||
description: this document servers as a documentation for the backend api.
|
||||
version: 0.2.0
|
||||
tags:
|
||||
- name: Entrepreneurs API
|
||||
description: La partie de l'api dédiée aux entrepreneurs
|
||||
- name: Admin API
|
||||
description: La partie de l'api dédiée aux entrepreneurs
|
||||
- name: Shared API
|
||||
description: La partie de l'api dédiée aux entrepreneurs et admins
|
||||
components:
|
||||
schemas:
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
idUser:
|
||||
type: integer
|
||||
userSurname:
|
||||
type: string
|
||||
userName:
|
||||
type: string
|
||||
primaryMail:
|
||||
type: string
|
||||
example: example@exmaple.com
|
||||
secondaryMail:
|
||||
type: string
|
||||
example: example@exmaple.com
|
||||
phoneNumber:
|
||||
type: string
|
||||
example: 0612345678
|
||||
user-entrepreneur:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/user'
|
||||
- type: object
|
||||
properties:
|
||||
school:
|
||||
type: string
|
||||
example: enseirb
|
||||
course:
|
||||
type: string
|
||||
example: info
|
||||
sneeStatus:
|
||||
type: boolean
|
||||
example: false
|
||||
user-admin:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/user'
|
||||
sectionCell:
|
||||
type: object
|
||||
properties:
|
||||
idSectionCell:
|
||||
type: integer
|
||||
example: this the cell (postit id)
|
||||
sectionId:
|
||||
type: integer
|
||||
contentSectionCell:
|
||||
type: string
|
||||
modificationDate:
|
||||
type: string
|
||||
example: 02-05-2025
|
||||
project:
|
||||
type: object
|
||||
properties:
|
||||
idProject:
|
||||
type: integer
|
||||
projectName:
|
||||
type: string
|
||||
creationDate:
|
||||
type: string
|
||||
example: 02-05-2025
|
||||
logo:
|
||||
example: to be discussed not yet fixed
|
||||
type: string
|
||||
format: binary
|
||||
report:
|
||||
type: object
|
||||
properties:
|
||||
idReport:
|
||||
type: integer
|
||||
reportContent:
|
||||
type: string
|
||||
appointement:
|
||||
type: object
|
||||
properties:
|
||||
appointmentDate:
|
||||
type: string
|
||||
example: 02-05-2025
|
||||
appointmentTime:
|
||||
type: string
|
||||
example: '10:15:30'
|
||||
appointmentDuration:
|
||||
type: string
|
||||
appointmentPlace:
|
||||
type: string
|
||||
appointmentSubject:
|
||||
type: string
|
||||
securitySchemes:
|
||||
MyINPulse:
|
||||
type: oauth2
|
||||
flows:
|
||||
implicit:
|
||||
authorizationUrl: 'http://localhost:7080'
|
||||
scopes:
|
||||
MyINPulse-admin: Administrateur
|
||||
MyINPulse-entrepreneur: Utilisateur
|
||||
servers:
|
||||
- url: 'http://localhost:8081/'
|
||||
description: Backend server
|
||||
paths:
|
||||
/admin/projects:
|
||||
get:
|
||||
summary: Retourne la liste of projets associés à l'admin
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
description: 'JSON array of who''s elements are objects containing necessary information for the view (project name, entrepreneur names, etc..) of the projects an admin is watching over.'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/project'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/admin/projects/pending/decision:
|
||||
post:
|
||||
summary: valider un projet en attente de validation
|
||||
tags:
|
||||
- Admin API
|
||||
description: 'if the request is accepted the status of the project is changed to ongoing, entrepreneur account is confirmed and the project is linked to the admin accepting the request and the entrepreneur requesting it. Else the pending project and user info are deleted.'
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
pedingProjectId:
|
||||
type: integer
|
||||
decision:
|
||||
type: boolean
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/admin/projects/add:
|
||||
post:
|
||||
summary: Ajout manuel d'un projet
|
||||
description: Adds a project with the inputed details
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/project'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/admin/appointments/report/{appointmentId}':
|
||||
put:
|
||||
summary: enregistrer un rapport du rendez-vous
|
||||
description: Generate a PDF file formatted from input text and links it to the appointement.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
parameters:
|
||||
- in: path
|
||||
name: appointmentId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/report'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
post:
|
||||
summary: modifier un rapport déja éxistant du rendez-vous
|
||||
description: Modifies the report file to input text and links it to the appointement.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
parameters:
|
||||
- in: path
|
||||
name: appointmentId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/report'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/admin/projects/remove/{projectId}':
|
||||
delete:
|
||||
summary: supression d'un project
|
||||
description: Removes the project with the inputed id projectId
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/admin/projects/pending:
|
||||
get:
|
||||
summary: Retourne la liste des projets en attente de validation
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
description: 'JSON array of who''s elements are objects containing necessary information for the view (project name, etc..) of all pending projects.'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/project'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/shared/appointments/upcoming:
|
||||
get:
|
||||
summary: Retourne la list des prochains rendez-vous de l'utilisateur
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description: 'JSON array of upcoming appointment data (name, date, time etc..) for a user.'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/appointement'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/shared/projects/sectionCell/{projectId}/{sectionId}/{date}':
|
||||
get:
|
||||
summary: Retourne la liste de sections de LC avec un titre donné
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description: JSON array containing Lean Canvas section data with a title for the current date (or given date if the date parameter is passed)
|
||||
parameters:
|
||||
- in: path
|
||||
required: true
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
- in: path
|
||||
required: true
|
||||
description: 'this number can be 1, 2,...,8. It is associated with the title of the sectionCell'
|
||||
name: sectionId
|
||||
schema:
|
||||
type: integer
|
||||
enum:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- 4
|
||||
- 5
|
||||
- 6
|
||||
- 7
|
||||
- 8
|
||||
- in: path
|
||||
required: true
|
||||
name: date
|
||||
description: the date corresponding to the wanted version of lc section. "Nan" for the latest version
|
||||
example: NaN
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/sectionCell'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/shared/projects/entrepreneurs/{projectId}':
|
||||
get:
|
||||
summary: Retourne la liste d'entrepreneurs associée à un projet donné
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description: JSON array of entrepreneur names associated with a project
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/user-entrepreneur'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/shared/projects/admin/{projectId}':
|
||||
get:
|
||||
summary: Retourne les informations de l'admin qui accompagne le projet
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description: 'JSON object containing information (name, gmail, tel, etc..) the admin supervising the project with id projectID.'
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/user-admin'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/shared/projects/appointments/{projectId}':
|
||||
get:
|
||||
summary: Retourne les rendez-vous du projet
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description: JSON array of upcoming and past appointment data for the project with id projectID.
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/appointement'
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/shared/projects/appointments/report/{appointmentId}':
|
||||
get:
|
||||
summary: Retourne le rapport pdf du rendez-vous
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description: PDF file containing the ap- pointment report
|
||||
parameters:
|
||||
- in: path
|
||||
name: apointementId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/pdf:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/shared/appointments/request:
|
||||
post:
|
||||
summary: demander un rendez-vous
|
||||
description: will add an appointement request request by the applicant to have an appointment to be confirmed or denied by the specified participants of the appointement.
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
description: \"participants\" property is an array containing userids of the participants in the appointement
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
title:
|
||||
type: string
|
||||
start_time:
|
||||
type: string
|
||||
end_time:
|
||||
type: string
|
||||
place:
|
||||
type: string
|
||||
applicantId:
|
||||
type: integer
|
||||
participants:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/entrepreneur/projects/request:
|
||||
post:
|
||||
summary: demander la création et validation d'un projet
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
description: Adds project to pending projects to then be accepted or rejected by an admin
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
founder:
|
||||
$ref: '#/components/schemas/user-entrepreneur'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/entrepreneur/sectionCell/add:
|
||||
post:
|
||||
summary: ajouter une sections au LC
|
||||
description: Adds input data to the user's LC with a specified title.
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/sectionCell'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
/entrepreneur/sectionCell/modify:
|
||||
put:
|
||||
summary: modifier les données d'une section LC
|
||||
description: Modifies input Lean Canvas section by changing it to the information in the request body and changes the time stamp.
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/sectionCell'
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
||||
'/entrepreneur/sectionCell/remove/{sectionCellId}':
|
||||
delete:
|
||||
summary: supprimer une section LC.
|
||||
description: Deletes section from Lean Canvas
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
parameters:
|
||||
- in: path
|
||||
name: sectionCellId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
'400':
|
||||
description: Bad request
|
||||
'401':
|
||||
description: Authorization information is missing or invalid
|
121
documentation/openapi/src/entrepreneurApi.yaml
Normal file
121
documentation/openapi/src/entrepreneurApi.yaml
Normal file
@ -0,0 +1,121 @@
|
||||
# _____ _ _ _____ ____ _____ ____ ____ _____ _ _ _____ _ _ ____
|
||||
# | ____| \ | |_ _| _ \| ____| _ \| _ \| ____| \ | | ____| | | | _ \
|
||||
# | _| | \| | | | | |_) | _| | |_) | |_) | _| | \| | _| | | | | |_) |
|
||||
# | |___| |\ | | | | _ <| |___| __/| _ <| |___| |\ | |___| |_| | _ <
|
||||
# |_____|_|_\_| |_| |_| \_\_____|_| |_| \_\_____|_| \_|_____|\___/|_| \_\
|
||||
# / \ | _ \_ _|
|
||||
# / _ \ | |_) | |
|
||||
# / ___ \| __/| |
|
||||
# /_/ \_\_| |___|
|
||||
#
|
||||
|
||||
paths:
|
||||
/entrepreneur/projects/request:
|
||||
post:
|
||||
summary: demander la création et validation d'un projet
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
description:
|
||||
Adds project to pending projects
|
||||
to then be accepted or rejected by
|
||||
an admin
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
founder:
|
||||
$ref: "main.yaml#/components/schemas/user-entrepreneur"
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
|
||||
/entrepreneur/sectionCell/add:
|
||||
post:
|
||||
summary: ajouter une sections au LC
|
||||
description:
|
||||
Adds input data to the user's LC
|
||||
with a specified title.
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/sectionCell"
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
/entrepreneur/sectionCell/modify:
|
||||
put:
|
||||
summary: modifier les données d'une section LC
|
||||
description:
|
||||
Modifies input Lean Canvas section by changing it to
|
||||
the information in the request body and changes the
|
||||
time stamp.
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/sectionCell"
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
/entrepreneur/sectionCell/remove/{sectionCellId}:
|
||||
delete:
|
||||
summary: supprimer une section LC.
|
||||
description:
|
||||
Deletes section from Lean Canvas
|
||||
tags:
|
||||
- Entrepreneurs API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
parameters:
|
||||
- in: path
|
||||
name: sectionCellId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
114
documentation/openapi/src/main.yaml
Normal file
114
documentation/openapi/src/main.yaml
Normal file
@ -0,0 +1,114 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: MyInpulse Backend Api
|
||||
description: this document servers as a documentation for the backend api.
|
||||
version: 0.2.0
|
||||
|
||||
tags:
|
||||
- name: Entrepreneurs API
|
||||
description: La partie de l'api dédiée aux entrepreneurs
|
||||
- name: Admin API
|
||||
description: La partie de l'api dédiée aux entrepreneurs
|
||||
- name: Shared API
|
||||
description: La partie de l'api dédiée aux entrepreneurs et admins
|
||||
|
||||
|
||||
components:
|
||||
schemas:
|
||||
user:
|
||||
$ref: "models.yaml#/user"
|
||||
user-entrepreneur:
|
||||
$ref: "models.yaml#/user-entrepreneur"
|
||||
user-admin:
|
||||
$ref: "models.yaml#/user-admin"
|
||||
sectionCell:
|
||||
$ref: "models.yaml#/sectionCell"
|
||||
project:
|
||||
$ref: "models.yaml#/project"
|
||||
report:
|
||||
$ref: "models.yaml#/report"
|
||||
appointement:
|
||||
$ref: "models.yaml#/appointement"
|
||||
|
||||
|
||||
securitySchemes:
|
||||
MyINPulse:
|
||||
type: oauth2
|
||||
flows:
|
||||
implicit:
|
||||
authorizationUrl: http://localhost:7080
|
||||
scopes:
|
||||
MyINPulse-admin: Administrateur
|
||||
MyINPulse-entrepreneur: Utilisateur
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8081/
|
||||
description: Backend server
|
||||
|
||||
|
||||
|
||||
paths:
|
||||
# _ ____ __ __ ___ _ _ _ ____ ___
|
||||
# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _|
|
||||
# / _ \ | | | | |\/| || || \| | / _ \ | |_) | |
|
||||
# / ___ \| |_| | | | || || |\ | / ___ \| __/| |
|
||||
# /_/ \_\____/|_| |_|___|_| \_| /_/ \_\_| |___|
|
||||
#
|
||||
/admin/projects:
|
||||
$ref: "./adminApi.yaml#/paths/~1admin~1projects"
|
||||
/admin/projects/pending/decision:
|
||||
$ref: "./adminApi.yaml#/paths/~1admin~1projects~1pending~1decision"
|
||||
/admin/projects/add:
|
||||
$ref: "./adminApi.yaml#/paths/~1admin~1projects~1add"
|
||||
/admin/appointments/report/{appointmentId}:
|
||||
$ref: "./adminApi.yaml#/paths/~1admin~1appointments~1report~1{appointmentId}"
|
||||
/admin/projects/remove/{projectId}:
|
||||
$ref: "./adminApi.yaml#/paths/~1admin~1projects~1remove~1{projectId}"
|
||||
/admin/projects/pending:
|
||||
$ref: "./adminApi.yaml#/paths/~1admin~1projects~1pending"
|
||||
|
||||
# ____ _ _ _ ____ ___
|
||||
# / ___|| |__ __ _ _ __ ___ __| | / \ | _ \_ _|
|
||||
# \___ \| '_ \ / _` | '__/ _ \/ _` | / _ \ | |_) | |
|
||||
# ___) | | | | (_| | | | __/ (_| | / ___ \| __/| |
|
||||
# |____/|_| |_|\__,_|_| \___|\__,_| /_/ \_\_| |___|
|
||||
#
|
||||
/shared/appointments/upcoming:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1appointments~1upcoming"
|
||||
/shared/projects/sectionCell/{projectId}/{sectionId}/{date}:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1sectionCell~1{projectId}~1{sectionId}~1{date}"
|
||||
/shared/projects/entrepreneurs/{projectId}:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1entrepreneurs~1{projectId}"
|
||||
/shared/projects/admin/{projectId}:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1admin~1{projectId}"
|
||||
/shared/projects/appointments/{projectId}:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1appointments~1{projectId}"
|
||||
/shared/projects/appointments/report/{appointmentId}:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1appointments~1report~1{appointmentId}"
|
||||
|
||||
/shared/appointments/request:
|
||||
$ref: "./sharedApi.yaml#/paths/~1shared~1appointments~1request"
|
||||
|
||||
# _____ _ _ _____ ____ _____ ____ ____ _____ _ _ _____ _ _ ____
|
||||
# | ____| \ | |_ _| _ \| ____| _ \| _ \| ____| \ | | ____| | | | _ \
|
||||
# | _| | \| | | | | |_) | _| | |_) | |_) | _| | \| | _| | | | | |_) |
|
||||
# | |___| |\ | | | | _ <| |___| __/| _ <| |___| |\ | |___| |_| | _ <
|
||||
# |_____|_|_\_| |_| |_| \_\_____|_| |_| \_\_____|_| \_|_____|\___/|_| \_\
|
||||
# / \ | _ \_ _|
|
||||
# / _ \ | |_) | |
|
||||
# / ___ \| __/| |
|
||||
# /_/ \_\_| |___|
|
||||
#
|
||||
/entrepreneur/projects/request:
|
||||
$ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1projects~1request"
|
||||
/entrepreneur/sectionCell/add:
|
||||
$ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1sectionCell~1add"
|
||||
/entrepreneur/sectionCell/modify:
|
||||
$ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1sectionCell~1modify"
|
||||
/entrepreneur/sectionCell/remove/{sectionCellId}:
|
||||
$ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1sectionCell~1remove~1{sectionCellId}"
|
||||
|
||||
|
||||
|
||||
|
||||
|
92
documentation/openapi/src/models.yaml
Normal file
92
documentation/openapi/src/models.yaml
Normal file
@ -0,0 +1,92 @@
|
||||
# models.yaml
|
||||
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
idUser:
|
||||
type: integer
|
||||
userSurname:
|
||||
type: string
|
||||
userName:
|
||||
type: string
|
||||
primaryMail:
|
||||
type: string
|
||||
example: "example@exmaple.com"
|
||||
secondaryMail:
|
||||
type: string
|
||||
example: "example@exmaple.com"
|
||||
phoneNumber:
|
||||
type: string
|
||||
example: "0612345678"
|
||||
|
||||
user-entrepreneur:
|
||||
allOf:
|
||||
- $ref: "#/user"
|
||||
- type: object
|
||||
properties:
|
||||
school:
|
||||
type: string
|
||||
example: "enseirb"
|
||||
course:
|
||||
type: string
|
||||
example: "info"
|
||||
sneeStatus:
|
||||
type: boolean
|
||||
example: false
|
||||
|
||||
user-admin:
|
||||
allOf:
|
||||
- $ref: "#/user"
|
||||
|
||||
sectionCell:
|
||||
type: object
|
||||
properties:
|
||||
idSectionCell:
|
||||
type: integer
|
||||
example: this the cell (postit id)
|
||||
sectionId:
|
||||
type: integer
|
||||
contentSectionCell:
|
||||
type: string
|
||||
modificationDate:
|
||||
type: string
|
||||
example: "02-05-2025"
|
||||
|
||||
project:
|
||||
type: object
|
||||
properties:
|
||||
idProject:
|
||||
type: integer
|
||||
projectName:
|
||||
type: string
|
||||
creationDate:
|
||||
type: string
|
||||
example: "02-05-2025"
|
||||
logo:
|
||||
example: to be discussed not yet fixed
|
||||
type: string
|
||||
format: binary
|
||||
|
||||
report:
|
||||
type: object
|
||||
properties:
|
||||
idReport:
|
||||
type: integer
|
||||
reportContent:
|
||||
type: string
|
||||
|
||||
appointement:
|
||||
type: object
|
||||
properties:
|
||||
appointmentDate:
|
||||
type: string
|
||||
example: "02-05-2025"
|
||||
appointmentTime:
|
||||
type: string
|
||||
example: "10:15:30"
|
||||
appointmentDuration:
|
||||
type: string
|
||||
appointmentPlace:
|
||||
type: string
|
||||
appointmentSubject:
|
||||
type: string
|
254
documentation/openapi/src/sharedApi.yaml
Normal file
254
documentation/openapi/src/sharedApi.yaml
Normal file
@ -0,0 +1,254 @@
|
||||
# ____ _ _ _ ____ ___
|
||||
# / ___|| |__ __ _ _ __ ___ __| | / \ | _ \_ _|
|
||||
# \___ \| '_ \ / _` | '__/ _ \/ _` | / _ \ | |_) | |
|
||||
# ___) | | | | (_| | | | __/ (_| | / ___ \| __/| |
|
||||
# |____/|_| |_|\__,_|_| \___|\__,_| /_/ \_\_| |___|
|
||||
#
|
||||
paths:
|
||||
/shared/appointments/upcoming:
|
||||
get:
|
||||
summary: Retourne la list des prochains rendez-vous de l'utilisateur
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description:
|
||||
JSON array of upcoming appointment data (name, date, time etc..) for a user.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/appointement"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
||||
|
||||
/shared/projects/sectionCell/{projectId}/{sectionId}/{date}:
|
||||
get:
|
||||
summary: Retourne la liste de sections de LC avec un titre donné
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description:
|
||||
JSON array containing Lean Canvas
|
||||
section data with a title for the
|
||||
current date (or given date if the
|
||||
date parameter is passed)
|
||||
parameters:
|
||||
- in: path
|
||||
required: true
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
- in: path
|
||||
required: true
|
||||
description: this number can be 1, 2,...,8. It is associated with the title of the sectionCell
|
||||
name: sectionId
|
||||
schema:
|
||||
type: integer
|
||||
enum: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
- in: path
|
||||
required: true
|
||||
name: date
|
||||
description: the date corresponding to the wanted version of lc section. "Nan" for the latest version
|
||||
example: "NaN"
|
||||
schema:
|
||||
type: string
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/sectionCell"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
||||
|
||||
/shared/projects/entrepreneurs/{projectId}:
|
||||
get:
|
||||
summary: Retourne la liste d'entrepreneurs associée à un projet donné
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description:
|
||||
JSON array of entrepreneur
|
||||
names associated with a project
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/user-entrepreneur"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
||||
|
||||
/shared/projects/admin/{projectId}:
|
||||
get:
|
||||
summary: Retourne les informations de l'admin qui accompagne le projet
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description:
|
||||
JSON object containing information (name, gmail, tel, etc..)
|
||||
the admin supervising the project with id projectID.
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/user-admin"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
/shared/projects/appointments/{projectId}:
|
||||
get:
|
||||
summary: Retourne les rendez-vous du projet
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description:
|
||||
JSON array of upcoming and past appointment
|
||||
data for the project with id projectID.
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/appointement"
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
/shared/projects/appointments/report/{appointmentId}:
|
||||
get:
|
||||
summary: Retourne le rapport pdf du rendez-vous
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse-entrepreneur
|
||||
description:
|
||||
PDF file containing the ap-
|
||||
pointment report
|
||||
parameters:
|
||||
- in: path
|
||||
name: apointementId
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/pdf:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
/shared/appointments/request:
|
||||
post:
|
||||
summary: demander un rendez-vous
|
||||
description:
|
||||
will add an appointement request request by the applicant
|
||||
to have an appointment to be confirmed or denied by the
|
||||
specified participants of the appointement.
|
||||
tags:
|
||||
- Shared API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
description: \"participants\" property is an array containing userids of the participants in the appointement
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
title:
|
||||
type: string
|
||||
start_time:
|
||||
type: string
|
||||
end_time:
|
||||
type: string
|
||||
place:
|
||||
type: string
|
||||
applicantId:
|
||||
type: integer
|
||||
participants:
|
||||
#/* */
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
14
documentation/openapi/swagger-ui/main.js
Normal file
14
documentation/openapi/swagger-ui/main.js
Normal file
@ -0,0 +1,14 @@
|
||||
const express = require("express");
|
||||
const swaggerUi = require("swagger-ui-express");
|
||||
const yaml = require("js-yaml");
|
||||
const fs = require("fs");
|
||||
|
||||
const app = express();
|
||||
|
||||
const swaggerDocument = yaml.load(fs.readFileSync("../src/bundled.yaml", "utf8"));
|
||||
|
||||
app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerDocument));
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log("Swagger UI running at http://localhost:3000/api-docs");
|
||||
});
|
2179
documentation/openapi/swagger-ui/package-lock.json
generated
Normal file
2179
documentation/openapi/swagger-ui/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
documentation/openapi/swagger-ui/package.json
Normal file
21
documentation/openapi/swagger-ui/package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "swagger-ui",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"bundle": "swagger-cli bundle -o ../src/bundled.yaml -t yaml ../src/main.yaml",
|
||||
"start": "npm run bundle; node main.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"express": "^4.21.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"package.json": "^2.0.1",
|
||||
"swagger-cli": "^4.0.4",
|
||||
"swagger-ui-express": "^5.0.1"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user