fix: aadded changes, doc is ssomewhat coherent still need to change some endpoint names in controller and some minor changes
This commit is contained in:
@ -10,7 +10,7 @@ tags:
|
||||
description: API endpoints restricted to Admin users for management tasks.
|
||||
- name: Shared API
|
||||
description: API endpoints accessible by both Entrepreneurs and Admins.
|
||||
- name: Account Management API
|
||||
- name: Unauth API
|
||||
description: API endpoints related to user account management.
|
||||
components:
|
||||
schemas:
|
||||
@ -182,32 +182,22 @@ components:
|
||||
type: integer
|
||||
description: The ID of the project the entrepreneur wants to join.
|
||||
example: 12
|
||||
ApiError:
|
||||
projectDecision:
|
||||
type: object
|
||||
description: Represents a decision from an admin to accept a pending project.
|
||||
properties:
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the error occurred.
|
||||
status:
|
||||
projectId:
|
||||
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
|
||||
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'
|
||||
securitySchemes:
|
||||
MyINPulse:
|
||||
type: oauth2
|
||||
@ -240,9 +230,8 @@ servers:
|
||||
default: MyInpulseRealm
|
||||
description: Keycloak realm name.
|
||||
paths:
|
||||
/accounts/finalize:
|
||||
/unauth/finalize:
|
||||
post:
|
||||
operationId: finalizeAccountSetup
|
||||
summary: Finalize account setup using authentication token
|
||||
description: |-
|
||||
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).
|
||||
No request body is needed. The account is marked as pending admin validation upon successful finalization.
|
||||
tags:
|
||||
- Account Management API
|
||||
security:
|
||||
- MyINPulse:
|
||||
- MyINPulse-entrepreneur
|
||||
- Unauth API
|
||||
responses:
|
||||
'201':
|
||||
description: Created - Account finalized and pending admin validation. Returns the user profile.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/user-entrepreneur'
|
||||
'400':
|
||||
description: Bad Request - Problem processing the token or user data derived from it.
|
||||
'401':
|
||||
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:
|
||||
get:
|
||||
operationId: getPendingAccounts
|
||||
@ -330,17 +333,6 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$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':
|
||||
description: 'Bad Request - Invalid project data provided (e.g., missing required fields).'
|
||||
'401':
|
||||
@ -361,11 +353,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/project'
|
||||
examples:
|
||||
newProjectData:
|
||||
value:
|
||||
projectName: New Initiative
|
||||
logo: base64encodedstring...
|
||||
responses:
|
||||
'201':
|
||||
description: Created - Project added successfully. Returns the created project.
|
||||
@ -425,20 +412,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
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
|
||||
$ref: '#/components/schemas/projectDecision'
|
||||
responses:
|
||||
'204':
|
||||
description: No Content - Decision processed successfully.
|
||||
@ -471,9 +445,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/report'
|
||||
example:
|
||||
value:
|
||||
reportContent: Discussed milestones. Action items assigned.
|
||||
responses:
|
||||
'201':
|
||||
description: Created - Report created and linked successfully. Returns the created report.
|
||||
@ -509,10 +480,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/report'
|
||||
example:
|
||||
value:
|
||||
idReport: 987
|
||||
reportContent: Updated discussion points. Final decisions made.
|
||||
responses:
|
||||
'200':
|
||||
description: OK - Report updated successfully. Returns the updated report.
|
||||
@ -673,7 +640,7 @@ paths:
|
||||
description: Forbidden - User does not have access to this project.
|
||||
'404':
|
||||
description: Not Found - Project not found.
|
||||
'/shared/projects/admins/{projectId}':
|
||||
'/shared/projects/admin/{projectId}':
|
||||
get:
|
||||
operationId: getProjectAdmins
|
||||
summary: Get admins associated with a project
|
||||
@ -697,9 +664,7 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/user-admin'
|
||||
$ref: '#/components/schemas/user-admin'
|
||||
'401':
|
||||
description: Unauthorized.
|
||||
'403':
|
||||
@ -798,31 +763,6 @@ paths:
|
||||
description: Bad Request - Invalid appointment details.
|
||||
'401':
|
||||
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:
|
||||
post:
|
||||
operationId: requestProjectCreation
|
||||
@ -850,18 +790,6 @@ paths:
|
||||
description: 'Bad Request - Invalid input (e.g., missing name).'
|
||||
'401':
|
||||
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:
|
||||
post:
|
||||
operationId: addSectionCell
|
||||
|
Reference in New Issue
Block a user