Skip to content

add use cases for editing template to TemplatesRepository.ts#430

Open
ekraffmiller wants to merge 10 commits intodevelopfrom
427-edit-template-use-cases
Open

add use cases for editing template to TemplatesRepository.ts#430
ekraffmiller wants to merge 10 commits intodevelopfrom
427-edit-template-use-cases

Conversation

@ekraffmiller
Copy link
Contributor

@ekraffmiller ekraffmiller commented Feb 23, 2026

What this PR does / why we need it:

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

I updated the github actions to use a new version of node because the actions were intermittently failing during the build.

Suggestions on how to test this:

review/run test code

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

yes

Additional documentation:

@github-actions github-actions bot added FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) GREI Re-arch GREI re-architecture-related SPA.Q1.2026.6 labels Feb 23, 2026
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 pull request adds three new use cases for editing dataset templates: updating template metadata, license terms, and terms of access. The changes follow the existing architectural patterns in the codebase with proper separation between domain use cases, repository interfaces, and infrastructure implementations. The PR includes comprehensive test coverage at both unit and functional levels.

Changes:

  • Added three new use case classes (UpdateTemplateMetadata, UpdateTemplateLicenseTerms, UpdateTemplateTermsOfAccess) with corresponding DTOs
  • Extended ITemplatesRepository interface and TemplatesRepository implementation with three new methods
  • Added a transformer function for terms of access payload conversion
  • Updated GitHub Actions workflows to use newer versions (Node 22, actions v4)
  • Modified test environment to use a custom Dataverse image for testing new API endpoints
  • Enhanced test resilience for concurrent execution in GetDatasetAvailableDatasetTypes test

Reviewed changes

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

Show a summary per file
File Description
src/templates/domain/useCases/UpdateTemplateMetadata.ts New use case for updating template metadata with optional replace parameter
src/templates/domain/useCases/UpdateTemplateLicenseTerms.ts New use case for updating template license terms
src/templates/domain/useCases/UpdateTemplateTermsOfAccess.ts New use case for updating template terms of access
src/templates/domain/dtos/UpdateTemplateMetadataDTO.ts DTO for template metadata updates
src/templates/domain/dtos/UpdateTemplateLicenseTermsDTO.ts DTO for license terms updates
src/templates/domain/repositories/ITemplatesRepository.ts Extended interface with three new update methods
src/templates/infra/repositories/TemplatesRepository.ts Implementation of update methods using a private helper
src/templates/infra/repositories/transformers/templateTermsOfAccessTransformers.ts Transformer for converting TermsOfAccess to API payload format
src/templates/index.ts Exported new use cases and DTOs
test/unit/templates/UpdateTemplateMetadata.test.ts Unit tests for metadata update use case
test/unit/templates/UpdateTemplateLicenseTerms.test.ts Unit tests for license terms update use case
test/unit/templates/UpdateTemplateTermsOfAccess.test.ts Unit tests for terms of access update use case
test/unit/templates/TemplatesRepositoryTemplateUpdates.test.ts Unit tests for repository update methods
test/functional/templates/UpdateTemplateMetadata.test.ts Functional test for metadata updates
test/functional/templates/UpdateTemplateLicenseTerms.test.ts Functional test for license terms updates
test/functional/templates/UpdateTemplateTermsOfAccess.test.ts Functional test for terms of access updates
test/functional/datasets/GetDatasetAvailableDatasetTypes.test.ts Enhanced test to handle concurrent execution
test/environment/.env Updated to use custom Dataverse image for testing new APIs
.github/workflows/lint.yml Updated to Node 22 and actions v4
.github/workflows/deploy_pr.yml Updated to Node 22 and actions v4
.github/workflows/deploy_alpha.yml Updated to Node 22 and actions v4

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

DATAVERSE_IMAGE_REGISTRY=docker.io
DATAVERSE_IMAGE_TAG=unstable
DATAVERSE_IMAGE_REGISTRY=ghcr.io
DATAVERSE_IMAGE_TAG=11912-edit-template-api
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The DATAVERSE_IMAGE_TAG uses "11912-edit-template-api", but the PR description states this PR depends on "IQSS/dataverse/12159". There appears to be a discrepancy in the PR numbers. Please verify that this is the correct image tag that corresponds to the dependent backend PR, or update it to match PR 12159 if that's the correct dependency.

Copilot uses AI. Check for mistakes.
@ekraffmiller ekraffmiller marked this pull request as ready for review February 26, 2026 17:48
@ekraffmiller ekraffmiller moved this to Ready for Review ⏩ in IQSS Dataverse Project Feb 26, 2026
@ChengShi-1 ChengShi-1 self-assigned this Feb 26, 2026
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) GREI Re-arch GREI re-architecture-related SPA.Q1.2026.6

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

Edit Template Use Case

3 participants