Skip to content

feature/create-organization#48

Merged
mdawoud27 merged 11 commits into
mainfrom
feature/47/create_organization
Apr 3, 2025
Merged

feature/create-organization#48
mdawoud27 merged 11 commits into
mainfrom
feature/47/create_organization

Conversation

@mdawoud27
Copy link
Copy Markdown
Contributor

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?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation changes
  • Other... Please describe:

Related Issue

Closes #47

@mdawoud27 mdawoud27 added documentation Improvements or additions to documentation enhancement New feature or request feature For new feature labels Apr 3, 2025
@mdawoud27 mdawoud27 requested a review from Copilot April 3, 2025 11:54
@mdawoud27 mdawoud27 self-assigned this Apr 3, 2025
@mdawoud27 mdawoud27 linked an issue Apr 3, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`,
Copy link

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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`,

Copilot uses AI. Check for mistakes.
@mdawoud27 mdawoud27 merged commit 757b93e into main Apr 3, 2025
11 checks passed
@mdawoud27 mdawoud27 deleted the feature/47/create_organization branch April 3, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request feature For new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Create an organization

2 participants