Commit Graph

30 Commits

Author SHA1 Message Date
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
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
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
68353d8985 feat: implement AI suggestion 2024-12-12 21:22:50 +07:00
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
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
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
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
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
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
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
Tyranno
8b40c9ada5 Update quiz.schema.ts 2024-12-09 20:44:39 +07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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