Skip to content

Add support for noticeboards#29

Merged
zmoog merged 13 commits intomainfrom
zmoog/add-support-for-noticeboards
Oct 18, 2025
Merged

Add support for noticeboards#29
zmoog merged 13 commits intomainfrom
zmoog/add-support-for-noticeboards

Conversation

@zmoog
Copy link
Copy Markdown
Owner

@zmoog zmoog commented Mar 12, 2024

Motivation

Add noticeboard support to list them and download the attachments.

Change description

Key changes:

  1. Architectural restructuring - Broke down the monolithic adapter.go into specialized receivers:
    - agenda.go - AgendaReceiver interface and implementation
    - grades.go - GradesReceiver interface and implementation
    - noticeboards.go - NoticeboardsReceiver interface and implementation (NEW)
    - spaggiari.go - Centralized SpaggiariClient with Get/Post methods
  2. New Noticeboard Feature - Complete implementation for:
    - Listing noticeboards (adapters/spaggiari/noticeboards.go:18)
    - Marking noticeboards as read (adapters/spaggiari/noticeboards.go:48)
    - Downloading attachments (adapters/spaggiari/noticeboards.go:63)
    - CLI commands for listing and downloading (entrypoints/cli/cmd/noticeboards/)
  3. Improved Code Reusability:
    - Created SpaggiariClient with shared Get/Post methods and Unmarshal callback pattern
    - Eliminated code duplication across agenda, grades, and noticeboards
  4. Test Improvements:
    - Updated mocks to use testify/mock v2.42.0 style
    - Fixed mock initialization in tests
    - Added proper mock expectations

Additional Notes

Reviewer checklist

  • PR address a single concern.
  • PR title and description are appropriately filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
  • Docs are updated (at least the README.md, if needed).
  • History is clean, commit messages are meaningful (see CONTRIBUTING.md) and are well-formatted.

@zmoog zmoog self-assigned this Mar 12, 2024
@zmoog zmoog added the enhancement New feature or request label Mar 12, 2024
@zmoog zmoog marked this pull request as ready for review October 18, 2025 06:42
@zmoog zmoog requested a review from Copilot October 18, 2025 06:42
Copy link
Copy Markdown

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 adds comprehensive support for noticeboards functionality to the Classeviva CLI tool. The implementation follows a cleaner architectural pattern by breaking down the monolithic adapter into specialized receivers.

Key Changes:

  • Introduced noticeboard features (list, mark as read, download attachments) with dedicated CLI commands
  • Refactored the adapter architecture into specialized receivers (Agenda, Grades, Noticeboards) with a centralized SpaggiariClient
  • Updated all mocks to use testify/mock v2.42.0 with improved initialization patterns

Reviewed Changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
adapters/spaggiari/spaggiari.go Introduces centralized SpaggiariClient with shared Get/Post methods and factory function for creating adapters
adapters/spaggiari/noticeboards.go Implements NoticeboardsReceiver interface with list, download, and mark-as-read functionality
adapters/spaggiari/agenda.go Refactored agenda functionality into dedicated receiver using new Client interface
adapters/spaggiari/grades.go Refactored grades functionality into dedicated receiver using new Client interface
adapters/spaggiari/model.go Adds Noticeboard data structure with attachments support
commands/noticeboards.go Implements list and download commands for noticeboards with table-formatted output
entrypoints/cli/cmd/noticeboards/ Adds CLI command handlers for noticeboard list and download operations
mocks/ Updates all mocks to v2.42.0 style with proper cleanup and new mock types for refactored interfaces
.tool-versions Updates Go version to 1.25.1

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread entrypoints/cli/cmd/noticeboards/download.go Outdated
Comment thread commands/agenda_test.go Outdated
Comment thread commands/agenda_test.go Outdated
@zmoog zmoog merged commit ffae726 into main Oct 18, 2025
4 checks passed
@zmoog zmoog deleted the zmoog/add-support-for-noticeboards branch October 18, 2025 06:52
@github-project-automation github-project-automation Bot moved this from In Progress to Done in classeviva Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants