-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: User management endpoints documention.
- Loading branch information
1 parent
86e0093
commit 2a339b2
Showing
4 changed files
with
152 additions
and
22 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
brints-estate-api/src/users/swagger_docs/common-reponses.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
export const UnauthorizedUserVerifiedResponse = { | ||
description: 'Unauthorized', | ||
status: HttpStatus.UNAUTHORIZED, | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
success: { | ||
type: 'boolean', | ||
example: false, | ||
}, | ||
status_code: { | ||
type: 'number', | ||
example: HttpStatus.UNAUTHORIZED, | ||
}, | ||
message: { | ||
type: 'string', | ||
example: 'User already verified', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const InternalServerErrorResponse = { | ||
description: 'Internal server error', | ||
status: HttpStatus.INTERNAL_SERVER_ERROR, | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
success: { | ||
type: 'boolean', | ||
example: false, | ||
}, | ||
status_code: { | ||
type: 'number', | ||
example: HttpStatus.INTERNAL_SERVER_ERROR, | ||
}, | ||
message: { | ||
type: 'string', | ||
example: 'Internal server error. Please try again later', | ||
}, | ||
}, | ||
}, | ||
}; |
63 changes: 63 additions & 0 deletions
63
brints-estate-api/src/users/swagger_docs/verify-email.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
export const BadRequestInvalidTokenResponse = { | ||
description: 'Bad request', | ||
status: HttpStatus.BAD_REQUEST, | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
success: { | ||
type: 'boolean', | ||
example: false, | ||
}, | ||
status_code: { | ||
type: 'number', | ||
example: HttpStatus.BAD_REQUEST, | ||
}, | ||
message: { | ||
type: 'string', | ||
example: 'Invalid token', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const ForbiddenTokenExpiredResponse = { | ||
description: 'Forbidden', | ||
status: HttpStatus.FORBIDDEN, | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
success: { | ||
type: 'boolean', | ||
example: false, | ||
}, | ||
status_code: { | ||
type: 'number', | ||
example: HttpStatus.FORBIDDEN, | ||
}, | ||
message: { | ||
type: 'string', | ||
example: 'Token expired', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const VerifyEmailResponse = { | ||
description: 'User email verified successfully', | ||
status: HttpStatus.OK, | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
status_code: { | ||
type: 'number', | ||
example: HttpStatus.OK, | ||
}, | ||
message: { | ||
type: 'string', | ||
example: 'Your email has been verified successfully.', | ||
}, | ||
}, | ||
}, | ||
}; |
19 changes: 19 additions & 0 deletions
19
brints-estate-api/src/users/swagger_docs/verify-phone-response.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
export const VerifyPhoneResponse = { | ||
description: 'User phone number verified successfully', | ||
status: HttpStatus.OK, | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
status_code: { | ||
type: 'number', | ||
example: HttpStatus.OK, | ||
}, | ||
message: { | ||
type: 'string', | ||
example: 'Your phone number has been verified successfully.', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters