100 Commits
Author SHA1 Message Date
tuankiet2s 11221b5702 fix: round revenue calculation in AnalyticSchema
CI / build (push) Has been cancelled
- Added logic to round the revenue value to the nearest whole number before returning the analytic data.
- This change aims to ensure that revenue figures are presented in a more user-friendly format, enhancing clarity in analytic reports.
2025-01-18 21:26:06 +07:00
tuankiet2s 0117d81818 refactor: standardize formatting and improve readability in AnalyticSchema
- Reformatted import statements and code structure for consistency and clarity across the AnalyticSchema.
- Enhanced field descriptions to ensure uniformity and better understanding of the analytics data.
- Updated error messages for improved user feedback during analytic data retrieval.
- Improved organization of query fields for better maintainability and readability.

These changes aim to enhance code readability, maintainability, and user experience within the analytic features.
2025-01-18 00:39:26 +07:00
tuankiet2s 03cf3f48a7 fix: refine schedule overlap validation in ScheduleSchema
- Updated the logic for checking overlapping schedules by querying existing schedule dates for the same user, improving accuracy in overlap detection.
- Simplified the overlap validation process by consolidating checks into a single function, enhancing code clarity and maintainability.
- This change aims to strengthen the integrity of scheduling operations and provide clearer error messages for users regarding scheduling conflicts.
2025-01-17 23:23:10 +07:00
tuankiet2s 9aec02568d fix: improve schedule overlap validation in ScheduleSchema
- Enhanced the validation logic to check for overlapping schedules by incorporating checks against existing user schedule dates.
- Added comprehensive overlap detection for new schedules, ensuring they do not conflict with any existing schedules for the user.
- This update aims to improve the integrity of scheduling operations and provide clearer error messages for users regarding scheduling conflicts.
2025-01-17 23:08:32 +07:00
tuankiet2s bd4eaea379 fix: enhance schedule overlap validation in OrderSchema
- Removed outdated overlap validation logic and replaced it with a more comprehensive check for existing schedule dates associated with the same user.
- Implemented a new validation mechanism to ensure that the new schedule does not overlap with any existing schedule dates, improving the accuracy of scheduling operations.
- This change aims to enhance the integrity of scheduling processes and provide clearer feedback to users regarding scheduling conflicts.
2025-01-17 22:52:24 +07:00
tuankiet2s 9c152b52a3 feat: add cache invalidation functionality in GraphQL module
- Introduced a new `invalidateCache` method in the GraphQL module to enhance cache management.
- This addition allows for cache invalidation based on the session ID from request headers, improving data consistency and performance during GraphQL operations.
- Aims to provide better control over cached data, ensuring that users receive the most up-to-date information.
2025-01-17 22:05:29 +07:00
tuankiet2s 5fff0db6d7 feat: add schedule start and end validation in OrderSchema
- Introduced new validation fields for schedule start and end times in the OrderSchema to ensure accurate scheduling.
- This enhancement aims to improve the integrity of scheduling operations by validating the start and end times against the provided schedule data.
2025-01-17 21:34:44 +07:00
tuankiet2s d36460fc12 refactor: standardize formatting and improve readability in ScheduleSchema
- Reformatted import statements and code structure for consistency and clarity.
- Enhanced field descriptions across the ScheduleSchema to ensure uniformity and better understanding.
- Updated error messages for improved user feedback during scheduling operations.
- Improved the organization of query and mutation fields for better maintainability.

These changes aim to enhance code readability, maintainability, and user experience within the scheduling features.
2025-01-17 21:14:17 +07:00
tuankiet2s b33ad5e809 fix: enhance schedule overlap validation in OrderSchema
- Added logic to retrieve existing schedule dates for a given schedule ID to improve overlap detection.
- Updated the conditions for checking schedule overlaps to include participant IDs, day of the week, and time slots, ensuring more accurate validation.
- This change aims to enhance the integrity of scheduling operations and provide better feedback for users regarding scheduling conflicts.
2025-01-17 20:59:05 +07:00
tuankiet2s c2d3ebba09 fix: update serviceAndCategory update query structure
- Modified the update query in ServiceAndCategorySchema to use a composite key for the `where` clause, ensuring that both `serviceId` and `subCategoryId` are correctly utilized for identifying records.
- This change enhances the accuracy of the update operation, improving data integrity and consistency within the service and category management functionality.
2025-01-16 19:38:25 +07:00
tuankiet2s a90811af86 fix: update error message for schedule overlap in OrderSchema
- Changed the error message thrown when a user has an overlapping schedule from "User has already registered for this service" to "User have overlap schedule" for improved clarity.
- This update aims to enhance user feedback during order processing, ensuring a better understanding of scheduling conflicts.
2025-01-16 19:20:28 +07:00
tuankiet2s 1896974484 refactor: standardize formatting and improve OrderSchema
- Reformatted import statements in order.schema.ts for consistency and readability.
- Enhanced field descriptions in the OrderSchema to ensure clarity and uniformity.
- Updated error messages for better user feedback during order processing.
- Improved the structure of query and mutation fields for better maintainability.

These changes aim to enhance code readability, maintainability, and user experience within the Order management features.
2025-01-16 19:20:02 +07:00
tuankiet2s 26a5e6fe89 chore: update Node version and enhance package scripts
- Updated Node version in .nvmrc from 24.0.0-nightly to 23.5.0 for better compatibility.
- Modified package.json to include a prestart script for Prisma generation and adjusted the start script to enable watch mode.
- Removed unused import from document.schema.ts to clean up the code.
- Added keepAlive setting for subscriptions in graphql.module.ts to improve connection stability.

These changes aim to streamline the development environment and enhance the application's performance and maintainability.
2025-01-08 18:08:52 +07:00
tuankiet2s 776881f961 chore: combine context 2024-12-20 18:30:50 +07:00
tuankiet2s 461f2653e3 chore: update subproject commit and enhance GraphQL message schema
- Updated the subproject commit reference in epess-database.
- Added logging functionality in the GraphQL module for subscription handling to improve debugging.
- Refactored the MessageSchema to standardize formatting, enhance readability, and add a new field `isRead` to track message status.
- Improved error handling and validation in message-related operations, ensuring better user experience and data integrity.
- Updated the generated types in pothos.generated.ts to reflect the latest schema changes.

These changes aim to improve code maintainability, enhance debugging capabilities, and ensure a more robust message handling process.
2024-12-20 12:41:00 +07:00
tuankiet2s be35684ba2 fix: ensure requestSync is set correctly in DocumentSchema
- Added a line to set payload.requestSync to true within the DocumentSchema class, ensuring that synchronization requests are properly flagged for processing.
- This change reinforces the handling of sync operations, aligning with previous optimizations made to the background synchronization process.
2024-12-17 05:50:01 +07:00
tuankiet2s 19059f0e19 fix: adjust sync probability and enable requestSync in DocumentSchema
- Reduced the background sync probability from 0.1% to 0.01% to minimize unnecessary sync attempts.
- Enabled the requestSync flag in the payload to ensure synchronization requests are properly handled.

These changes aim to optimize the background synchronization process within the DocumentSchema, enhancing performance and control over sync operations.
2024-12-17 05:30:45 +07:00
tuankiet2s d8b5abe1ed refactor: comment out background grammar check in DocumentSchema
- Temporarily disabled the background grammar check functionality in DocumentSchema to prevent unintended execution during document processing.
- This change is part of ongoing improvements to enhance code clarity and maintainability.

These modifications aim to streamline the document management process while ensuring a more controlled execution of background tasks.
2024-12-17 05:27:36 +07:00
tuankiet2s 637e044a05 refactor: standardize formatting and enhance DocumentSchema
- Updated compose.yaml to use consistent quotation marks for port and labels.
- Refactored package.json to improve readability of Jest configuration.
- Enhanced DocumentSchema by adding a new event type for cursor movement and improving formatting for better clarity.
- Consolidated import statements in document.schema.ts for consistency and readability.
- Improved error handling and validation across various methods in DocumentSchema to enhance user experience.

These changes improve code maintainability and readability, ensuring a more consistent and user-friendly experience in the Document management features.
2024-12-17 05:24:46 +07:00
tuankiet2s 6b0b95bb32 update schedule 2024-12-16 20:00:11 +07:00
tuankiet2s b61e4dfc73 chore: fix duplicate notification 2024-12-16 18:01:15 +07:00
tuankiet2s c4ed887727 chore: fix notification on service creation 2024-12-16 17:53:39 +07:00
tuankiet2s b6b97acdec chore: fix upsert resume 2024-12-16 17:09:19 +07:00
tuankiet2s 11f234522b chore: fix order and schedule creation logic 2024-12-16 16:26:18 +07:00
tuankiet2s 07158bef3a feat: streamline schema definitions and enhance service logic
- Refactored package.json to consolidate Jest configuration for improved readability.
- Cleaned up launch.json by removing unnecessary whitespace for better formatting.
- Updated CronService to refine service disabling logic based on recent activity, ensuring more accurate service management.
- Enhanced MeetingRoom and WorkshopMeetingRoom schemas with consistent formatting and improved field descriptions for clarity.
- Improved error handling in MeetingRoom schema to provide clearer feedback for unauthorized access and missing resources.
- Updated pothos.generated.ts to reflect recent schema changes, ensuring type consistency across the application.

These changes enhance the overall structure and maintainability of the codebase, improving service management and user experience.
2024-12-15 21:50:32 +07:00
tuankiet2s c886d9a02f feat: enhance DocumentSchema and DocumentService with Redis integration and background processing
- Updated DocumentSchema to include RedisService for improved background processing of grammar checks.
- Refactored checkGrammarForPage method in DocumentService to utilize Promise.all for parallel processing and error handling.
- Introduced background grammar check functionality with a low probability trigger, enhancing performance and user experience.
- Added new utility methods for better time management and error logging.

These changes improve the efficiency and responsiveness of the grammar checking feature, leveraging Redis for state management and background processing.
2024-12-14 21:54:43 +07:00
tuankiet2s 114998ea7e feat: enhance QuizSchema with schedule integration and validation
- Added scheduleId and schedule relation to QuizSchema, allowing quizzes to be associated with specific schedules.
- Implemented validation to ensure that both quiz ID and schedule ID are provided during quiz attempt creation, improving data integrity.
- Updated related types in pothos.generated.ts to reflect the new schedule relationship, enhancing the overall schema structure.

These changes improve the functionality of the Quiz feature by integrating schedule management and ensuring proper validation during quiz attempts.
2024-12-13 22:39:57 +07:00
tuankiet2s 612945c79d feat: add deletePersonalMilestone mutation to PersonalMilestoneSchema
- Introduced a new mutation to delete personal milestones, including necessary authorization checks to ensure that only mentors of the associated schedule can perform the deletion.
- Enhanced error handling to provide clear feedback for unauthorized access and missing user information.

These changes improve the management of personal milestones within the GraphQL API, ensuring proper access control and user experience.
2024-12-13 20:30:23 +07:00
tuankiet2s 70ff392d2e feat: enhance RefundTicketSchema with additional role checks for refund requests
- Updated RefundTicketSchema to include CENTER_OWNER in the authorization check for refund requests, ensuring that only authorized roles can request refunds.
- Improved error handling to provide clearer feedback for unauthorized access attempts.

These changes enhance the security and functionality of the refund ticket process, ensuring proper role validation and user experience.
2024-12-13 20:22:29 +07:00
tuankiet2s 8051ae9442 feat: enhance QuizSchema with improved filtering for quiz attempts
- Refactored the query for retrieving quiz attempts to utilize an AND condition for better filtering based on center mentor ID and additional filters.
- Improved the structure of the query to enhance readability and maintainability.

These changes enhance the data retrieval capabilities of the Quiz feature, ensuring more precise and efficient access to quiz attempts based on user and quiz criteria.
2024-12-13 20:20:02 +07:00
tuankiet2s b709bec583 feat: enhance CronService and OrderSchema with new scheduling and authorization features
- Removed unnecessary logging from CronService methods to streamline execution.
- Introduced a new cron job in CronService to check if all schedule dates are completed and update the schedule status accordingly.
- Added a new query in OrderSchema to retrieve completed orders for moderators, including authorization checks for user roles.
- Updated PersonalMilestoneSchema to allow for creating multiple personal milestones with necessary input fields.

These changes improve the scheduling logic and enhance the GraphQL API's authorization mechanisms, ensuring better user experience and state management.
2024-12-13 20:14:18 +07:00
tuankiet2s 0a1b42f908 feat: update refund ticket handling and enhance service schemas
- Removed the taskRefundTicket method from CronService to streamline scheduling logic.
- Updated PayosService to include MessageContextType for chat messages, improving message context handling.
- Enhanced RefundTicketSchema with additional fields for requester and improved error handling for unauthorized access.
- Implemented logic to update order and schedule statuses upon refund ticket approval, ensuring proper state management.
- Modified ServiceSchema to utilize createManyAndReturn for message creation, enhancing notification efficiency.

These changes improve the handling of refund tickets and enhance the overall functionality of the service schemas, ensuring better user experience and state management.
2024-12-13 19:35:23 +07:00
tuankiet2s 2eb2919965 feat: enhance PersonalMilestone and Service schemas with new functionalities
- Added a new mutation to update personal milestones and change schedule status to IN_PROGRESS in PersonalMilestoneSchema.
- Refactored service notification logic to send messages to moderators upon service approval in ServiceSchema, improving communication flow.
- Cleaned up commented-out code for better readability and maintainability.

These changes enhance the GraphQL API by improving milestone management and service notification processes, ensuring better user experience and state management.
2024-12-13 19:08:15 +07:00
tuankiet2s bbe0d34cdb feat: enhance GraphQL schemas and service logic
- Added support for creating relation inputs in PrismaCrudGenerator for object types.
- Implemented unauthorized access checks in OrderSchema to ensure user authentication.
- Added logic to prevent duplicate service registrations for users in OrderSchema.
- Updated PayosService to change order status from IN_PROGRESS to WAITING_QUIZ.
- Introduced a new mutation for creating multiple personal milestones in PersonalMilestoneSchema with necessary validation.
- Enhanced QuizSchema to update schedule status to WAITING_INTERVIEW upon quiz attempt creation.

These changes improve the robustness of the GraphQL API by adding necessary validations, enhancing user experience, and ensuring proper state management across various schemas.
2024-12-13 18:52:16 +07:00
tuankiet2s ed8df7a1bc feat: enhance grammar checking functionality in DocumentSchema and DocumentService
- Updated the 'testCheckGrammar' field in DocumentSchema to accept additional arguments: documentId, pageId, and promptType, allowing for more flexible grammar checking options.
- Modified the checkGrammarForPage method in DocumentService to utilize the new promptType argument, enabling different processing types (CHECK_GRAMMAR, REWRITE_TEXT, etc.) for grammar checks.
- Improved logging for better debugging and tracking of grammar check results.

These changes enhance the document editing experience by providing more robust grammar checking capabilities and leveraging AI for various text processing tasks.
2024-12-13 18:07:20 +07:00
tuankiet2s 68353d8985 feat: implement AI suggestion 2024-12-12 21:22:50 +07:00
tuankiet2s 3652fda7d3 feat: add grammar check functionality and enhance quiz schema
- Introduced a new 'testCheckGrammar' field in DocumentSchema to facilitate grammar checking for documents, leveraging the document service for processing.
- Updated DocumentService to implement grammar checking logic, including caching results and publishing suggestions.
- Enhanced QuizSchema by adding filter arguments for quiz attempts, allowing for more flexible data retrieval based on user and quiz IDs.
- Cleaned up whitespace and improved error handling in quiz attempt creation to ensure better user feedback.

These changes improve the document editing experience and enhance the quiz feature's data handling capabilities.
2024-12-11 22:36:35 +07:00
tuankiet2s 4168bff1e8 feat: enhance quiz schema with JsonList type and add quiz attempt fields
- Introduced a new 'JsonList' scalar type in the GraphQL schema to handle lists of JSON values, improving data structure flexibility.
- Updated the Quiz schema to replace 'Json' type with 'JsonList' for user input and questions, ensuring consistent data handling.
- Added new fields for retrieving quiz attempts, including individual and multiple attempts, with appropriate authorization checks for user roles.
- Enhanced error handling for quiz attempt retrieval to ensure proper access control and user feedback.

These changes improve the overall functionality and maintainability of the quiz feature, providing a more robust data model and user experience.
2024-12-11 17:26:28 +07:00
tuankiet2s c437022d41 chore: update subproject reference in epess-database to latest commit
- Updated the subproject reference in the epess-database to the latest commit (54cb097) for consistency in project dependencies.
- This change ensures alignment with the most recent updates in the subproject, maintaining the integrity of the overall project structure.
2024-12-11 16:31:32 +07:00
tuankiet2s 871f24edb0 chore: update dependencies and enhance document schema
- Updated package.json and package-lock.json to include the new dependency 'quill-to-pdf' for improved document export functionality.
- Modified DocumentSchema to introduce a new 'DocumentExportObject' type, facilitating document export operations.
- Cleaned up commented-out code in document.service.ts and minio.service.ts for better readability and maintainability.
- Adjusted quiz schema to expose user input and questions as JSON types, enhancing data flexibility.
- Updated workshop subscription logic to maintain accurate participant counts upon new subscriptions.

These changes improve the overall functionality and maintainability of the project, ensuring better document handling and schema consistency.
2024-12-11 16:31:16 +07:00
tuankiet2s 1fcc7b9a5f refactor: enhance DocumentSchema with detailed field descriptions and adjust random sync logic
- Updated DocumentSchema to include detailed descriptions for fields, improving API documentation and usability.
- Adjusted the random sync logic threshold from 0.05 to 0.005 to reduce the frequency of sync requests, optimizing performance.
- Added new fields for collaboration session management, enhancing document interaction capabilities.
2024-12-11 14:43:21 +07:00
tuankiet2s c1d21cb1a8 fix: remove unnecessary whitespace in document.service.ts
- Cleaned up whitespace in document.service.ts to improve code readability and maintainability.
- This change enhances the overall quality of the codebase by ensuring consistent formatting.
2024-12-11 02:16:11 +07:00
tuankiet2s c6482b16f2 chore: update Node.js version and refine launch configuration
- Updated the Node.js version in .nvmrc from 22.6.0 to 24.0.0-nightly for compatibility with the latest features.
- Modified the launch.json configuration to reflect the new Node.js runtime path, ensuring the development environment is aligned with the updated version.
- Cleaned up whitespace in document.service.ts for improved code readability.

These changes ensure the project is using the latest Node.js version and maintain a clean and efficient development setup.
2024-12-11 01:15:02 +07:00
tuankiet2s 9500471faf feat: enhance document processing with AI suggestions and preview image support
- Added AI_SUGGESTION event to DocumentEvent enum for improved document interaction.
- Implemented updateDocumentPreviewImage mutation in DocumentSchema to allow updating of document preview images.
- Integrated grammar checking functionality in DocumentService, utilizing OpenAI for real-time suggestions and caching results in Redis.
- Enhanced MinioService with methods for file upsert and document content retrieval.
- Updated PrismaTypes to include new relations and fields for better data structure alignment.
- Commented out unused RESTful service methods for future cleanup.

These changes improve the document editing experience by leveraging AI capabilities and enhancing the schema for better data management.
2024-12-10 23:27:05 +07:00
tuankiet2s e1cfd55502 chore: update user schema and database reference
- Removed the 'packageValue' field from the User schema to streamline user data representation.
- Updated the subproject reference in the epess-database to the latest commit for consistency in project dependencies.
- These changes enhance the clarity of the user schema and ensure alignment with the latest database structure.
2024-12-10 17:23:07 +07:00
tuankiet2s c8f4abd670 refactor: enhance message creation logic by adding context
- Updated the message creation logic to include a default context of 'CHAT' in the data being saved, ensuring that all messages have a defined context.
- This change improves the consistency of message data and enhances the overall functionality of the messaging system.
2024-12-10 17:17:35 +07:00
tuankiet2s 45c7b6d5b9 chore: update .gitignore to remove pothos generated types declaration
- Removed 'pothos.generated.ts' from .gitignore as it is no longer relevant to the project.
- This change helps maintain a cleaner project structure by ensuring only necessary files are ignored.
2024-12-10 17:13:03 +07:00
tuankiet2s b46da5fbad refactor: enhance quiz retrieval and schema consistency
- Improved quiz retrieval logic by ensuring a valid random index is calculated, preventing errors when no quizzes are available.
- Updated the Quiz schema to streamline field names and enhance clarity, replacing existing fields with more descriptive alternatives.
- Reformatted code for better readability and consistency, adhering to style guidelines for improved maintainability.
2024-12-10 17:06:30 +07:00
tuankiet2s 2dbe5c589b refactor: simplify quiz retrieval logic by removing unnecessary schedule validation
- Removed the requirement for 'scheduleId' in the quiz retrieval process, streamlining the logic and improving code clarity.
- Consolidated the quiz retrieval query to enhance maintainability while ensuring it still functions correctly with the existing data structure.
- Updated the .gitignore to clarify the purpose of the 'pothos.generated.ts' file, improving project documentation.
2024-12-10 16:57:04 +07:00
tuankiet2s 0d39f053bb chore: update .gitignore to include pothos generated file
- Added 'pothos.generated.ts' to .gitignore to prevent tracking of generated files, improving project cleanliness and reducing unnecessary clutter in version control.
2024-12-10 16:48:50 +07:00
tuankiet2s 313dc8d32f refactor: remove unused PrismaTypes interface and related file
- Deleted the `pothos.generated.ts` file, which contained the PrismaTypes interface and related type definitions, as it was no longer needed in the project.
- This cleanup improves project maintainability by removing obsolete code and reducing clutter in the codebase.
2024-12-10 16:48:40 +07:00
tuankiet2s 14a69aba10 refactor: update Quiz schema and Prisma types for enhanced data structure
- Replaced existing score and answers fields in the Quiz schema with more descriptive fields: numberOfCorrectAnswers, numberOfIncorrectAnswers, numberOfQuestions, correctPoints, totalPoints, and userInput.
- Updated the PrismaTypes interface to remove the questions relation and streamline the data model, ensuring better clarity and maintainability.
- Updated the subproject reference in the epess-database to the latest commit for consistency in project dependencies.
2024-12-10 16:46:46 +07:00
tuankiet2s 431e478f21 refactor: streamline quiz schema formatting and improve readability
- Reformatted the quiz schema for consistent indentation and spacing, enhancing overall code clarity.
- Consolidated the random index calculation into a single line for improved readability.
- Maintained existing functionality while ensuring the code adheres to style guidelines for better maintainability.
2024-12-10 16:37:53 +07:00
tuankiet2s d18258f81a refactor: improve quiz retrieval logic with schedule validation
- Added validation to ensure 'scheduleId' is provided when retrieving quizzes, enhancing error handling.
- Implemented a check for the existence of the schedule before proceeding with quiz retrieval, improving robustness.
- Reformatted code for better readability and consistency in the Quiz schema.
2024-12-10 16:37:36 +07:00
tuankiet2s 4435bc0804 refactor: standardize code formatting and improve readability in User schema
- Reformatted import statements and method calls to use consistent line endings and spacing, enhancing code clarity.
- Updated error handling messages to maintain uniformity across the schema.
- Improved overall readability by ensuring consistent use of semicolons and line breaks, making the code easier to navigate and maintain.
2024-12-10 16:37:10 +07:00
tuankiet2s f1f5918a65 refactor: improve quiz retrieval logic in Quiz schema
- Enhanced the quiz retrieval logic to ensure a valid random index is calculated based on the number of available quizzes, preventing potential errors when no quizzes are present.
- Updated the logic to use 'nrOfQuestions' from the quiz object for slicing the quizzes array, ensuring consistent behavior in quiz selection.
- Improved code clarity by refining comments related to the quiz selection process.
2024-12-09 20:37:04 +07:00
tuankiet2s ed50f33322 feat: enhance Quiz schema with schedule-based quiz retrieval and error handling
- Added logic to require 'scheduleId' for customers when retrieving quizzes, ensuring proper association with schedules.
- Implemented error handling for missing 'scheduleId' and non-existent schedules, improving robustness and user feedback.
- Refactored quiz retrieval logic for customers and center mentors to utilize the correct center mentor ID from the schedule, enhancing data integrity.
- Updated comments for clarity regarding the quiz selection process based on user roles.
2024-12-09 20:19:10 +07:00
tuankiet2s aa9ce7a235 refactor: remove 'amount' argument from Quiz schema and update quiz retrieval logic
- Removed the 'amount' argument from the quiz retrieval query to streamline the schema.
- Updated the quiz retrieval logic to use 'nrOfQuestions' from the quiz object instead of the removed 'amount' argument, ensuring consistent behavior in quiz selection.
- Improved code clarity by refining comments related to quiz selection logic.
2024-12-09 20:08:17 +07:00
tuankiet2s 30f56747f7 feat: enhance Quiz schema with random quiz retrieval and amount argument
- Added a new 'amount' argument to the quiz retrieval query, allowing users to specify the number of quizzes to return.
- Implemented a seeded randomization mechanism to select quizzes based on the user's ID, improving the randomness of quiz selection.
- Refactored the quiz retrieval logic to utilize the new randomization and amount features, enhancing user experience and engagement.
2024-12-09 20:07:22 +07:00
tuankiet2s 4151bb6afe chore: update subproject commit and modify datamodel retrieval function
- Updated the subproject reference in the epess-database to the latest commit.
- Refactored the getDatamodel function in pothos.generated.ts to ensure it returns the latest datamodel structure, enhancing data retrieval consistency.
2024-12-09 19:50:51 +07:00
tuankiet2s 13e525e92f feat: enhance workshop notification system for customers
- Updated WorkshopSchema to notify customers when a workshop is scheduled, improving engagement and communication.
- Added logic to fetch active services and include center information in the notification process.
- Implemented message creation for customers with the role of CUSTOMER, ensuring they receive timely updates about workshops.
- Utilized PubSub for real-time notifications, enhancing user experience and interaction with the platform.
2024-12-09 19:45:49 +07:00
tuankiet2s f5ee243dc7 feat: enhance resume submission notifications for moderators
- Updated ResumeSchema to notify moderators when a new resume is submitted, improving communication and response times.
- Refactored notification logic to streamline the process of sending messages to all relevant moderators, ensuring timely updates.
- Removed redundant checks for center owner notifications, simplifying the code while maintaining functionality.
2024-12-09 19:40:54 +07:00
tuankiet2s 092a15753b feat: enhance notification system and role-based access across schemas
- Updated MessageSchema to include context-aware filtering for notifications, allowing retrieval based on recipientId for NOTIFICATION and SYSTEM contexts.
- Enhanced RefundTicketSchema to notify moderators upon refund requests, improving communication and response times.
- Modified ResumeSchema to send notifications to mentors and center owners when a new resume is submitted, ensuring timely updates.
- Improved ServiceSchema to notify center owners and mentors about service approvals, enhancing user engagement and awareness.
- Implemented role-based access control checks across schemas to ensure only authorized users can perform specific actions, enhancing security and user experience.
2024-12-09 19:38:36 +07:00
tuankiet2s 9732d7b904 feat: enhance message retrieval logic with context-based filtering
- Updated the MessageSchema to include context-aware filtering for notifications, allowing retrieval of messages based on recipientId when the context is NOTIFICATION.
- Improved the resolve function to handle subscription checks, ensuring that unauthorized access is properly managed.
- Added error handling for cases where the context is not allowed, enhancing overall robustness of the message retrieval process.
2024-12-09 19:08:25 +07:00
tuankiet2s 4ba3077a9b refactor: enhance refund ticket logic and role-based access control
- Updated the RefundTicket schema to allow both customers and center mentors to request refunds, improving flexibility in refund processing.
- Refined bank detail checks to differentiate between customers and center mentors, ensuring appropriate handling of bank information.
- Implemented special handling for center mentors to always allow full refunds, enhancing user experience.
- Improved error messages and validation checks throughout the refund process for better clarity and user guidance.
2024-12-09 18:43:03 +07:00
tuankiet2s e3a06f1ba9 feat: add scheduled quiz notification task and enhance Quiz schema with scheduleId
- Introduced a new cron job in CronService to check for schedules with status WAITING_QUIZ and notify customers to complete their quizzes.
- Enhanced the Quiz schema by adding an optional 'scheduleId' argument to facilitate quiz retrieval based on specific schedules, improving user experience and data association.
- Updated role-based access control logic to ensure proper handling of quiz queries for customers and center mentors.
2024-12-09 18:35:01 +07:00
tuankiet2s 5ab89d5cfa fix: update centerMentorId reference in Quiz schema query
- Changed the centerMentorId reference in the Quiz schema to use centerMentor.mentorId instead of the current user's ID.
- This adjustment ensures that the correct mentor association is maintained in the query logic, enhancing data integrity and access control.
2024-12-09 17:55:09 +07:00
tuankiet2s 269563555f fix: extend role-based access control in Quiz schema
- Updated authorization logic to allow both CENTER_MENTOR and CENTER_OWNER roles access to Quiz queries and mutations.
- Enhanced security by refining user role checks to ensure proper access control.
2024-12-09 17:54:17 +07:00
tuankiet2s 2edd7c18e5 refactor: enhance Quiz schema with role-based access control and service ID requirement
- Added role-based access control to restrict access to Quiz queries and mutations for users with the CENTER_MENTOR role.
- Updated error messages for unauthorized access to improve clarity.
- Introduced a required 'serviceId' argument in the quizzes query to ensure proper filtering and association with the center mentor.
- Refactored existing authentication checks to maintain consistent error handling across the Quiz schema.
2024-12-09 17:53:47 +07:00
tuankiet2s 342fea041f feat: add service field to Quiz creation and enforce service ID requirement
- Introduced 'service' field in the Quiz creation input to enhance data structure.
- Added validation to ensure 'service ID' is provided during Quiz creation, improving data integrity.
- Updated centerMentor association logic to connect the current user as the center mentor for the Quiz.
2024-12-09 17:45:52 +07:00
tuankiet2s b8d7c52d63 chore: update subproject commit reference and enhance Prisma types
- Updated the subproject commit reference in epess-database to the latest version.
- Modified Prisma types in pothos.generated.ts to include 'Quiz' in relation names and list relations.
- Removed the 'TempOrder' type definition from PrismaTypes for improved clarity and maintainability.
2024-12-09 17:30:02 +07:00
tuankiet2s abcda1ae58 refactor: improve DateTime handling in GraphQL builder
- Streamlined DateTime serialization and parsing logic in the GraphQL builder for enhanced clarity and maintainability.
- Removed commented-out code to reduce clutter and improve code readability.
- Ensured consistent error handling for invalid DateTime values.
2024-12-09 17:24:00 +07:00
tuankiet2s 087bf3a3ad chore: update subproject commit reference and modify date handling in Cron service
- Updated the subproject commit reference in epess-database to the latest version.
- Changed the date handling in CronService to allow scheduling up to one day in advance instead of thirty minutes.
- Removed commented-out code in DocumentSchema for improved clarity and maintainability.
2024-12-09 17:20:30 +07:00
tuankiet2s 56762e98eb refactor: streamline collaborator check in Document schema
- Simplified the collaborator check logic in the DocumentSchema by condensing the condition into a single line for improved readability.
- Maintained existing functionality while enhancing code clarity and maintainability.
2024-12-09 17:11:18 +07:00
tuankiet2s 8d0b80f09c chore: update subproject commit reference and enhance error handling in schema files
- Updated the subproject commit reference in epess-database to the latest version.
- Changed error messages in CollaborationSession and Document schemas for improved clarity and security.
- Refactored error handling logic to ensure consistent user authentication checks across multiple schema files.
- Enhanced GraphQL module configuration with new options for better performance and error response handling.
2024-12-09 17:06:23 +07:00
tuankiet2s 951511228a chore: clean up GraphQL module request logging
- Removed unnecessary logging of session ID in the GraphQL module to streamline request handling.
- Maintained existing functionality while improving code clarity and reducing potential noise in logs.
2024-12-08 21:56:57 +07:00
tuankiet2s ba32ee8dc1 chore: refactor pub/sub iterator usage across schema files
- Updated pub/sub iterator methods from `asyncIterableIterator` to `asyncIterator` in multiple schema files for improved compatibility with the latest GraphQL subscriptions.
- Refactored subscription logic in CollaborationSession, Document, Message, User, and other schema files to enhance readability and maintainability.
- Adjusted imports in GraphQL builder to utilize RedisPubSub for better performance in subscription handling.
2024-12-08 21:54:23 +07:00
tuankiet2s 8b36e7d05a chore: update GraphQL module configuration and enhance server plugins
- Added ApolloServerPluginLandingPageLocalDefault for improved GraphQL playground experience.
- Disabled playground in production by setting it to false for better security.
- Updated logger configuration for clearer debugging and error handling in the GraphQL module.
2024-12-08 21:25:42 +07:00
tuankiet2s 45dca51990 chore: update biome configuration and enhance error handling in schema files
- Enabled useIgnoreFile in biome.json for better file management.
- Updated various correctness and style rules in biome.json to enforce stricter coding standards.
- Added new biome lint command in package.json for improved code quality checks.
- Refactored error handling in multiple schema files to use consistent error throwing patterns, enhancing readability and maintainability.
- Improved user authentication checks across various schemas to ensure proper access control.
2024-12-08 21:01:26 +07:00
tuankiet2s 10e20092ab chore: update configuration and improve schema imports
- Updated biome.json to include "graphql.d.ts" in the ignored files list.
- Updated subproject commit reference in epess-database to the latest version.
- Removed unused script from package.json and streamlined module file extensions in tsconfig.json.
- Consolidated exclude patterns in tsconfig.build.json for clarity.
- Refactored imports across multiple schema files for consistency and improved readability.
- Enhanced various schema files by ensuring proper import order and removing redundant code.
- Improved error handling and data integrity checks in several service and schema files.
2024-12-08 20:49:52 +07:00
tuankiet2s 9e6d62e4be chore: update package dependencies and improve pub/sub iterator usage
- Updated various package dependencies in package-lock.json and package.json for enhanced stability and performance.
- Changed pub/sub iterator methods from `asyncIterator` to `asyncIterableIterator` in multiple schema files for better compatibility with the latest GraphQL subscriptions.
- Added `moduleResolution` option in tsconfig.json to support Node.js-style module resolution.
2024-12-08 20:38:09 +07:00
tuankiet2s 16f6f8a629 chore: update package dependencies and adjust GraphQL upload imports
- Updated various package dependencies in package-lock.json and package.json for improved stability and performance.
- Changed import paths for graphql-upload to use .mjs extensions, ensuring compatibility with ES modules.
- Added @types/graphql-upload to package.json for better TypeScript support.
- Adjusted Jest configuration for improved readability and maintainability.
2024-12-07 19:54:37 +07:00
tuankiet2s 14a91a1885 chore: update subproject commit reference and enhance Quiz schema
- Updated the subproject commit reference in epess-database to the latest version.
- Enhanced QuizSchema by adding quizAttempt relation and submitQuiz mutation for improved quiz attempt handling.
- Updated Prisma types to include QuizAttempt, ensuring consistency across the application.
2024-12-07 19:39:16 +07:00
tuankiet2s 636be21a4c chore: update subproject commit reference in epess-database to latest version 2024-12-07 19:05:35 +07:00
tuankiet2s 7a0a404081 chore: update subproject commit and enhance PersonalMilestone schema
- Updated the subproject commit reference in epess-database to the latest version.
- Added milestoneOrder field to PersonalMilestoneSchema for improved milestone ordering.
- Ensured consistency in Prisma types with the latest schema changes.
2024-12-07 18:47:43 +07:00
tuankiet2s ae537d40f6 feat: integrate PersonalMilestoneModule into GraphQL module and update its configuration
- Added PersonalMilestoneModule to the GraphQL module imports, enhancing the overall functionality and data management.
- Updated PersonalMilestoneModule to use providers and exports for PersonalMilestoneSchema, improving module encapsulation and reusability.
2024-12-07 18:21:02 +07:00
tuankiet2s bb88d6ed00 feat: enhance QuizSchema and related schemas with new fields and relations
- Updated QuizSchema to expose correctAnswer as a field with a resolver, improving data retrieval for quizzes.
- Introduced new object types for correctAnswer, allowing for flexible data structures (StringType and StringListType).
- Modified createQuiz mutation to automatically associate the current user as centerMentorId, enhancing data integrity.
- Added personalMilestone relation to ScheduleSchema, linking schedules to personal milestones for better tracking.
- Included quiz relation in ServiceSchema, establishing a connection between services and their associated quizzes.
- Updated Prisma types to reflect the new relationships and fields, ensuring consistency across the application.
2024-12-07 18:18:33 +07:00
tuankiet2s d59df7d2ab feat: update collaboration session handling and schedule date status
- Removed redundant code for adding current user ID to collaborators in collaboration sessions.
- Implemented updates to schedule date status based on collaboration session conditions, enhancing the workflow for both customers and mentors.
- Improved error handling to ensure only authorized users can access collaboration sessions, maintaining data integrity and user experience.
2024-12-07 16:28:44 +07:00
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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
tuankiet2s 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