Skip to content

Extend get guestbooks use case with stats and Download responses#449

Open
ChengShi-1 wants to merge 5 commits into
developfrom
448-add-usage-and-response-counts-to-get-guestbooks-use-case
Open

Extend get guestbooks use case with stats and Download responses#449
ChengShi-1 wants to merge 5 commits into
developfrom
448-add-usage-and-response-counts-to-get-guestbooks-use-case

Conversation

@ChengShi-1
Copy link
Copy Markdown
Contributor

@ChengShi-1 ChengShi-1 commented May 11, 2026

What this PR does / why we need it:

  • Get Guestbooks By Collection Id: Added optional includeStats support to getGuestbooksByCollectionId, returning usageCount and responseCount when requested.
  • write use cases of downloading all responses of a collection or download responses of a guestbook

Which issue(s) this PR closes:

Related Dataverse PRs:

  • Depends on #

Special notes for your reviewer:

Test failed about storage drive, so I also copy pastes a CollectionHelper.ts from this PR. waiting to be merged
https://github.com/IQSS/dataverse-client-javascript/pull/431/changes#diff-edac108c1a43d5773116d19797d04ecdf890fc97b5cf83ce2d56d38b9a7aca18

Suggestions on how to test this:

Is there a release notes or changelog update needed for this change?:

Additional documentation:

@ChengShi-1 ChengShi-1 linked an issue May 11, 2026 that may be closed by this pull request
@github-actions github-actions Bot added FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) GREI Re-arch GREI re-architecture-related labels May 11, 2026
@ChengShi-1 ChengShi-1 added the Size: 3 A percentage of a sprint. 2.1 hours. label May 11, 2026
@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project May 11, 2026
@ChengShi-1 ChengShi-1 marked this pull request as ready for review May 11, 2026 21:08
Copilot AI review requested due to automatic review settings May 11, 2026 21:08
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Progress 💻 in IQSS Dataverse Project May 11, 2026
@ChengShi-1 ChengShi-1 self-assigned this May 11, 2026
Copy link
Copy Markdown
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

Adds optional guestbook usage/response statistics support to the “get guestbooks by collection” flow, aligning the client with the Dataverse API enhancement needed for the Manage Guestbooks UI.

Changes:

  • Extended getGuestbooksByCollectionId to accept an optional includeStats flag and send it as a query parameter when enabled.
  • Updated the Guestbook domain model to optionally expose usageCount and responseCount.
  • Added/updated unit + integration tests, plus documentation and changelog entries.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/unit/guestbooks/GuestbooksRepository.test.ts New unit coverage for repository query param behavior and error handling.
test/unit/guestbooks/GetGuestbooksByCollectionId.test.ts Adds unit coverage for the use case passing includeStats.
test/integration/guestbooks/GuestbooksRepository.test.ts Adds integration coverage for listing stats and verifying count changes via assignment + guest response submission.
src/guestbooks/infra/repositories/GuestbooksRepository.ts Adds includeStats param and forwards it as query params when true.
src/guestbooks/domain/useCases/GetGuestbooksByCollectionId.ts Extends use case API to accept includeStats.
src/guestbooks/domain/repositories/IGuestbooksRepository.ts Updates repository interface to include optional includeStats.
src/guestbooks/domain/models/Guestbook.ts Adds optional usageCount and responseCount fields.
docs/useCases.md Documents the new includeStats parameter and updates example usage.
CHANGELOG.md Adds an Unreleased entry describing the new includeStats support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/guestbooks/domain/useCases/GetGuestbooksByCollectionId.ts
@ChengShi-1 ChengShi-1 changed the title Extend get guestbooks use case with stats Extend get guestbooks use case with stats and Download responses May 18, 2026
@ChengShi-1 ChengShi-1 removed their assignment May 19, 2026
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) GREI Re-arch GREI re-architecture-related Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

Add usage and response counts to get guestbooks use case

2 participants