Skip to content

T009: [P] Create CertificateAuditLog immutable entity #46

@Hemavathi15sg

Description

@Hemavathi15sg

Phase 2: Foundational

Task: T009
Status: Not Started
Story: Foundational (blocking all user stories)
Parallelizable: Yes - independent from T007-T008, T010

Description

Create CertificateAuditLog immutable event log entity for all certificate lifecycle events.

Acceptance Criteria

  • File created: api/CourseRegistration.Domain/Entities/CertificateAuditLog.cs
  • All 8+ properties implemented (see data-model.md):
    • AuditLogId (Guid, PK)
    • CertificateId (Guid, FK)
    • EventType (enum: Issued, Revoked, Verified, Expired)
    • AdminUserId (int, FK, nullable)
    • EventTimestamp (datetime2, UTC)
    • Reason (string, nullable, for revocation reason)
    • EventDetails (string JSON, for extensibility)
    • IsDeleted (bit, soft delete)
    • CreatedUtc (datetime2)
  • Immutability enforced: Property setters private or init-only
  • EventType enum defined with all 4 event types
  • Insert-only pattern: no modification/deletion allowed in domain logic
  • XML documentation on public members

Effort Estimate

2.5 hours

References

  • data-model.md: CertificateAuditLog Entity section
  • research.md: Audit logging patterns

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions