Skip to content

added CURD for comment#3

Open
Yoinami wants to merge 3 commits into
developfrom
ft/comment-service
Open

added CURD for comment#3
Yoinami wants to merge 3 commits into
developfrom
ft/comment-service

Conversation

@Yoinami

@Yoinami Yoinami commented Feb 28, 2026

Copy link
Copy Markdown
Collaborator

This pull request implements a complete comment system backend, including controller, service, repository, validation, and error handling. The main focus is on enabling CRUD operations for comments, supporting nested replies, and improving error responses for validation and database errors.

Comment System Implementation:

  • Added full CRUD operations for comments, including support for nested replies and validation using Zod in comment.controller.ts, comment.service.ts, and comment.repository.ts. This includes creating, fetching (single and by post), updating, and deleting comments, with proper authentication and authorization checks. [1] [2] [3] [4] [5] [6] [7] [8]

  • Introduced Zod-based DTO schemas for validating comment operations, ensuring request data integrity for create, update, and delete actions.

Error Handling Improvements:

  • Enhanced the global error handler to properly handle Zod validation errors and Mongoose CastError, returning clear error messages for invalid input and malformed IDs. [1] [2]

Database Model Update:

  • Updated the IComment interface to include an optional replies field, supporting nested comment structures.

Configuration:

  • Added a .env.example file with environment variable templates for app, database, authentication, Cloudinary, Facebook integration, and rate limiting.

@Yoinami

Yoinami commented Feb 28, 2026

Copy link
Copy Markdown
Collaborator Author

there are some github workflow error in the in CI / docker-build

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.

2 participants