Skip to content

feat(reports): update reports API to the latest docs - #423

Merged
andrii-bodnar merged 1 commit into
masterfrom
feature/reports-api
Oct 27, 2026
Merged

andrii-bodnar merged 1 commit into
masterfrom
feature/reports-api

Conversation

@katerina20

@katerina20 katerina20 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Part of updating the SDK to the current Crowdin API docs. This PR covers the Reports API.

Fixes

  • Report archive URLs:
    • downloadReportArchive built reports/archives{archiveId}/… with the slash missing, so it always failed.
    • listReportArchives used a trailing slash (reports/archives/).
    • The test mocks had copied the wrong URLs; they now use the documented ones.
  • Group report requests:
    • GroupQaCheckIssuesGenerateReportRequest, GroupTaskUsageGenerateReportRequest and GroupTranslationActivityGenerateReportRequest extended the project request base. They could not be passed to generateGroupReport or generateOrganizationReport.
    • Matching schemas now live in GenerateGroupReportRequest, and the old classes are deprecated.
    • Group task usage taskType is now sent as the documented typeTasks.
  • Javadoc:
    • deleteReportSettingsTemplate and checkReportArchiveExportStatus now link the right operations.
    • The project settings-template methods link Crowdin only, because Enterprise has no such route.

New report types

  • Project reports:
    • TimeSpentGenerateReportRequest (time-spent).
    • TaskUsageGenerateReportRequest (task-usage, Enterprise), with workload, created-vs-resolved, performance, time and cost variants.
  • Group/organization reports, new schemas in GenerateGroupReportRequest:
    • source content updates
    • time spent
    • pre-translate accuracy (general and by task)
    • translator accuracy
    • saving activity
    • translation costs by task
    • QA check issues
    • translation activity
    • task usage

New fields

  • Existing project report schemas:
    • matchScoreCategories, skipArchiving.
    • The file/directory/branch/label filters, taskIds, userIds.
    • useCategoryBasedProofreadRates, useTmEditDistance.
    • Saving activity mode.
  • Settings templates (project, user, organization):
    • baseRates, netRateSchemes, calculateInternalMatches, includePreTranslatedStrings, useCategoryBasedProofreadRates, useTmEditDistance.
    • Hourly rates.
  • Enums: Unit.HOURS, Currency.DDK/PLN, GroupingParameter.PROJECT.
  • Archives:
    • ReportArchive.status/progress.
    • New overload listReportArchives(userId, ListReportArchivesParams) with scopeType, scopeId, userId, taskId, name, dateFrom, dateTo.

Deprecated (still working)

  • postEditingCategories: use matchScoreCategories.
  • taskId in the costs by-task schemas: use taskIds.
  • excludeApprovalsForEditedTranslations and preTranslatedStringsCategorizationAdjustment: deprecated in the API.
  • GroupTopMembersSchema.groupBy: not part of the API.
  • ReportSettingsTemplate.Config.regularRates, RegularRate and Mode: use baseRates/netRateSchemes.

Backward compatibility

  • Signatures: no public method, field or class was removed, renamed or retyped.
  • Behaviour corrections:
    • The archive URLs above.
    • GroupTaskUsageGenerateReportRequest.Schema.setTaskType(x) now sends "typeTasks" instead of "taskType".
  • New enum constants: exhaustive switch statements over Unit, Currency and GroupingParameter will see new values.

Open questions for review

Both questions were resolved after merge in #425:

  1. MatchType: Match now keeps the raw matchType string (matchTypeValue), so any documented range (100-82, 100-74, …) is sent and read without loss. The enum accessors are unchanged.
  2. Deprecated fields: the deprecated fields introduced here (postEditingCategories in the new group accuracy schemas; excludeApprovalsForEditedTranslations/preTranslatedStringsCategorizationAdjustment in the group costs by-task schema and ReportSettingsTemplate.Config) were removed. They were never part of a release.

Testing

  • ./gradlew build: 661 tests, 0 failures, on both JDK 17 and JDK 8.
  • ./gradlew javadoc on JDK 8: no errors.
  • New mock tests and fixtures cover:
    • every new project and group report type;
    • the corrected archive URLs and the archive list overload (Crowdin and Enterprise paths);
    • hourly and post-editing settings templates;
    • the typeTasks request JSON;
    • the new ReportArchive fields.

🤖 Generated with Claude Code

Fixes:
- downloadReportArchive built "reports/archives{id}" without a slash;
  listReportArchives used a trailing slash
- GroupQaCheckIssues/GroupTaskUsage/GroupTranslationActivity request
  classes extended the project request base and could not be passed to
  generateGroupReport/generateOrganizationReport: add matching schemas
  to GenerateGroupReportRequest and deprecate the old classes;
  group task usage `taskType` is sent as the documented `typeTasks`
- Javadoc operation links for deleteReportSettingsTemplate and
  checkReportArchiveExportStatus

New report types and fields:
- project reports: time-spent and task-usage (Enterprise)
- group/organization reports: source content updates, time spent,
  pre-translate accuracy (general and by task), translator accuracy,
  saving activity, translation costs by task, QA check issues,
  translation activity and task usage schemas
- matchScoreCategories, skipArchiving, file/directory/branch/label
  filters, taskIds, userIds, useCategoryBasedProofreadRates,
  useTmEditDistance and saving activity mode on existing schemas
- settings templates: baseRates, netRateSchemes and the remaining
  post-editing/hourly config options; Unit.HOURS, Currency DDK/PLN,
  GroupingParameter.PROJECT
- ReportArchive status/progress; listReportArchives(userId, params)
  with scopeType, scopeId, userId, taskId, name, dateFrom, dateTo

Deprecations: postEditingCategories (use matchScoreCategories),
taskId (use taskIds), excludeApprovalsForEditedTranslations,
preTranslatedStringsCategorizationAdjustment, GroupTopMembersSchema.groupBy,
ReportSettingsTemplate regularRates/RegularRate/Mode.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@andrii-bodnar
andrii-bodnar merged commit 5a84073 into master Oct 27, 2026
2 checks passed
@andrii-bodnar
andrii-bodnar deleted the feature/reports-api branch October 27, 2026 08:42
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.

2 participants