feature/create-organization#48
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a feature for creating organizations with full validations, endpoints, and related documentation. Key changes include:
- Adding a Joi-based validation schema for organization input.
- Introducing new routes and controllers for organization creation.
- Updating documentation via Swagger comments.
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/validations/organization.validation.js | Added Joi validation schema for organization creation. |
| src/routes/organization.routes.js | Added new route for organization creation with Swagger docs. |
| src/middlewares/errorHandler.middleware.js | Minor update in error response structure. |
| src/middlewares/auth.middleware.js | Updated JWT environment variable name. |
| src/index.js | Imported and registered organization routes. |
| src/controllers/organization.controller.js | Implemented organization creation logic with OTP email verification. |
Files not reviewed (2)
- prisma/migrations/20250403085553_org/migration.sql: Language not supported
- prisma/schema/models/organization.model.prisma: Language not supported
Comments suppressed due to low confidence (3)
src/validations/organization.validation.js:3
- The function name 'creatOrganizationValidation' appears to have a typo; consider renaming it to 'createOrganizationValidation' for clarity and consistency.
export const creatOrganizationValidation = (obj) => {
src/routes/organization.routes.js:2
- The imported function 'creatOrganization' appears to have a typo; consider renaming it to 'createOrganization' to align with standard naming conventions.
import { creatOrganization } from '../controllers/organization.controller.js';
src/controllers/organization.controller.js:4
- The imported validation function 'creatOrganizationValidation' appears to have a typo; consider renaming it to 'createOrganizationValidation'.
import { creatOrganizationValidation } from '../validations/organization.validation.js';
| await sendEmail({ | ||
| to: contactEmail, | ||
| subject: 'Verify Your Organization Email', | ||
| text: `Organization name: ${result.org.name}\nYour verification code is: ${verificationOTP}. will expired in 10 min`, |
There was a problem hiding this comment.
[nitpick] Consider correcting the text message to 'will expire in 10 min' for improved clarity.
Suggested change
| text: `Organization name: ${result.org.name}\nYour verification code is: ${verificationOTP}. will expired in 10 min`, | |
| text: `Organization name: ${result.org.name}\nYour verification code is: ${verificationOTP}. will expire in 10 min`, |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist (required)
Please check if your PR fulfills the following requirements:
The commit message follows our guidelines.
Tests for the changes have been added (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
Related Issue
Closes #47