fix: aadded changes, doc is ssomewhat coherent still need to change some endpoint names in controller and some minor changes
All checks were successful
Format / formatting (push) Successful in 6s
Build / build (push) Successful in 38s
CI / build (push) Successful in 10s

This commit is contained in:
MAILLAL Anas 2025-04-16 12:30:21 +02:00
parent f96872fb6b
commit dfea20b9c4
7 changed files with 109 additions and 230 deletions

View File

@ -18,17 +18,6 @@ paths:
type: array type: array
items: 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": "400":
description: Bad Request - Invalid project data provided (e.g., missing required fields). description: Bad Request - Invalid project data provided (e.g., missing required fields).
"401": "401":
@ -49,11 +38,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: "./main.yaml#/components/schemas/project" $ref: "./main.yaml#/components/schemas/project"
examples:
newProjectData:
value:
projectName: "New Initiative"
logo: "base64encodedstring..."
responses: responses:
"201": # Use 201 Created for successful creation "201": # Use 201 Created for successful creation
description: Created - Project added successfully. Returns the created project. description: Created - Project added successfully. Returns the created project.
@ -114,17 +98,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: object $ref: './main.yaml#/components/schemas/projectDecision'
properties:
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: responses:
"204": # Use 204 No Content for successful action with no body "204": # Use 204 No Content for successful action with no body
description: No Content - Decision processed successfully. description: No Content - Decision processed successfully.
@ -182,7 +156,7 @@ paths:
description: Unauthorized. description: Unauthorized.
/admin/appointments/report/{appointmentId}: /admin/appointments/report/{appointmentId}:
post: # Changed to POST for creation post:
operationId: createAppointmentReport operationId: createAppointmentReport
summary: Create a report for an appointment 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. description: Creates and links a new report (e.g., meeting minutes) to the specified appointment using the provided content.
@ -205,9 +179,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: "./main.yaml#/components/schemas/report" $ref: "./main.yaml#/components/schemas/report"
example:
value:
reportContent: "Discussed milestones. Action items assigned."
responses: responses:
"201": "201":
description: Created - Report created and linked successfully. Returns the created report. description: Created - Report created and linked successfully. Returns the created report.
@ -242,10 +213,6 @@ paths:
application/json: application/json:
schema: 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: responses:
"200": "200":
description: OK - Report updated successfully. Returns the updated report. description: OK - Report updated successfully. Returns the updated report.

View File

@ -10,7 +10,7 @@ tags:
description: API endpoints restricted to Admin users for management tasks. description: API endpoints restricted to Admin users for management tasks.
- name: Shared API - name: Shared API
description: API endpoints accessible by both Entrepreneurs and Admins. description: API endpoints accessible by both Entrepreneurs and Admins.
- name: Account Management API - name: Unauth API
description: API endpoints related to user account management. description: API endpoints related to user account management.
components: components:
schemas: schemas:
@ -182,32 +182,22 @@ components:
type: integer type: integer
description: The ID of the project the entrepreneur wants to join. description: The ID of the project the entrepreneur wants to join.
example: 12 example: 12
ApiError: projectDecision:
type: object type: object
description: Represents a decision from an admin to accept a pending project.
properties: properties:
timestamp: projectId:
type: string
format: date-time
description: Timestamp when the error occurred.
status:
type: integer type: integer
description: HTTP status code. description: The ID of the project the entrepreneur wants to join.
error: example: 12
type: string adminId:
description: 'High-level error description (e.g., Bad Request, Not Found).' type: integer
message: description: The ID of the project the admin who will supervise the project in case of admission.
type: string example: 2
description: A human-readable description of the error specific to this occurrence. isAccepted:
example: Required field 'projectName' is missing. type: boolean
path: description: The boolean value of the decision.
type: string example: 'true'
description: The path of the request that triggered the error.
required:
- timestamp
- status
- error
- message
- path
securitySchemes: securitySchemes:
MyINPulse: MyINPulse:
type: oauth2 type: oauth2
@ -240,9 +230,8 @@ servers:
default: MyInpulseRealm default: MyInpulseRealm
description: Keycloak realm name. description: Keycloak realm name.
paths: paths:
/accounts/finalize: /unauth/finalize:
post: post:
operationId: finalizeAccountSetup
summary: Finalize account setup using authentication token summary: Finalize account setup using authentication token
description: |- description: |-
Completes the user account creation/setup process in the MyInpulse system. Completes the user account creation/setup process in the MyInpulse system.
@ -250,21 +239,35 @@ paths:
User details (name, email, etc.) are extracted from the authenticated user's token (e.g., Keycloak JWT). User details (name, email, etc.) are extracted from the authenticated user's token (e.g., Keycloak JWT).
No request body is needed. The account is marked as pending admin validation upon successful finalization. No request body is needed. The account is marked as pending admin validation upon successful finalization.
tags: tags:
- Account Management API - Unauth API
security:
- MyINPulse:
- MyINPulse-entrepreneur
responses: responses:
'201': '201':
description: Created - Account finalized and pending admin validation. Returns the user profile. description: Created - Account finalized and pending admin validation. Returns the user profile.
content:
application/json:
schema:
$ref: '#/components/schemas/user-entrepreneur'
'400': '400':
description: Bad Request - Problem processing the token or user data derived from it. description: Bad Request - Problem processing the token or user data derived from it.
'401': '401':
description: Unauthorized - Valid authentication token required. description: Unauthorized - Valid authentication token required.
'/unauth/request-join/{projectId}':
post:
summary: Request to join an existing project
description: Submits a request for the authenticated user (keycloack authenticated) to join the project specified by projectId. Their role is then changed to entrepreneur in server and Keycloak. This requires approval from a project admin.
tags:
- Unauth API
parameters:
- in: path
name: projectId
required: true
schema:
type: integer
description: The ID of the project to request joining.
example: 15
responses:
'202':
description: Accepted - Join request submitted and pending approval.
'400':
description: Bad Request - Invalid project ID format or already member/request pending.
'401':
description: Unauthorized.
/admin/pending-accounts: /admin/pending-accounts:
get: get:
operationId: getPendingAccounts operationId: getPendingAccounts
@ -330,17 +333,6 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/project' $ref: '#/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': '400':
description: 'Bad Request - Invalid project data provided (e.g., missing required fields).' description: 'Bad Request - Invalid project data provided (e.g., missing required fields).'
'401': '401':
@ -361,11 +353,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/project' $ref: '#/components/schemas/project'
examples:
newProjectData:
value:
projectName: New Initiative
logo: base64encodedstring...
responses: responses:
'201': '201':
description: Created - Project added successfully. Returns the created project. description: Created - Project added successfully. Returns the created project.
@ -425,20 +412,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: object $ref: '#/components/schemas/projectDecision'
properties:
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: responses:
'204': '204':
description: No Content - Decision processed successfully. description: No Content - Decision processed successfully.
@ -471,9 +445,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/report' $ref: '#/components/schemas/report'
example:
value:
reportContent: Discussed milestones. Action items assigned.
responses: responses:
'201': '201':
description: Created - Report created and linked successfully. Returns the created report. description: Created - Report created and linked successfully. Returns the created report.
@ -509,10 +480,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/report' $ref: '#/components/schemas/report'
example:
value:
idReport: 987
reportContent: Updated discussion points. Final decisions made.
responses: responses:
'200': '200':
description: OK - Report updated successfully. Returns the updated report. description: OK - Report updated successfully. Returns the updated report.
@ -673,7 +640,7 @@ paths:
description: Forbidden - User does not have access to this project. description: Forbidden - User does not have access to this project.
'404': '404':
description: Not Found - Project not found. description: Not Found - Project not found.
'/shared/projects/admins/{projectId}': '/shared/projects/admin/{projectId}':
get: get:
operationId: getProjectAdmins operationId: getProjectAdmins
summary: Get admins associated with a project summary: Get admins associated with a project
@ -697,9 +664,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: array $ref: '#/components/schemas/user-admin'
items:
$ref: '#/components/schemas/user-admin'
'401': '401':
description: Unauthorized. description: Unauthorized.
'403': '403':
@ -798,31 +763,6 @@ paths:
description: Bad Request - Invalid appointment details. description: Bad Request - Invalid appointment details.
'401': '401':
description: Unauthorized. description: Unauthorized.
'/entrepreneur/projects/request-join/{projectId}':
post:
operationId: requestToJoinProject
summary: Request to join an existing project
description: Submits a request for the authenticated entrepreneur to join the project specified by projectId. This requires approval from a project admin.
tags:
- Entrepreneurs API
security:
- MyINPulse:
- MyINPulse-entrepreneur
parameters:
- in: path
name: projectId
required: true
schema:
type: integer
description: The ID of the project to request joining.
example: 15
responses:
'202':
description: Accepted - Join request submitted and pending approval.
'400':
description: Bad Request - Invalid project ID format or already member/request pending.
'401':
description: Unauthorized.
/entrepreneur/projects/request: /entrepreneur/projects/request:
post: post:
operationId: requestProjectCreation operationId: requestProjectCreation
@ -850,18 +790,6 @@ paths:
description: 'Bad Request - Invalid input (e.g., missing name).' description: 'Bad Request - Invalid input (e.g., missing name).'
'401': '401':
description: Unauthorized. description: Unauthorized.
'403':
description: Forbidden - User does not have entrepreneur privileges.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'500':
description: Internal Server Error.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
/entrepreneur/sectionCells: /entrepreneur/sectionCells:
post: post:
operationId: addSectionCell operationId: addSectionCell

View File

@ -27,39 +27,6 @@ paths:
description: Bad Request - Invalid input (e.g., missing name). description: Bad Request - Invalid input (e.g., missing name).
"401": "401":
description: Unauthorized. description: Unauthorized.
"403":
description: Forbidden - User does not have entrepreneur privileges.
content:
application/json: { schema: { $ref: "./main.yaml#/components/schemas/ApiError" } }
"500":
description: Internal Server Error.
content:
application/json: { schema: { $ref: "./main.yaml#/components/schemas/ApiError" } }
/entrepreneur/projects/request-join/{projectId}:
post:
operationId: requestToJoinProject
summary: Request to join an existing project
description: Submits a request for the authenticated entrepreneur to join the project specified by projectId. This requires approval from a project admin.
tags:
- Entrepreneurs API
security:
- MyINPulse: [MyINPulse-entrepreneur]
parameters:
- in: path
name: projectId
required: true
schema:
type: integer
description: The ID of the project to request joining.
example: 15
responses: # Moved responses block to correct level
"202":
description: Accepted - Join request submitted and pending approval.
"400":
description: Bad Request - Invalid project ID format or already member/request pending.
"401":
description: Unauthorized.
/entrepreneur/sectionCells: # Base path /entrepreneur/sectionCells: # Base path
post: post:

View File

@ -11,7 +11,7 @@ tags:
description: API endpoints restricted to Admin users for management tasks. description: API endpoints restricted to Admin users for management tasks.
- name: Shared API - name: Shared API
description: API endpoints accessible by both Entrepreneurs and Admins. description: API endpoints accessible by both Entrepreneurs and Admins.
- name: Account Management API - name: Unauth API
description: API endpoints related to user account management. description: API endpoints related to user account management.
components: components:
@ -32,32 +32,8 @@ components:
$ref: "models.yaml#/appointment" $ref: "models.yaml#/appointment"
joinRequest: joinRequest:
$ref: "models.yaml#/joinRequest" $ref: "models.yaml#/joinRequest"
ApiError: projectDecision:
type: object $ref: "models.yaml#/projectDecision"
properties:
timestamp:
type: string
format: date-time
description: Timestamp when the error occurred.
status:
type: integer
description: HTTP status code.
error:
type: string
description: High-level error description (e.g., Bad Request, Not Found).
message:
type: string
description: A human-readable description of the error specific to this occurrence.
example: Required field 'projectName' is missing.
path:
type: string
description: The path of the request that triggered the error.
required:
- timestamp
- status
- error
- message
- path
securitySchemes: securitySchemes:
MyINPulse: MyINPulse:
@ -97,8 +73,10 @@ paths:
# \___/|_| |_|\__,_|\__,_|\__|_| |_/_/ \_\ .__/|_| # \___/|_| |_|\__,_|\__,_|\__|_| |_/_/ \_\ .__/|_|
# |_| # |_|
/accounts/finalize: /unauth/finalize:
$ref: "./unauthApi.yaml#/paths/~1accounts~1finalize" $ref: "./unauthApi.yaml#/paths/~1unauth~1finalize"
/unauth/request-join/{projectId}:
$ref: "./unauthApi.yaml#/paths/~1unauth~1request-join~1{projectId}"
# _ ____ __ __ ___ _ _ _ ____ ___ # _ ____ __ __ ___ _ _ _ ____ ___
# / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _| # / \ | _ \| \/ |_ _| \ | | / \ | _ \_ _|
@ -135,8 +113,8 @@ paths:
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1sectionCells~1{projectId}~1{sectionId}~1{date}" $ref: "./sharedApi.yaml#/paths/~1shared~1projects~1sectionCells~1{projectId}~1{sectionId}~1{date}"
/shared/projects/entrepreneurs/{projectId}: /shared/projects/entrepreneurs/{projectId}:
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1entrepreneurs~1{projectId}" $ref: "./sharedApi.yaml#/paths/~1shared~1projects~1entrepreneurs~1{projectId}"
/shared/projects/admins/{projectId}: /shared/projects/admin/{projectId}:
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1admins~1{projectId}" $ref: "./sharedApi.yaml#/paths/~1shared~1projects~1admin~1{projectId}"
/shared/projects/appointments/{projectId}: /shared/projects/appointments/{projectId}:
$ref: "./sharedApi.yaml#/paths/~1shared~1projects~1appointments~1{projectId}" $ref: "./sharedApi.yaml#/paths/~1shared~1projects~1appointments~1{projectId}"
/shared/appointments/report/{appointmentId}: /shared/appointments/report/{appointmentId}:
@ -154,8 +132,6 @@ paths:
# / ___ \| __/| | # / ___ \| __/| |
# /_/ \_\_| |___| # /_/ \_\_| |___|
# #
/entrepreneur/projects/request-join/{projectId}:
$ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1projects~1request-join~1{projectId}"
/entrepreneur/projects/request: /entrepreneur/projects/request:
$ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1projects~1request" $ref: "./entrepreneurApi.yaml#/paths/~1entrepreneur~1projects~1request"
/entrepreneur/sectionCells: /entrepreneur/sectionCells:

View File

@ -180,4 +180,21 @@ joinRequest:
description: The ID of the project the entrepreneur wants to join. description: The ID of the project the entrepreneur wants to join.
example: 12 example: 12
# Consider adding userId if the requester isn't implicit from auth context # Consider adding userId if the requester isn't implicit from auth context
# Consider adding a message field # Consider adding a message field
projectDecision:
type: object
description: Represents a decision from an admin to accept a pending project.
properties:
projectId:
type: integer
description: The ID of the project the entrepreneur wants to join.
example: 12
adminId:
type: integer
description: The ID of the project the admin who will supervise the project in case of admission.
example: 2
isAccepted:
type: boolean
description: The boolean value of the decision.
example: "true"

View File

@ -93,7 +93,7 @@ paths:
"404": "404":
description: Not Found - Project not found. description: Not Found - Project not found.
/shared/projects/admins/{projectId}: # Path updated /shared/projects/admin/{projectId}: # Path updated
get: get:
operationId: getProjectAdmins operationId: getProjectAdmins
summary: Get admins associated with a project summary: Get admins associated with a project
@ -114,9 +114,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: array $ref: "./main.yaml#/components/schemas/user-admin"
items:
$ref: "./main.yaml#/components/schemas/user-admin"
"401": "401":
description: Unauthorized. description: Unauthorized.
"403": "403":

View File

@ -7,9 +7,8 @@
# |_| # |_|
paths: paths:
/accounts/finalize: # Path renamed from /unauth/create_account /unauth/finalize:
post: post:
operationId: finalizeAccountSetup # Renamed operationId
summary: Finalize account setup using authentication token summary: Finalize account setup using authentication token
description: |- description: |-
Completes the user account creation/setup process in the MyInpulse system. Completes the user account creation/setup process in the MyInpulse system.
@ -17,18 +16,45 @@ paths:
User details (name, email, etc.) are extracted from the authenticated user's token (e.g., Keycloak JWT). User details (name, email, etc.) are extracted from the authenticated user's token (e.g., Keycloak JWT).
No request body is needed. The account is marked as pending admin validation upon successful finalization. No request body is needed. The account is marked as pending admin validation upon successful finalization.
tags: tags:
- Account Management API # Changed tag - Unauth API
security:
- MyINPulse: [MyINPulse-entrepreneur] # Security requirement remains as per clarification
# No requestBody needed as per clarification
responses: responses:
"201": # Use 201 Created or 200 OK if it returns the user profile "201":
description: Created - Account finalized and pending admin validation. Returns the user profile. description: Created - Account finalized and pending admin validation. Returns the user profile.
content:
application/json:
schema:
$ref: './main.yaml#/components/schemas/user-entrepreneur' # Return the created user profile
"400": "400":
description: Bad Request - Problem processing the token or user data derived from it. description: Bad Request - Problem processing the token or user data derived from it.
"401": "401":
description: Unauthorized - Valid authentication token required. description: Unauthorized - Valid authentication token required.
/unauth/request-join/{projectId}:
post:
summary: Request to join an existing project
description: Submits a request for the authenticated user (keycloack authenticated) to join the project specified by projectId. Their role is then changed to entrepreneur in server and Keycloak. This requires approval from a project admin.
tags:
- Unauth API
parameters:
- in: path
name: projectId
required: true
schema:
type: integer
description: The ID of the project to request joining.
example: 15
responses: # Moved responses block to correct level
"202":
description: Accepted - Join request submitted and pending approval.
"400":
description: Bad Request - Invalid project ID format or already member/request pending.
"401":
description: Unauthorized.
/unauth/request-admin-role:
post:
summary: Request to join an existing project
description: Submits a request for the authenticated user (keycloack authenticated) to become an admin. Their role is then changed to admin in server and Keycloak. This requires approval from a project admin.
tags:
- Unauth API
responses:
"202":
description: Accepted - Become admin request submitted and pending approval.
"400":
description: Bad Request - Invalid project ID format or already member/request pending.
"401":
description: Unauthorized.