Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 23, 2025

Adds digital certificate issuance for completed courses with search, verification, and printable display capabilities.

Backend Changes

API Endpoints (CertificatesController)

  • GET /api/certificates - Multi-criteria search (student name, certificate number, course/student ID)
  • GET /api/certificates/verify/{identifier} - Certificate verification by ID or number
  • POST /api/certificates - Certificate creation with auto-generated number and digital signature

Service Layer (CertificateService)

  • Thread-safe certificate number generation using lock
  • Verification URL and QR code data generation
  • Search methods for course ID and certificate number lookups

Data Model (CertificateDto)

public class CertificateDto
{
    // ... existing fields
    public string? VerificationUrl { get; set; }
    public string? QRCodeData { get; set; }
}

Frontend Changes

Certificate Search (certificates.html, certificates.js)

  • Search interface with student name and certificate number inputs
  • Certificate cards with color-coded grades (A-F)
  • Real-time search results display

Certificate Viewer (certificate-styles.css)

  • Printable certificate modal with professional formatting
  • Student details, course info, instructor signature
  • QR code placeholder for verification
  • Digital signature display

Security

  • Input sanitization via escapeHtml() to prevent XSS
  • Grade class mapping fixed (numeric enum → CSS letter classes)

Testing

18 unit tests for CertificateService covering search, creation, and verification flows.

Screenshots

Search Interface
Certificate Search

Search Results
Search Results

Certificate Display
Certificate Viewer

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement a comprehensive certificate generation and display system</issue_title>
<issue_description>Develop a robust certificate generation and display feature for the Course Registration System. The system should allow users to search for and view digital certificates for completed courses. Consider both backend and frontend requirements, integration with course data, security for certificate access, and an intuitive UI for searching and displaying certificates.

Key requirements:

  • Users should be able to search for certificates by various parameters (e.g., user name, course, certificate ID)
  • Digital certificates must be generated upon course completion
  • Certificates should contain relevant course, user, and completion details
  • Implement certificate display with a downloadable and printable view
  • Integrate with backend and ensure secure certificate retrieval
  • Add appropriate formatting, branding, and a verification method (such as unique QR code or certificate number)

Please split the implementation into well-defined subtasks as appropriate.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link

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.

Copilot wasn't able to review any files in this pull request.

…h capabilities

Co-authored-by: Hemavathi15sg <224925058+Hemavathi15sg@users.noreply.github.com>
Comment on lines +80 to +84
catch (Exception ex)
{
Log.Error(ex, "Error searching for certificates");
return StatusCode(500, new { message = "An error occurred while searching for certificates" });
}
Comment on lines +111 to +115
catch (Exception ex)
{
Log.Error(ex, "Error retrieving certificate {CertificateId}", id);
return StatusCode(500, new { message = "An error occurred while retrieving the certificate" });
}
Comment on lines +133 to +137
catch (Exception ex)
{
Log.Error(ex, "Error retrieving certificates for student {StudentId}", studentId);
return StatusCode(500, new { message = "An error occurred while retrieving certificates" });
}
Comment on lines +155 to +159
catch (Exception ex)
{
Log.Error(ex, "Error retrieving certificates for course {CourseId}", courseId);
return StatusCode(500, new { message = "An error occurred while retrieving certificates" });
}
Comment on lines +196 to +200
catch (Exception ex)
{
Log.Error(ex, "Error verifying certificate {Identifier}", identifier);
return StatusCode(500, new { message = "An error occurred while verifying the certificate" });
}
Comment on lines +232 to +236
catch (Exception ex)
{
Log.Error(ex, "Error creating certificate");
return StatusCode(500, new { message = "An error occurred while creating the certificate" });
}
Copilot AI and others added 2 commits December 23, 2025 05:34
…ystem implementation

Co-authored-by: Hemavathi15sg <224925058+Hemavathi15sg@users.noreply.github.com>
…ber generation

Co-authored-by: Hemavathi15sg <224925058+Hemavathi15sg@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement certificate generation and display feature Implement certificate generation and display system with search and verification Dec 23, 2025
Copilot AI requested a review from Hemavathi15sg December 23, 2025 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a comprehensive certificate generation and display system

1 participant