feat: updated doc to reflect details of server, still not done editing it
This commit is contained in:
@ -1,214 +1,311 @@
|
||||
# _ ____ __ __ ___ _ _ _ ____ ___
|
||||
# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _|
|
||||
# / _ \ | | | | |\/| || || \| | / _ \ | |_) | |
|
||||
# / ___ \| |_| | | | || || |\ | / ___ \| __/| |
|
||||
# /_/ \_\____/|_| |_|___|_| \_| /_/ \_\_| |___|
|
||||
#
|
||||
# Admin API Endpoints
|
||||
paths:
|
||||
/admin/projects:
|
||||
get:
|
||||
summary: Retourne la liste of projets associés à l'admin
|
||||
tags:
|
||||
- Admin API
|
||||
operationId: getAdminProjects
|
||||
summary: Get projects associated with the 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.
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
description: Retrieves a list of projects managed by the requesting admin, including key details for overview.
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
description: OK - List of projects returned successfully.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/project"
|
||||
$ref: "./main.yaml#/components/schemas/project"
|
||||
examples:
|
||||
projectList:
|
||||
value:
|
||||
- idProject: 12
|
||||
projectName: "MyInpulse Mobile App"
|
||||
creationDate: "2024-11-20"
|
||||
logo: "base64..."
|
||||
- idProject: 15
|
||||
projectName: "Data Analytics Dashboard"
|
||||
creationDate: "2025-01-10"
|
||||
logo: "base64..."
|
||||
"400":
|
||||
description: Bad request
|
||||
description: Bad Request - Invalid project data provided (e.g., missing required fields).
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
||||
/admin/projects/pending/decision:
|
||||
description: Unauthorized - Authentication required or invalid token.
|
||||
|
||||
post:
|
||||
summary: valider un projet en attente de validation
|
||||
operationId: addProjectManually
|
||||
summary: Manually add a new project
|
||||
description: Creates a new project with the provided details.
|
||||
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
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
requestBody:
|
||||
required: true
|
||||
description: Project details to create. `idProject` and `creationDate` will be ignored if sent and set by the server.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./main.yaml#/components/schemas/project"
|
||||
examples:
|
||||
newProjectData:
|
||||
value:
|
||||
projectName: "New Initiative"
|
||||
logo: "base64encodedstring..."
|
||||
responses:
|
||||
"201": # Use 201 Created for successful creation
|
||||
description: Created - Project added successfully. Returns the created project.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./main.yaml#/components/schemas/project"
|
||||
"400":
|
||||
description: Bad Request - Invalid project data provided (e.g., missing required fields).
|
||||
"401":
|
||||
description: Unauthorized.
|
||||
|
||||
|
||||
/admin/projects/pending:
|
||||
get:
|
||||
operationId: getPendingProjects
|
||||
summary: Get projects awaiting validation
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
description: Retrieves a list of projects submitted by entrepreneurs that are pending admin approval.
|
||||
responses:
|
||||
"200":
|
||||
description: OK - List of pending projects returned.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "./main.yaml#/components/schemas/project" # Assuming pending projects use the same schema
|
||||
"401":
|
||||
description: Unauthorized.
|
||||
|
||||
/admin/projects/pending/decision/{pendingProjectId}:
|
||||
post:
|
||||
operationId: decidePendingProject
|
||||
summary: Approve or reject a pending project
|
||||
tags:
|
||||
- Admin API
|
||||
description: |-
|
||||
Allows an admin to make a decision on a project awaiting validation.
|
||||
If approved (decision=true), the project status changes, and it's linked to the involved users.
|
||||
If rejected (decision=false), the pending project data might be archived or deleted based on business logic.
|
||||
security:
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
parameters:
|
||||
- in: path
|
||||
name: pendingProjectId # Corrected typo and name change
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
description: The ID of the pending project to decide upon.
|
||||
example: 7
|
||||
requestBody:
|
||||
required: true
|
||||
description: Decision payload.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
pedingProjectId:
|
||||
type: integer
|
||||
decision:
|
||||
type: boolean
|
||||
|
||||
description: true to approve the project, false to reject it.
|
||||
required: [decision]
|
||||
example:
|
||||
approve:
|
||||
value: { "decision": true }
|
||||
reject:
|
||||
value: { "decision": false }
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"204": # Use 204 No Content for successful action with no body
|
||||
description: No Content - Decision processed successfully.
|
||||
"400":
|
||||
description: Bad request
|
||||
description: Bad Request - Invalid input (e.g., missing decision).
|
||||
"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
|
||||
description: Unauthorized.
|
||||
|
||||
|
||||
/admin/pending-accounts: # Path updated
|
||||
get:
|
||||
operationId: getPendingAccounts
|
||||
summary: Get accounts awaiting validation
|
||||
description: Retrieves a list of entrepreneur user accounts that are pending admin validation.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/project"
|
||||
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"400":
|
||||
description: Bad request
|
||||
"200":
|
||||
description: OK - List of pending accounts returned.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "./main.yaml#/components/schemas/user-entrepreneur"
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
description: Unauthorized.
|
||||
|
||||
/admin/accounts/validate/{userId}:
|
||||
post: # Changed to POST as it changes state
|
||||
operationId: validateUserAccount
|
||||
summary: Validate a pending user account
|
||||
description: Marks the user account specified by userId as validated/active.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
description: The ID of the user account to validate.
|
||||
example: 102
|
||||
responses:
|
||||
"204":
|
||||
description: No Content - Account validated successfully.
|
||||
"400":
|
||||
description: Bad Request - Invalid user ID format.
|
||||
|
||||
"401":
|
||||
description: Unauthorized.
|
||||
|
||||
/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.
|
||||
post: # Changed to POST for creation
|
||||
operationId: createAppointmentReport
|
||||
summary: Create a report for an appointment
|
||||
description: Creates and links a new report (e.g., meeting minutes) to the specified appointment using the provided content.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
parameters:
|
||||
- in: path
|
||||
name: appointmentId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
description: ID of the appointment to add a report to.
|
||||
example: 303
|
||||
requestBody:
|
||||
required: true
|
||||
description: Report content. `idReport` will be ignored if sent.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/report"
|
||||
|
||||
$ref: "./main.yaml#/components/schemas/report"
|
||||
example:
|
||||
value:
|
||||
reportContent: "Discussed milestones. Action items assigned."
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"201":
|
||||
description: Created - Report created and linked successfully. Returns the created report.
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "./main.yaml#/components/schemas/report" }
|
||||
"400":
|
||||
description: Bad request
|
||||
description: Bad Request - Invalid input (e.g., missing content, invalid appointment ID format).
|
||||
"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.
|
||||
description: Unauthorized.
|
||||
|
||||
put: # Changed to PUT for update/replacement
|
||||
operationId: updateAppointmentReport
|
||||
summary: Update an existing appointment report
|
||||
description: Updates the content of an existing report linked to the specified appointment. Replaces the entire report content.
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
parameters:
|
||||
- in: path
|
||||
name: appointmentId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
description: ID of the appointment whose report needs updating.
|
||||
example: 303
|
||||
requestBody:
|
||||
required: true
|
||||
description: New report content. `idReport` in the body should match the existing report's ID or will be ignored.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "main.yaml#/components/schemas/report"
|
||||
|
||||
$ref: "./main.yaml#/components/schemas/report"
|
||||
example:
|
||||
value:
|
||||
idReport: 987 # Optional, should match existing if known
|
||||
reportContent: "Updated discussion points. Final decisions made."
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"200":
|
||||
description: OK - Report updated successfully. Returns the updated report.
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "./main.yaml#/components/schemas/report" }
|
||||
"400":
|
||||
description: Bad request
|
||||
description: Bad Request - Invalid input (e.g., missing content).
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
description: Unauthorized.
|
||||
|
||||
|
||||
/admin/projects/remove/{projectId}:
|
||||
/admin/projects/{projectId}:
|
||||
delete:
|
||||
summary: supression d'un project
|
||||
description:
|
||||
Removes the project
|
||||
with the inputed id projectId
|
||||
operationId: removeProject
|
||||
summary: Remove a project
|
||||
description: Permanently removes the project specified by projectId and potentially related data (use with caution).
|
||||
tags:
|
||||
- Admin API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-admin
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
parameters:
|
||||
- in: path
|
||||
name: projectId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
|
||||
description: The ID of the project to remove.
|
||||
example: 12
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
"204":
|
||||
description: No Content - Project removed successfully.
|
||||
"400":
|
||||
description: Bad request
|
||||
description: Bad Request - Invalid project ID format.
|
||||
"401":
|
||||
description: Authorization information is
|
||||
missing or invalid
|
||||
|
||||
description: Unauthorized.
|
||||
|
||||
|
||||
/admin/projects/pending:
|
||||
get:
|
||||
summary: Retourne la liste des projets en attente de validation
|
||||
tags:
|
||||
|
||||
/admin/make-admin/{userId}:
|
||||
post:
|
||||
operationId: grantAdminRights
|
||||
summary: Grant admin rights to a user
|
||||
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.
|
||||
- MyINPulse: [MyINPulse-admin]
|
||||
description: Elevates the specified user to also have administrator privileges. Assumes the user already exists.
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
description: The ID of the user to grant admin rights.
|
||||
example: 103
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "main.yaml#/components/schemas/project"
|
||||
"204": # Use 204 No Content
|
||||
description: No Content - Admin rights granted successfully.
|
||||
"400":
|
||||
description: Bad request
|
||||
description: Bad Request - Invalid user ID format or user is already an admin.
|
||||
"401":
|
||||
description: Authorization information is missing or invalid
|
||||
description: Unauthorized.
|
Reference in New Issue
Block a user