Commit Graph

381 Commits

Author SHA1 Message Date
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
unclebonn
baa0a03a41 user in collaborator can update document 2024-12-02 15:13:42 +07:00
174290c9fb chore: update subproject commit reference in epess-database
- Updated the subproject commit reference from 58abaa2 to 1a89260, reflecting the latest changes in the epess-database submodule.
2024-12-01 19:18:36 +07:00
561823225d feat: integrate LiveKit services into Collaboration and Meeting Room modules
- Added LiveKitModule to CollaborationSession and MeetingRoom modules for enhanced real-time collaboration features.
- Updated CollaborationSessionSchema to include LiveKit services for managing participant access and room permissions.
- Implemented a new cron job in CronService to disable services without schedules for over 30 days, improving service management.
- Enhanced GraphQL schema generation with improved filtering logic for better performance and readability.
- Refactored LiveKit services to streamline access token creation and room management functionalities.
2024-12-01 19:18:20 +07:00
111acacf2d refactor: simplify schedule filtering logic in ScheduleSchema
- Replace complex where clause with a direct reference to args.filter for schedule retrieval.
- This change enhances code readability and maintainability by streamlining the filtering process.
2024-12-01 14:29:39 +07:00
37330e7ab1 fix collaboration session 2024-11-30 23:45:51 +07:00
f99ad899c0 refactor: enhance user validation in CollaborationSessionSchema
- Update user participation check to allow access for a specific user ID while maintaining restrictions for others.
- This change aims to refine access control within collaboration sessions, ensuring that only authorized users can participate while allowing for specific exceptions.
2024-11-30 23:44:46 +07:00
05a8ebcebf refactor: comment out user validation in CollaborationSessionSchema and error handling in DateTimeUtils
- Temporarily disable the check for user participation in collaboration sessions to allow for further review of session management logic.
- Comment out the error handling for invalid date times in DateTimeUtils, simplifying the date conversion process for now.
- These changes aim to enhance code maintainability while preserving existing functionality.
2024-11-30 23:28:17 +07:00
bb56b7b61c refactor: comment out collaborator ID update logic in CollaborationSessionSchema
- Temporarily disable the logic that adds the current user's ID to the collaboratorsIds array if not already included.
- This change is aimed at revisiting the collaboration session management without altering the existing functionality for customer role access.
2024-11-30 23:12:34 +07:00
2c38110183 refactor: enhance schedule retrieval logic in ScheduleSchema
- Update schedule retrieval to restrict access to authorized centers based on center ownership and mentorship.
- Implement checks to ensure that schedules are only fetched for approved centers.
- Improve error handling for user and center validation during schedule queries, preventing access in subscription contexts.
2024-11-30 21:02:03 +07:00
c26bf36084 refactor: enhance schedule and document handling in schemas
- Simplify schedule expiration logic in CronService by removing unnecessary date checks.
- Improve error handling in DocumentSchema for document page retrieval, ensuring graceful failure.
- Add validation in ScheduleSchema to restrict schedule retrieval to authorized centers and prevent subscription-based access.
- Implement checks to reject schedules with start dates in the past or today, enhancing data integrity.
2024-11-30 20:35:34 +07:00
7729d3ce63 refactor: improve code readability and logging in GraphQL builder
- Reformat plugin array for better readability in the Builder class constructor.
- Enhance unused query handling by adding logging for unused queries in development.
- Update TypeScript error comment for clarity in GraphqlModule, specifying that the request is not typed.
2024-11-30 17:00:34 +07:00
af81874793 chore: update @nestjs-modules/mailer and @css-inline dependencies
- Upgrade @nestjs-modules/mailer from version 1.6.1 to 2.0.2 for improved functionality.
- Update @css-inline/css-inline and related packages to version 0.14.1, enhancing compatibility and features across various platforms.
- Refactor package.json and package-lock.json for consistency in dependency management.
2024-11-30 16:51:52 +07:00
c432b71735 feat: add logging and notification creation in NotificationService
- Implement logging for notification sending process.
- Create a new message entry in the database when a notification is sent, specifying recipient, content, type, and context. This enhances the notification handling capabilities of the service.
2024-11-30 16:49:35 +07:00
1e9d3cfbb4 fix: check schedule date start 2024-11-30 16:41:59 +07:00
a619c95efc Update dependencies in package.json and package-lock.json, refactor CronService to include notification handling for schedule expirations, and enhance DocumentSchema with OpenAI integration for document editing suggestions. Additionally, modify GraphqlModule to include PubSubModule for real-time notifications and improve datetime utility functions for better date formatting. Update epess-database subproject reference to indicate a dirty state. 2024-11-30 16:41:47 +07:00
7cff5069de Update RefundTicket schema to rename 'reason' field to 'rejectedReason' for clarity in status updates. Update subproject reference in epess-database. Enhance generated types in pothos.generated.ts for improved schema management. 2024-11-29 13:56:57 +07:00
abb7e38df3 Enhance DocumentSchema and MinioService to support document folder creation. Update document creation logic to include folder setup in Minio after document creation. Refactor createDocumentFolder method to initialize a default page in the document folder. This improves document management and organization within the Minio storage system. 2024-11-28 20:09:37 +07:00
e546c348cc Enhance CollaborationSessionSchema by adding collaboratorsIds field to expose a list of collaborator IDs. This update improves the schema's clarity and functionality for collaboration management. 2024-11-28 19:47:13 +07:00
f2edc9fa8d Refactor ResumeSchema to streamline file upload and resume management logic. Consolidate description formatting for resume and resume file retrieval fields. Enhance error handling during file upload and resume creation, ensuring robust handling of existing resumes. This update improves code clarity and maintains functionality for resume file management. 2024-11-28 19:44:40 +07:00
ed7ec9a368 Merge branch 'main' of https://github.com/EPESS/epess-web-backend 2024-11-28 19:21:09 +07:00
7911d7f0bd Refactor CronService to utilize DateTimeUtils for date handling. Update schedule and payment checks to use current time instead of new Date(), enhancing accuracy in scheduling logic. This change improves the reliability of cron job operations by ensuring consistent date management. 2024-11-28 19:21:06 +07:00
unclebonn
19a19b00c4 relation Schedules to Order 2024-11-28 15:27:41 +07:00
a6788345ce Refactor DocumentSchema to remove fileUrl retrieval logic and set default value for fileUrl. This change simplifies the document creation process by eliminating unnecessary error handling related to file retrieval, while maintaining user ownership assignment. 2024-11-27 08:56:29 +07:00
0bfdd3812d Enhance DocumentSchema and MinioService for improved error handling and functionality. Update page index validation to check for undefined or null values. Introduce total page count retrieval in DocumentSchema and adjust senderId handling. Refactor MinioService to correctly read and parse document pages, ensuring robust object management. This update improves clarity and reliability in document synchronization processes. 2024-11-27 07:50:51 +07:00
8fba48ed0f Update order schema to limit payment description length to 10 words for improved clarity and consistency in payment processing. 2024-11-27 06:52:53 +07:00
77f44a891f Refactor CollaborationSession and Document schemas to improve code clarity and functionality. Enhance error handling in collaboration session retrieval and update logic. Introduce new request sync events in Document schema and update Minio service for document page management. Adjust cron job to use current date for future schedule date checks. Update user schema for better error handling and improve service descriptions in order schema. Remove global decorators from Workshop modules for better module encapsulation. 2024-11-27 06:48:49 +07:00
51bafcfe29 Change cron job frequency to check payment status every minute instead of every 10 minutes for improved responsiveness. 2024-11-27 02:33:54 +07:00
cdf7e7febd Update CenterMentorSchema to include 'active' field for mentor status and adjust role assignment to use Role enum. Enhance payment cancellation logic in CronService to update associated order status to 'FAILED'. Bump epess-database subproject commit reference to reflect recent changes. 2024-11-27 02:32:55 +07:00
12ec345f5b Refactor CenterMentorSchema to streamline code and improve clarity. Consolidate import statements, enhance query field descriptions, and optimize token generation logic. Integrate Redis service for session management, ensuring cache invalidation for active Clerk sessions. Update email sending logic for mentor invitations to improve readability. 2024-11-27 01:32:18 +07:00
ddaab3eb0a Update CENTER_BASE_URL in compose.yaml to use production URL and comment out local development URL 2024-11-27 01:21:30 +07:00
0fc95eab73 Update epess-database subproject commit reference to 6b4dece, reflecting recent changes in the database structure. 2024-11-27 01:09:41 +07:00
2581ca396f Refactor Category and Center schemas to improve field descriptions and code clarity; update email templates for consistency in messaging. Add Redis service to CenterSchema for session management. Bump epess-database subproject commit reference to indicate changes. Clean up logging in ClerkService and ServiceSchema. 2024-11-27 01:09:13 +07:00
c9435a6e04 Enhance ServiceSchema by adding commission and descriptions for approve and adminNote arguments. Implement default commission logic when service is approved without a specified commission. 2024-11-27 00:41:54 +07:00