Skip to content

task: add domain entities for application runs and items#60

Open
na66im wants to merge 1 commit intomainfrom
task/TSSDK-51-introduce-domain-entities-in-tssdk
Open

task: add domain entities for application runs and items#60
na66im wants to merge 1 commit intomainfrom
task/TSSDK-51-introduce-domain-entities-in-tssdk

Conversation

@na66im
Copy link
Contributor

@na66im na66im commented Mar 9, 2026

Introduce domain entities for Application Runs and Run Items

Summary

Enrich raw API responses (RunReadResponse, ItemResultReadResponse) with computed properties so SDK consumers no longer need to derive progress, status, or download eligibility themselves.

listApplicationRuns(), getRun(), and listRunResults() now return ApplicationRun / ApplicationRunItem entities with:

  • progress (runs only) — percentage (0–100) of items in a terminal state
  • status — simplified human-readable status (PENDING, PROCESSING, COMPLETED, COMPLETED_WITH_ERRORS, CANCELED, FAILED / SKIPPED)
  • can_download — whether results are available for download

Changes

  • New packages/sdk/src/entities/application-run/ — types, utility functions, processor, and tests
  • New packages/sdk/src/entities/run-item/ — types, utility functions, processor, and tests
  • Updated PlatformSDKHttp methods to return enriched entities
  • Updated existing SDK tests to assert enriched properties
  • Exported all new types and utilities from packages/sdk/src/index.ts

@na66im na66im self-assigned this Mar 9, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 12:54
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   96.16%   96.38%   +0.22%     
==========================================
  Files           9       13       +4     
  Lines        1225     1301      +76     
  Branches      174      190      +16     
==========================================
+ Hits         1178     1254      +76     
  Misses         47       47              
Flag Coverage Δ
unittests 96.38% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ntities/application-run/process-application-run.ts 100.00% <100.00%> (ø)
packages/sdk/src/entities/application-run/utils.ts 100.00% <100.00%> (ø)
...ages/sdk/src/entities/run-item/process-run-item.ts 100.00% <100.00%> (ø)
packages/sdk/src/entities/run-item/utils.ts 100.00% <100.00%> (ø)
packages/sdk/src/platform-sdk.ts 94.08% <100.00%> (+0.05%) ⬆️

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

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 introduces domain “entity” wrappers in the SDK that enrich raw OpenAPI responses for application runs and run items with computed fields (progress, simplified status, and download eligibility), and updates PlatformSDKHttp to return these enriched entities.

Changes:

  • Added ApplicationRun + ApplicationRunItem entity types, processors, and utility functions (with unit tests).
  • Updated PlatformSDKHttp.listApplicationRuns(), getRun(), and listRunResults() to return enriched entities.
  • Re-exported new entity APIs from the SDK entrypoint.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
packages/sdk/src/platform-sdk.ts Maps API responses through new processors and updates method return types.
packages/sdk/src/platform-sdk.test.ts Adds assertions that enriched fields exist on SDK responses.
packages/sdk/src/index.ts Exports new entity types/utilities/processors.
packages/sdk/src/entities/run-item/utils.ts Adds derived item status + download eligibility helpers.
packages/sdk/src/entities/run-item/utils.spec.ts Unit tests for run-item utility functions.
packages/sdk/src/entities/run-item/types.ts Defines ApplicationRunItem and ItemStatus.
packages/sdk/src/entities/run-item/process-run-item.ts Processor to enrich a raw run-item response.
packages/sdk/src/entities/run-item/process-run-item.spec.ts Unit tests for run-item processor.
packages/sdk/src/entities/application-run/utils.ts Adds derived run status/progress + download eligibility helpers.
packages/sdk/src/entities/application-run/utils.spec.ts Unit tests for application-run utility functions.
packages/sdk/src/entities/application-run/types.ts Defines ApplicationRun and RunStatus.
packages/sdk/src/entities/application-run/process-application-run.ts Processor to enrich a raw run response.
packages/sdk/src/entities/application-run/process-application-run.spec.ts Unit tests for application-run processor.
ATTRIBUTIONS.md Updates recorded lodash-es version.

@na66im na66im force-pushed the task/TSSDK-51-introduce-domain-entities-in-tssdk branch 2 times, most recently from 6de0a22 to bf346d6 Compare March 10, 2026 08:51
Copilot AI review requested due to automatic review settings March 10, 2026 08:51
Copy link

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

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

@na66im na66im force-pushed the task/TSSDK-51-introduce-domain-entities-in-tssdk branch from bf346d6 to 76dd43e Compare March 16, 2026 12:46
@sonarqubecloud
Copy link

@na66im na66im requested review from mk0x9 and santi698 March 16, 2026 13:25
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