Skip to content

Develop#21

Merged
exploitenomah merged 59 commits intomainfrom
develop
Mar 9, 2026
Merged

Develop#21
exploitenomah merged 59 commits intomainfrom
develop

Conversation

@exploitenomah
Copy link
Contributor

@exploitenomah exploitenomah commented Mar 9, 2026

No description provided.

* chore: fix linting errors

* chore: husky pre-commit setup
* feat: create login endpoint

* tests: fix failing tests

* refactor: auth utils refactoring

* fix: documentation setup

* feat: create get /me route

* feat: create get /me route
- Create shared test helpers for auth tests (testHelpers.ts)
- Extract common test constants (verifiedUserEmail, testPassword, etc.)
- Extract createSignedAccessTokenCookie function to shared helpers
- Update all auth integration tests to use shared helpers
- Add reusable passwordSchema with conventional password rules:
  - Minimum 8 characters
  - At least one uppercase letter
  - At least one lowercase letter
  - At least one number
  - At least one special character
- Update signupSchema and changePasswordSchema to use passwordSchema
- Add forgot password endpoint (POST /api/v1/auth/forgot-password)
- Add reset password endpoint (POST /api/v1/auth/reset-password)
- Extract email template keys to environment variables
- Create reusable emailSchema for DRY validation
- Add password reset fields and methods to user model
- Refactor code generation to use shared helper function
- Add comprehensive integration tests for forgot/reset password
- Add unit tests for password reset code logic
- Fix verify email unit test to properly test clearing
- Update user model pre-save hooks to handle null values correctly
- Remove organization creation logic from signup flow
- Simplify signup schema to only require user fields
- Rename signupOwner to signup for clarity
- Remove organization-related fields from signup input/output
- Update tests to remove organization-related test cases
- Clean up verifyEmail tests to remove unused organization fields
- Update API documentation to reflect simplified signup
* feat(org): implement organization creation endpoint with membership module

- Add POST /api/v1/org endpoint to create organizations
- Create separate membership module with model, service, controller, routes, and docs
- Create OWNER membership automatically when organization is created
- Add comprehensive integration tests for organization creation
- Fix unit tests for email verification and password reset (add save() calls for pre-save hooks)
- Update organization service to use membership service
- Follow existing codebase patterns and DRY principles

* feat(org): add GET /org endpoint to retrieve organization with caller role

- Add GET /api/v1/org endpoint that returns organization and user's role
- Add getMembershipByUserAndOrg service method
- Add getOrganizationWithUserRole service method
- Update validateResource middleware to support query parameter validation
- Remove console.log from resetPassword unit test
- Add proper error handling (404 for not found, 403 for not a member)

* feat(org): enforce one organization per user and simplify GET endpoint

- Update POST /org to return 409 if user already has an organization
- Simplify GET /org to automatically retrieve user's organization (no orgId needed)
- Add getUserOrganization service method
- Add AppError.conflict() for 409 status code
- Update all tests to reflect one organization per user constraint
- Refactor getOrganization tests to use separate describe blocks
- Update API documentation

* feat(org): add GET /org/members endpoint for OWNER/ADMIN

- Add requireRole middleware for role-based access control
- Implement getOrganizationMembers service method
- Add getOrganizationMembers controller handler
- Add GET /org/members route protected by OWNER/ADMIN roles
- Add OrganizationMember and GetOrganizationMembersOutput types
- Update API documentation
- Add comprehensive integration tests (13 tests)
- Update membership service to populate user data and sort by creation date

* refactor

* create accept invite endpoint

* feat: add security middleware (helmet, rate-limit), cors config and integration tests

* feat: implement time entry module, standardize ID mapping, and strengthen type safety

* feat: add Phase 4 - Docker, Render config, and structured logging with pino

- Add Dockerfile (multi-stage build) and docker-compose.yml (API + MongoDB)
- Add .dockerignore and render.yaml (Render IaC blueprint)
- Replace console.log/error with pino structured logging
- Replace morgan with pino-http for HTTP request logging
- Add server-side error logging in errorHandler
- Remove debug console.log in membership.service
- Uninstall morgan, install pino/pino-http/pino-pretty

* ci: optimize CI to run affected tests on PRs and full suite on push
* feat(org): implement organization creation endpoint with membership module

- Add POST /api/v1/org endpoint to create organizations
- Create separate membership module with model, service, controller, routes, and docs
- Create OWNER membership automatically when organization is created
- Add comprehensive integration tests for organization creation
- Fix unit tests for email verification and password reset (add save() calls for pre-save hooks)
- Update organization service to use membership service
- Follow existing codebase patterns and DRY principles

* feat(org): add GET /org endpoint to retrieve organization with caller role

- Add GET /api/v1/org endpoint that returns organization and user's role
- Add getMembershipByUserAndOrg service method
- Add getOrganizationWithUserRole service method
- Update validateResource middleware to support query parameter validation
- Remove console.log from resetPassword unit test
- Add proper error handling (404 for not found, 403 for not a member)

* feat(org): enforce one organization per user and simplify GET endpoint

- Update POST /org to return 409 if user already has an organization
- Simplify GET /org to automatically retrieve user's organization (no orgId needed)
- Add getUserOrganization service method
- Add AppError.conflict() for 409 status code
- Update all tests to reflect one organization per user constraint
- Refactor getOrganization tests to use separate describe blocks
- Update API documentation

* feat(org): add GET /org/members endpoint for OWNER/ADMIN

- Add requireRole middleware for role-based access control
- Implement getOrganizationMembers service method
- Add getOrganizationMembers controller handler
- Add GET /org/members route protected by OWNER/ADMIN roles
- Add OrganizationMember and GetOrganizationMembersOutput types
- Update API documentation
- Add comprehensive integration tests (13 tests)
- Update membership service to populate user data and sort by creation date

* refactor

* create accept invite endpoint

* feat: add security middleware (helmet, rate-limit), cors config and integration tests

* feat: implement time entry module, standardize ID mapping, and strengthen type safety

* feat: add Phase 4 - Docker, Render config, and structured logging with pino

- Add Dockerfile (multi-stage build) and docker-compose.yml (API + MongoDB)
- Add .dockerignore and render.yaml (Render IaC blueprint)
- Replace console.log/error with pino structured logging
- Replace morgan with pino-http for HTTP request logging
- Add server-side error logging in errorHandler
- Remove debug console.log in membership.service
- Uninstall morgan, install pino/pino-http/pino-pretty

* ci: optimize CI to run affected tests on PRs and full suite on push
* feat(org): implement organization creation endpoint with membership module

- Add POST /api/v1/org endpoint to create organizations
- Create separate membership module with model, service, controller, routes, and docs
- Create OWNER membership automatically when organization is created
- Add comprehensive integration tests for organization creation
- Fix unit tests for email verification and password reset (add save() calls for pre-save hooks)
- Update organization service to use membership service
- Follow existing codebase patterns and DRY principles

* feat(org): add GET /org endpoint to retrieve organization with caller role

- Add GET /api/v1/org endpoint that returns organization and user's role
- Add getMembershipByUserAndOrg service method
- Add getOrganizationWithUserRole service method
- Update validateResource middleware to support query parameter validation
- Remove console.log from resetPassword unit test
- Add proper error handling (404 for not found, 403 for not a member)

* feat(org): enforce one organization per user and simplify GET endpoint

- Update POST /org to return 409 if user already has an organization
- Simplify GET /org to automatically retrieve user's organization (no orgId needed)
- Add getUserOrganization service method
- Add AppError.conflict() for 409 status code
- Update all tests to reflect one organization per user constraint
- Refactor getOrganization tests to use separate describe blocks
- Update API documentation

* feat(org): add GET /org/members endpoint for OWNER/ADMIN

- Add requireRole middleware for role-based access control
- Implement getOrganizationMembers service method
- Add getOrganizationMembers controller handler
- Add GET /org/members route protected by OWNER/ADMIN roles
- Add OrganizationMember and GetOrganizationMembersOutput types
- Update API documentation
- Add comprehensive integration tests (13 tests)
- Update membership service to populate user data and sort by creation date

* refactor

* create accept invite endpoint

* feat: add security middleware (helmet, rate-limit), cors config and integration tests

* feat: implement time entry module, standardize ID mapping, and strengthen type safety

* feat: add Phase 4 - Docker, Render config, and structured logging with pino

- Add Dockerfile (multi-stage build) and docker-compose.yml (API + MongoDB)
- Add .dockerignore and render.yaml (Render IaC blueprint)
- Replace console.log/error with pino structured logging
- Replace morgan with pino-http for HTTP request logging
- Add server-side error logging in errorHandler
- Remove debug console.log in membership.service
- Uninstall morgan, install pino/pino-http/pino-pretty

* ci: optimize CI to run affected tests on PRs and full suite on push

* Update render.yaml

* Install pino pretty as a dep
@exploitenomah exploitenomah merged commit f7bfafd into main Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant