Skip to content

SDK-2738: .NET - Expose IDV breakdown "process" property - dotnet#550

Open
mehmet-yoti wants to merge 1 commit into
developmentfrom
websdk-auto/SDK-2738-dotnet-expose-idv-breakdown-process-property
Open

SDK-2738: .NET - Expose IDV breakdown "process" property - dotnet#550
mehmet-yoti wants to merge 1 commit into
developmentfrom
websdk-auto/SDK-2738-dotnet-expose-idv-breakdown-process-property

Conversation

@mehmet-yoti

Copy link
Copy Markdown
Contributor

Summary

Exposes the process property from the IDV (Identity Verification) breakdown API response in the .NET SDK. The process field indicates how a particular sub-check was handled (e.g., AUTOMATED or EXPERT_REVIEW) and was previously returned by the backend but silently dropped during deserialization. This change makes it accessible to SDK consumers via BreakdownResponse.Process.

Changes

  • src/Yoti.Auth/DocScan/Session/Retrieve/BreakdownResponse.cs — Added Process public property with [JsonProperty("process")] deserialization mapping, following the same pattern as existing SubCheck, Result, and Details properties.
  • test/Yoti.Auth.Tests/DocScan/Session/Retrieve/Check/CheckResponseTests.cs — Added three new unit tests covering:
    • CheckBreakdownResponseProcessIsAutomated — verifies "AUTOMATED" is correctly deserialized.
    • CheckBreakdownResponseProcessIsExpertReview — verifies "EXPERT_REVIEW" is correctly deserialized.
    • CheckBreakdownResponseProcessIsNullWhenAbsent — verifies Process is null when the field is absent from the JSON payload.
    • Updated the shared helper GetBreakdownResponse() and AssertBreakdownResponseValuesCorrect() to include process in existing round-trip assertions.

QA Test Steps

  1. Setup: Check out branch websdk-auto/SDK-2738-dotnet-expose-idv-breakdown-process-property and restore NuGet packages (dotnet restore).
  2. Run the test suite: Execute dotnet test (or run CheckResponseTests specifically) and confirm all tests pass, including the three new CheckBreakdownResponseProcess* tests.
  3. Happy path — AUTOMATED: Simulate a BreakdownResponse JSON payload containing "process": "AUTOMATED" and assert response.Process == "AUTOMATED". Covered by CheckBreakdownResponseProcessIsAutomated.
  4. Happy path — EXPERT_REVIEW: Simulate a payload containing "process": "EXPERT_REVIEW" and assert response.Process == "EXPERT_REVIEW". Covered by CheckBreakdownResponseProcessIsExpertReview.
  5. Edge case — missing field: Simulate a payload with no process key (older API responses) and assert response.Process == null. Covered by CheckBreakdownResponseProcessIsNullWhenAbsent.
  6. Regression — existing breakdown parsing: Run CheckBreakdownResponseIsParsed and all other existing CheckResponseTests to confirm no regressions were introduced in SubCheck, Result, and Details deserialization.
  7. Integration (if environment available): Retrieve a real IDV session via GET /sessions/{sessionId} from the DocScan API and traverse session.Checks[*].Report.Breakdown[*].Process to confirm the value is populated as expected from a live response.

Notes

  • The Process property is read-only (private set) and JSON-only, consistent with the rest of the BreakdownResponse model — there is no public setter and the field cannot be set programmatically.
  • Known values at time of implementation are "AUTOMATED" and "EXPERT_REVIEW", but the property is typed as string to handle any future values the backend may introduce without requiring an SDK update.
  • No public API surface (interfaces, constructors, or serialization contracts) was changed; this is a purely additive, non-breaking change.
  • No changes were required to the session retrieval or mapping layers — BreakdownResponse is deserialized directly from raw JSON by Newtonsoft.Json.

Related Jira: SDK-2738
Auto-generated by n8n + Claude CLI

@mehmet-yoti

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code Review

Code Review Findings

Summary

This change adds a Process property to BreakdownResponse to expose the IDV breakdown "process" field (e.g. AUTOMATED, EXPERT_REVIEW) returned by the DocScan API, plus tests covering the populated and absent cases. The implementation is minimal, idiomatic, and consistent with the existing pattern used for sibling string properties on this class. It is well-tested and ready to merge.

Critical

None

Major

None

Minor

None

Nit

  • src/Yoti.Auth/DocScan/Session/Retrieve/BreakdownResponse.cs:20-21 — The new Process property has no XML <summary> doc comment. The class itself is documented but its properties are not, so this is consistent with SubCheck/Result/Details above it. Optional: if Process has a constrained set of values (AUTOMATED, EXPERT_REVIEW), a one-line summary documenting the expected values would help consumers, since the property is typed as a free-form string rather than an enum. No change required for consistency.

  • src/Yoti.Auth/DocScan/Session/Retrieve/BreakdownResponse.cs:23 — File still ends without a trailing newline (the \ No newline at end of file marker in the diff). The sibling files (RecommendationResponse.cs, DetailsResponse.cs) in the same directory also lack a trailing newline, so this matches the established convention — flagging for awareness only.

  • test/Yoti.Auth.Tests/DocScan/Session/Retrieve/Check/CheckResponseTests.cs:110-157 — The three new dedicated tests (...ProcessIsAutomated, ...ProcessIsExpertReview, ...ProcessIsNullWhenAbsent) duplicate a fair amount of inline object setup. They could be collapsed into a single [DataTestMethod] with [DataRow("AUTOMATED")], [DataRow("EXPERT_REVIEW")], [DataRow(null)] to reduce repetition, matching the [DataTestMethod] style already used elsewhere in this file (lines 16-30, 179-188). Purely a readability nicety; the explicit tests read clearly as-is.

What's Done Well

  • Good test coverage: the change covers populated value cases, the null/absent case (verifying the property is correctly optional), and integrates process into the shared GetBreakdownResponse() helper and AssertBreakdownResponseValuesCorrect() so the existing CheckBreakdownResponseIsParsed and CheckReportResponseIsParsed tests also exercise the new field.
  • The implementation follows the existing class convention exactly — [JsonProperty(PropertyName = "...")] with a private set string property — keeping the response model consistent and deserialization-only as intended.
  • The null-when-absent test is a thoughtful inclusion that documents the field's optional contract.

Overall

Approved — ready to merge. The nits are optional and do not block.

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the DocScan session retrieval models to expose the IDV breakdown "process" field (previously present in API responses but not surfaced by the .NET SDK), making it accessible to SDK consumers via BreakdownResponse.Process.

Changes:

  • Added BreakdownResponse.Process with Newtonsoft.Json mapping for "process".
  • Extended existing breakdown parsing assertions to include process.
  • Added unit tests validating deserialization for "AUTOMATED", "EXPERT_REVIEW", and missing process.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Yoti.Auth/DocScan/Session/Retrieve/BreakdownResponse.cs Adds Process property mapped to the "process" JSON field so SDK consumers can read the breakdown handling mode.
test/Yoti.Auth.Tests/DocScan/Session/Retrieve/Check/CheckResponseTests.cs Adds/updates tests to confirm process is correctly deserialized and included in existing breakdown assertions.

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

@mehmet-yoti mehmet-yoti requested a review from nikhilPank June 18, 2026 10:30

@nikhilPank nikhilPank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

3 participants