Commit Graph

364 Commits

Author SHA1 Message Date
77e3526564 feat: add scheduleDates field to ScheduleSchema for retrieving schedule dates
- Introduced a new `scheduleDates` field in the ScheduleSchema to allow users to fetch a list of schedule dates.
- Implemented argument handling for pagination and filtering, ensuring efficient data retrieval.
- Added error handling to prevent access during subscriptions and ensure user authentication before data access.
- Enhanced the overall functionality of the ScheduleSchema, improving user experience and data management.
2024-12-07 16:05:12 +07:00
d72c647acd feat: add QuizModule to GraphQL module imports
- Integrated QuizModule into the GraphQL module to enhance quiz-related functionalities.
- Updated module imports to ensure proper dependency management and maintainability of the codebase.
2024-12-07 15:56:19 +07:00
429c6f9073 chore: remove Milestone module and update related schemas
- Deleted the MilestoneModule and its associated schema to streamline the codebase.
- Updated QuizSchema to replace scheduleId with serviceId, enhancing the relationship structure.
- Removed references to Milestone in ServiceSchema, improving clarity and focus on relevant entities.
- Updated Prisma types to reflect the removal of Milestone, ensuring data integrity across the application.
2024-12-07 15:33:28 +07:00
4af2e848b8 feat: implement Quiz and Question schemas with GraphQL integration
- Introduced QuizSchema and QuestionSchema extending PothosSchema for enhanced GraphQL capabilities.
- Added methods to expose Quiz and Question fields, including relations and various attributes.
- Implemented query and mutation fields for creating, updating, and retrieving quizzes, ensuring proper authentication and error handling.
- Enhanced the overall structure of the schema to improve data integrity and access control.
2024-12-06 21:52:11 +07:00
5e68b1e11a feat: add PersonalMilestone and Quiz relations to Prisma types
- Introduced PersonalMilestone entity to the Prisma types, enhancing the schema with new relationships.
- Updated existing relations in various schemas to include PersonalMilestone and Quiz, improving data structure and integrity.
- Modified relation names and lists to accommodate the new entities, ensuring comprehensive coverage of the data model.
2024-12-06 21:26:51 +07:00
6cbaf44c7f chore: update subproject commit and enhance ServiceFeedback schema
- Updated the subproject commit reference in epess-database to the latest version.
- Added Logger to the ServiceFeedback schema for improved logging of arguments during feedback submission.
- Modified the Prisma types to include new Quiz and Question entities, enhancing the schema's capabilities and data structure.
2024-12-06 21:25:25 +07:00
59b221a6ee chore: update subproject commit and modify prisma studio command
- Updated the subproject commit reference in epess-database to the latest version.
- Modified the prisma studio command in package.json to use dotenv for environment variable management, enhancing configuration flexibility.
2024-12-06 19:06:27 +07:00
46074c89b0 feat: enhance WorkshopMeetingRoomSchema with join info and LiveKit integration
- Added a new method `workshopMeetingRoomJoinInfo` to provide details for joining a workshop meeting room, including ID, token, and server URL.
- Integrated LiveKitService to generate tokens and retrieve server URLs, improving the functionality of the workshop meeting room.
- Updated the `init` method to include the new join info field, ensuring proper resolution and access control for users.
- Enhanced error handling to ensure unauthorized access is properly managed during the join process.
2024-12-06 17:03:45 +07:00
4931f382b3 feat: implement createServiceFeedback mutation in ServiceFeedbackSchema
- Added a new mutation field `createServiceFeedback` to allow users to submit feedback for services.
- Implemented validation checks to ensure only authorized users (CUSTOMER role) can submit feedback for completed orders.
- Included error handling for invalid ratings and comment length, enhancing data integrity and user experience.
- Improved the overall structure and clarity of the ServiceFeedbackSchema by integrating the new mutation.
2024-12-06 16:57:04 +07:00
db2b3e9dd4 fix: enhance collaborator access check in DocumentSchema
- Updated the collaborator access check in the DocumentSchema to ensure that a user must have both writable and readable permissions to access a document.
- Improved error handling by providing a more precise condition for user access, enhancing security and clarity in document collaboration.
2024-12-06 16:34:49 +07:00
6d28d74351 refactor: unify logging messages in CronService for consistency
- Updated log messages in the CronService to use a consistent logger context ('CronService') across all scheduled tasks.
- Improved traceability and readability of log outputs by standardizing the log context, enhancing debugging capabilities.
2024-12-05 22:56:22 +07:00
eb05610b23 refactor: streamline import statements in GraphQL service and ServiceSchema
- Consolidated import paths in graphql.service.ts and service.schema.ts to use relative paths for improved organization and consistency.
- Enhanced code readability by reducing unnecessary line breaks in import statements.
2024-12-05 22:51:48 +07:00
bbec8aba03 refactor: update import paths in GraphQL module for consistency
- Changed import paths in graphql.module.ts to use relative paths for better organization and consistency.
- Enhanced logging in the GraphQL module by adding the module name to log messages, improving traceability during debugging.
2024-12-05 22:49:53 +07:00
6eafc6d5ef fix: improve error handling in GraphQL connection parameters
- Replaced error throws with logging for missing connection parameters in the GraphQL module.
- Enhanced the logging mechanism to provide better insights during connection failures, improving overall debugging and monitoring capabilities.
2024-12-05 22:47:26 +07:00
de46499288 feat: add notification messaging for service approval and rejection in ServiceSchema
- Implemented user notification system by creating messages in the database when a service is approved or rejected.
- Utilized the new Message and PubSubEvent classes to handle notifications effectively.
- Enhanced user experience by informing users of service status changes through direct messages.
2024-12-05 22:41:25 +07:00
37b0086b4d feat: update file output paths and add feedback tracking to service schema
- Modified file output paths in LiveKitRoomService to utilize the BUCKET_NAME environment variable for dynamic S3 storage.
- Introduced a new `feedbacked` field in ServiceSchema to track whether a user has provided feedback for a service, enhancing user interaction capabilities.
- Cleaned up the ServiceFeedback schema by refining the resolve function for better clarity and consistency.
2024-12-05 22:11:40 +07:00
1b7329bb44 feat: add completedOrders field to Order schema and enhance workshop subscription error handling
- Introduced a new `completedOrders` field in the Order schema to retrieve a list of completed orders for the authenticated user, filtering by order status and schedule dates.
- Enhanced error handling in the WorkshopSubscription schema to prevent retrieval in subscription context, improving the robustness of the API.
- Updated imports in order.schema.ts to include additional status types from Prisma for better functionality.
2024-12-05 21:31:38 +07:00
0d973a6544 refactor: update getRoomRecordUrl method in MinioService for improved promise handling
- Changed the implementation of the `getRoomRecordUrl` method to use `await` with the Promise constructor for better readability and consistency.
- This adjustment enhances the asynchronous handling of the method, ensuring a more straightforward promise resolution process.
2024-12-05 21:14:00 +07:00
10df93d534 feat: add record URL retrieval to MeetingRoom schema and enhance MinioService
- Introduced a new field `recordUrl` in the MeetingRoom schema to fetch the presigned URL for meeting room recordings.
- Implemented `getRoomRecordUrl` method in MinioService to retrieve the recording URL from Minio, enhancing the service's functionality.
- Updated imports in MeetingRoom schema to include MinioService for the new functionality.
2024-12-05 21:10:45 +07:00
62662b0256 chore: clean up workshop subscription schema and add subscribed workshops field
- Removed unnecessary line breaks in the workshop subscription schema for improved readability.
- Consolidated import statements for better organization.
- Added a new field `subscribedWorkshops` to retrieve a list of workshops the current user is subscribed to, enhancing the schema's functionality.
- Streamlined error handling in the subscription logic for clarity.
2024-12-05 19:56:20 +07:00
9d64a199e2 refactor: update LiveKit egress service and module structure
- Removed the `livekit.egress.ts` file and replaced it with `livekit.egress.service.ts` for better clarity and consistency in naming.
- Updated `livekit.module.ts` to reflect the new import path for the `LiveKitEgressService`.
- Enhanced `livekit.room.service.ts` to utilize the new egress service structure, including improved egress configuration for recording sessions with dynamic file output settings.
- Removed the `rootDir` property from `tsconfig.json` to streamline the TypeScript configuration.
2024-12-05 19:35:17 +07:00
7699a07d1d chore: remove redundant Docker Compose down command in CI workflow
- Eliminated the `docker compose down` command from the CI workflow to streamline the build and deployment process. This change simplifies the CI configuration and enhances efficiency by reducing unnecessary steps.
2024-12-05 18:47:31 +07:00
253dbc783b chore: simplify Docker Compose commands in CI workflow
- Updated the CI workflow to streamline Docker Compose commands by replacing separate build and up commands with a single `docker compose up --build -d` command. This change enhances the efficiency of the CI process by reducing the number of steps required to start the services.
2024-12-05 18:46:28 +07:00
14edf629bd chore: update Dockerfile to include .nvmrc and .npmrc files
- Added .nvmrc and .npmrc files to the Docker image for consistent Node.js versioning and npm configuration.
- Removed the direct copy of the prisma directory to streamline the build process.
2024-12-05 18:42:16 +07:00
2033d0ec26 feat: enhance Docker configuration and update environment variables
- Updated .dockerignore to include additional files and directories for better Docker build context management.
- Modified compose.yaml to add BASE_URL and change BUCKET_NAME to improve environment configuration.
- Refactored Dockerfile to implement a multi-stage build for optimized image size and performance.
- Updated package.json to include a new script for production Prisma generation.
- Adjusted tsconfig files to refine project structure and exclude unnecessary directories.
- Removed delta.mdx.txt file from OpenAI instructions to streamline the service.
- Updated package-lock.json and package.json to upgrade Prisma and related dependencies for improved functionality.
2024-12-05 18:37:34 +07:00
ac2014079f feat: add listRecords method to MinioService and update start:dev script in package.json
- Introduced a new method `listRecords` in MinioService for listing objects in a specified room's records.
- Updated the `start:dev` script in package.json to remove debugging options for a cleaner development experience.
2024-12-05 17:13:11 +07:00
74656dd4d9 chore: update subproject commit reference for epess-database 2024-12-05 16:51:53 +07:00
0b3f4d6728 feat: update LiveKit configuration and enhance collaboration session handling
- Updated the `livekit-server-sdk` version to 2.9.2 for improved functionality.
- Refactored `LiveKitEgressService` to include validation for required environment variables and added a method to stop recording.
- Enhanced `LiveKitRoomService` to validate environment variables and dynamically set egress configurations for recording sessions.
- Modified `CollaborationSessionSchema` to correct the relation name for `chatRoom` and updated the schema to reflect the new structure.
- Improved error logging for better traceability during collaboration session creation.
2024-12-05 16:51:19 +07:00
7248ea257f feat: update collaborator assignment in CollaborationSessionSchema
- Changed the logic for assigning collaborators in the CollaborationSessionSchema to use participant IDs from the scheduleDate instead of the current user's ID.
- This update enhances the collaboration functionality by ensuring that all relevant participants are included in the session.
2024-12-04 14:00:07 +07:00
3d670ad0fc feat: add recording bucket configuration and update LiveKit credentials in compose.yaml
- Introduced RECORDING_BUCKET_NAME environment variable for managing recordings.
- Updated LiveKit API key and secret for enhanced security and access control.
2024-12-04 13:58:05 +07:00
afebc411af feat: enhance session management and improve webhook handling in ClerkService
- Made webhook and dispatchEvent methods asynchronous for better event processing.
- Integrated Redis for session invalidation, ensuring sessions are deleted upon specific Clerk events.
- Improved overall responsiveness and reliability of session management in ClerkService.
2024-12-04 13:54:55 +07:00
a516dce800 chore: update Node version and enhance debugging capabilities
- Removed .nvmrc file to eliminate version locking.
- Updated Dockerfile to use Node 22.6.0-alpine for improved performance and security.
- Modified package.json to enhance the 'start:dev' script with debugging options.
- Added new launch configuration in VSCode for attaching to Node processes by PID.
- Cleaned up settings.json by removing unused configurations.
- Refactored main.ts to simplify the bootstrap process.
- Enhanced logging in OrderSchema and ScheduleSchema for better traceability of operations.
2024-12-03 22:46:23 +07:00
951d61f3ac feat: improve schedule querying with flexible filtering and pagination
- Updated ScheduleSchema to enhance the querying logic for schedules by allowing dynamic filtering, ordering, and pagination.
- Replaced static customerId filtering with flexible arguments for filtering, ordering, skipping, and taking results.
- This change increases the versatility of schedule retrieval based on user-defined criteria.
2024-12-03 21:10:14 +07:00
6f5db20324 feat: enhance schedule querying logic based on user roles in ScheduleSchema
- Updated ScheduleSchema to implement role-based querying for schedules.
- Added logic to handle different user roles: CUSTOMER, CENTER_MENTOR, and CENTER_OWNER.
- Improved error handling for cases where the center is not found for mentors and owners.
- This change enhances the flexibility and usability of the schedule querying functionality.
2024-12-03 21:06:22 +07:00
84a9f7dd4f feat: enhance order description handling with lodash utility
- Added lodash to the OrderSchema for improved string manipulation.
- Updated the payment creation logic to use lodash for generating a cleaner description from the service name, limiting it to the first 10 words and removing diacritics.
- This change enhances the readability and consistency of order descriptions in payment processing.
2024-12-03 20:43:19 +07:00
367fc09c6c feat: enhance user validation and center owner checks in CenterMentorSchema
- Updated the CenterMentorSchema to include user validation by fetching user information based on email.
- Implemented error handling to throw an error if the user is not found.
- Modified the logic to block center owners from being invited as mentors by checking against the user's ID instead of the email.
- Improved overall error messaging for better clarity when invitation conditions are not met.
2024-12-03 19:53:59 +07:00
aaffb0c26b feat: make webhook and dispatchEvent methods asynchronous in ClerkService
- Updated the webhook method to be asynchronous, allowing for better handling of asynchronous operations.
- Changed the dispatchEvent method to be asynchronous to improve event processing and ensure proper handling of event data.
- These changes enhance the responsiveness and reliability of the ClerkService when processing webhooks and dispatching events.
2024-12-03 19:35:58 +07:00
9f9f595fee feat: integrate Redis for session invalidation in ClerkService
- Added RedisService to ClerkService for managing session invalidation.
- Updated event handlers (eventSessionRevoked, eventSessionRemoved, eventSessionEnded, eventEmailCreated) to asynchronously delete sessions from Redis upon specific events.
- Enhanced session management by ensuring sessions are properly invalidated in response to Clerk events.
2024-12-03 19:35:12 +07:00
029f21645b chore: remove Realtime module and related files
- Deleted RealtimeModule, RealtimeService, and RealtimeSchema to streamline the codebase and remove unused functionality.
- This cleanup helps improve maintainability and reduces complexity in the project.
2024-12-03 19:18:30 +07:00
b0317b0660 refactor: update configuration constants and clean up package scripts
- Modified time configuration constants in appconfig.constant.ts to reflect new operational hours.
- Removed linting and prettier scripts from package.json to streamline the build process.
2024-12-03 18:19:08 +07:00
81e6192974 feat: add room egress functionality to LiveKitRoomService
- Introduced RoomEgress to enable recording of meeting rooms with S3 storage configuration.
- Updated createServiceMeetingRoom method to include egress settings for room recording.
- Enhanced integration with LiveKit by allowing dynamic file path generation for recordings.
2024-12-03 17:42:18 +07:00
a6c511a2de feat: enhance collaboration session and LiveKit integration
- Added LiveKitRoomService to manage meeting room creation and recording functionalities.
- Updated CollaborationSessionSchema to create a LiveKit room upon new collaboration session creation.
- Introduced meetingRoomJoinInfo field in MeetingRoomSchema to provide join tokens and server URLs for meeting rooms.
- Improved LiveKitService to include user metadata in token generation and added a method to retrieve the server URL.
- Enhanced error handling and authorization checks across schemas to ensure proper access control for collaboration sessions and meeting rooms.
2024-12-03 17:37:47 +07:00
2b92f3bf5f feat: add validation to prevent center owners and mentors from being invited to their own centers
- Implemented checks in CenterMentorSchema to block center owners from being invited as mentors.
- Added validation to prevent mentors from being invited to their own centers or centers they already mentor.
- Enhanced error handling to provide clear feedback when invitation conditions are not met.
2024-12-03 16:18:26 +07:00
7021aa7f20 refactor: update README and document schema for improved clarity and functionality
- Revised README.md to provide a clearer project overview, installation instructions, and service descriptions, enhancing onboarding for new developers.
- Removed unnecessary comments in document.schema.ts to streamline the code and improve readability.
- Updated the LiveKit service descriptions in the README to reflect the integration of new functionalities and services.
2024-12-02 22:52:41 +07:00
c94f47f28c feat: add removeCollaborator mutation to DocumentSchema
- Introduced a new mutation to allow document owners to remove collaborators from a document.
- Implemented authorization checks to ensure only the document owner can perform this action.
- Enhanced error handling for cases where the document is not found or the user is not the owner.
2024-12-02 22:46:46 +07:00
e937330398 refactor: improve document access validation in DocumentSchema
- Enhanced authorization checks in DocumentSchema to ensure users must either be the document owner or a writable collaborator.
- Consolidated validation logic for better readability and maintainability, improving error handling for unauthorized access.
2024-12-02 21:36:08 +07:00
02bc5fe691 refactor: enhance authorization checks and update meeting room collaboration logic
- Updated error messages in DocumentSchema to use 'Unauthorized' for better clarity on access issues.
- Removed the deprecated testUpdateDocument field from DocumentSchema to streamline the schema.
- Introduced a new updateMeetingRoomCollaborators field in MeetingRoomSchema to manage collaborator additions and removals, ensuring proper authorization checks are in place.
- Improved overall error handling for unauthorized access in both DocumentSchema and MeetingRoomSchema.
2024-12-02 21:25:07 +07:00
542312b7d8 fix: improve error handling in DocumentSchema for document page retrieval
- Updated the document page retrieval logic to handle errors gracefully by using a try-catch block, preventing the application from throwing an error if the document page is not found.
- Simplified the validation check for document ownership and collaboration access by consolidating conditions into a single line for better readability.
2024-12-02 17:32:49 +07:00
4b5ccc4bb7 Merge branch 'main' of https://github.com/EPESS/epess-web-backend 2024-12-02 17:29:10 +07:00
b10d0cdde7 refactor: update LiveKit integration and clean up unused services
- Changed the base image in Dockerfile to use a lighter node:alpine version.
- Removed unused dependencies from package-lock.json and package.json, including @turbodocx/html-to-docx and jsdom.
- Simplified LiveKit module by removing unnecessary services (LiveKitParticipantService, LiveKitRoomService) and adjusting related schemas and services for better maintainability.
- Updated CollaborationSessionSchema to streamline access token creation and room management.
- Commented out unused imports and services in various modules to enhance code clarity and reduce complexity.
2024-12-02 17:29:07 +07:00