Skip to content

Conversation

@GravityDarkLab
Copy link
Collaborator

🔧 Overview

This pull request introduces multiple enhancements, including:

  • Updated and more structured GitHub issue templates (in English and German)
  • Backend support for partial course updates via PATCH
  • Client-side HTTP method alignment with the backend
  • Comprehensive backend unit tests for the new update logic

🗂️ Changes Breakdown

📄 Issue Templates

  • Removed the old bug report template:
    🗑️ .github/ISSUE_TEMPLATE/bug_report.md

  • Added two new structured templates:

    • ✅ English template: .github/ISSUE_TEMPLATE/issue_en.md
    • ✅ German template: .github/ISSUE_TEMPLATE/issue_de.md

Each includes standard sections for:

  • Description
  • User Story
  • Acceptance Criteria
  • Proposed Solution
  • Related Issues / Assignees / Priority

🛠️ Backend: Partial Course Updates

  • Controller

    • Added PATCH /courses/{id} endpoint in CourseController
      updateCoursePartial(...) method
  • DTO

    • Introduced CourseUpdateRequest to support flexible, field-specific updates
  • Service Layer

    • Extended CourseService and CourseServiceImpl with updateCoursePartial(...)

    • Ensures safe merging of fields like:

      • Skills
      • Categories
      • Modules (maintains order and structure)
    • Avoids overwriting unchanged fields

  • 📄 Affected Files:

    • CourseController.java
    • CourseUpdateRequest.java
    • CourseService.java
    • CourseServiceImpl.java

🧪 Backend: Unit Tests

  • Added dedicated tests for the new partial update logic in:

    • CourseControllerTest.java
  • Covers:

    • Updating metadata fields
    • Updating nested entities (modules, skills)
    • Empty/no-op updates
    • Error handling for non-existent course IDs

🌐 Client-Side: HTTP Method Update

  • Updated HTTP methods from PUT to PATCH for:

    • completeLesson(...)
    • completeCourse(...)
  • 📄 File: client/src/services/course.service.ts

  • Aligns client behavior with new backend support for partial updates


📌 Summary

This PR brings the course update functionality in line with REST best practices by introducing PATCH support, improves flexibility with a clean DTO pattern, strengthens test coverage, and unifies backend/frontend behavior. It also introduces better structured, multilingual issue templates to streamline collaboration.

@GravityDarkLab GravityDarkLab requested a review from Copilot July 19, 2025 22:09
@GravityDarkLab GravityDarkLab self-assigned this Jul 19, 2025
@GravityDarkLab GravityDarkLab linked an issue Jul 19, 2025 that may be closed by this pull request
7 tasks
@GravityDarkLab GravityDarkLab added bug Something isn't working server labels Jul 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements PATCH support for partial course updates, improves GitHub issue templates, and aligns client-server HTTP methods. The main focus is adding backend functionality for updating specific course fields without requiring all mandatory data, along with comprehensive testing and updated issue templates in both English and German.

  • Backend PATCH endpoint implementation with new CourseUpdateRequest DTO for partial updates
  • Client-side HTTP method alignment from PUT to PATCH for lesson and course completion
  • Replacement of basic bug report template with structured bilingual issue templates

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
CourseController.java Adds new PATCH endpoint for partial course updates
CourseUpdateRequest.java New DTO supporting optional fields for partial updates
CourseService.java & CourseServiceImpl.java Implements partial update logic with field merging
CourseControllerTest.java & CourseServiceImplTest.java Comprehensive test coverage for new partial update functionality
course.service.ts Updates HTTP methods from PUT to PATCH for consistency
issue_en.md & issue_de.md New structured issue templates in English and German
bug_report.md Removes old basic bug report template

@GravityDarkLab GravityDarkLab merged commit 7bee87d into main Jul 19, 2025
9 checks passed
@GravityDarkLab GravityDarkLab deleted the 78-bug-server-error-when-marking-lesson-as-complete branch July 20, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Server Error When Marking Lesson as Complete

2 participants